Hi,
I've put together a build based on openEnergyMonitor. The only changes are a variable gain amplplifier, controlled over SPI, so that the ful lADC range is used as much as possible across the current range, and a 1:1 isolating transfroer, so I can run the circuit from the same AC adapter as the voltage is sampled from. I've also added a pot so I can adjust the voltage at the ADC input without changing the code - and will probably do the same for the current as well.
It's currently outputing data, via a serial<>ethernet bridge, to here:
With a photo of the (not very neat) veriboard here:
http://www.flickr.com/photos/22415346@N06/5822031737/
One thing I have noticed is that the measured voltage drops significantly under load - so for instance when the fridge turns on, the measured voltage drops by ~6 volts and the power factor drops. The end rsult is while there is an increase in apparent power, there is very little change in real power. Not sure how realistic this is - will need to leave it runing and compare against my electricity meter over a few days.
There also seems to be more noise than I would like on the voltage measurement. Not sure if this is down to the use of the isolating transformer....will need to look into it.
Ben
Re: New build
Hi Ben
The voltage variation is interesting. I have not seen this even when using a welder or even worse a 8kw plasma.
Sure your PF will be affected which should give you variation in VA.
If the voltage is really dropping - you have a supply issues. Something like a loos connection or faulty breaker.
I see you had a 10kw spike today in you data and the voltage drops on both sides of this. So my guess is a loos connection that is also overheating. Or there is a measurement issue.
Clinton
Re: New build
Yes - I am a bit suspicious of that volt drop.
I'm going to check it this evening with a voltmeter on the mains. If it is some strangeness with my measurement circuit, I'll have to track it down. Scraping the barrel here, but it could be that a higher current draw is causing the bias voltage on my ADC to drift. But the AC<>AC adapter is on a spur straight from the consumer unit - and the fridge is on another.
Anyway - while it may be hard to fix, it should not be too hard to track down :-)
Ben
Re: New build
1 thing to check is your method of reading the ADC.
If you are not correctly selecting the channel you could be reading values from another register.
Otherwise the volt drop is real and there is a major problem but then you would find heats.
Re: New build
Ok....using my hoover as a test load - slightly easier to predict than a fridge pump for similar characteristics!
The house voltage stays stead as a rock when turned on. My circuit readout drops considerably.
It looks like the problem is with the MCP6S28 programmable gain amp. If I bypass it, all is fine - but without the gain.
Disconnecting the current sensing input to my ADC fixes the problem - voltage steady - but of course leaves me with no current readings :-)
Looking at the serial dumps, it looks like the voltage read at the ADC goes awry whenever the gain of the PGA changes. Not sure yet where the linkage is - since the current, which is certainly is (by design) affected by the PGA, works fine :-)
But looking at this thread:
http://forums.adafruit.com/viewtopic.php?f=25&t=11597
Looks like it may be relevant. The output of my isolating transformer is dropped down via a pot across a 1K resistor - less that the 10k output suggested by atmel. but considerably higher than the output impedance from my amp.
For the moment I've set the gain to 1 - which has reduced the resultuion of my current plots, but given me something like stability. I'll try to dig out an opamp this weekend and try a buffer for a nice low output impedance.
Re: New build
Looking at your veroboard photo, I noticed that the prog gain amp is long way from the power supply section. Do you have suitable supply decoupling close to it?
To quote from the data sheet:
Use a 0.1 μF supply bypass capacitor within 0.1 inch
(2.5 mm) of the VDD pin. It must connect directly to the
ground plane. A multi-layer ceramic chip capacitor, or
high-frequency equivalent, works best.
Do you have a sufficiently fast oscilloscope to see whether the amp is stable?
Re: New build
Using the lab scope, the amp does appear stable - even if the veriboard is a bit of a mess! However, you ae right a bit of decoupling can't do any harm, and may help - I'll give it a go.
Since the isolaing transformer gives a slightly distored sine at the secondary (only designed for audio frequencies really) and the and in the inerests of making things as simple as possible while debugging, I've bypassed the transformer completely and powered the board from an independant supply from the AC sampling one.
I'll try to have some time to look into it again this weekend!
Re: New build
Not sure if I understand you correctly but it sounds like you are sampling your isolation transformer and also using the same feed to supply your circuitry.
This is not a good idea and you should sample from a 2 x secondary transformer.
1 supplies the circuit, the other for sampling only. You should then get a good clean waveform.
Re: New build
Yes - I took out that isolation 1:1 transformer, as it introduced all kinds of nasty harmonics.
I'm currently running off two seperate supplies, but am thinking of trying a chassis mount 230v<>9v transformer, with two secondaries. I could use one to get my AC waveform, the other my DC supply - after rectification and regulation - keeping things as compact as possible.
Re: New build
You would probably do better to use two separate, smaller transformers (even if it costs a little more) The problem with a transformer with 2 secondaries is that the current in the coil providing the power supply is not constant throughout the mains cycle - it only flows while the instantaneous voltage is greater then that on the reservoir capacitor (+ a diode drop).
Of course this doesn't cause a resistive voltage drop in the other secondary, but it does cause a magnetic circuit drop and will still give some distortion.
Most transformers are designed so that copper and iron losses are about equal at the rated power, so using a big enough transformer will reduce this effect to a negligible size, but that's going to add weight, power and expense.
Re: New build
You are right - two supplies is the best solution.
However, one supply is far more compact. I currently have it running here:
http://bbarker.co.uk/energy
http://www.flickr.com/photos/22415346@N06/
Running of a single kettle lead into a 9v dual secondary transformer - courtesy of a five pound note and a maplin store.
The sine wave is not perfect by any means, but neither is it terrible.
Re: New build
My compliments on a tidy, compact board.
I think I can see some flattening of the top of the sinewave, but, as you say, it probably won't matter much.
I tried a similar approach with a small, dual secondary transformer. It was OK with just the Arduino and a logger shield, but looked much worse when driving an LCD backlight (~150mA @5v), also the calibration appeared to drift with temperature
Re: New build
Hi,
I created the page openenergymonitor.org/emon/energy-monitor-pcb-xbee-support with a common and easy to use PCB.
Maybe you can add this 1:1 isolating transformer to the schematic or improve in other ways.
Thanks,
Wagner Sartori Junior