Hello!
Could anybody please post me a short example script for DC voltage measurement (maybe taking some samples to reduce noise) with the EmonTX?
Of cause I know that I have to modify the schematic, but that's no problem for me. I only need a software example to understand how to do it.
Re: Measuring DC voltage?
What d.c. voltage are you trying to measure?
Re: Measuring DC voltage?
Hello Robert!
I want to measure the voltage of a 255W solar panel, maximum voltage will be about 40V. The panel is mounted on my garden shed.
When the voltage measuring works I will add a current sensor (ACS712) on a second channel, but first I have to understand the software part. The hardware is no problem, I allready did this using a PIC, but not with an ATMEL.
Re: Measuring DC voltage?
I was concerned that without isolation - both on the voltage side and the current side - that you would be at great risk, because direct voltages can be much more harmful than alternating. Do please be aware of the potential dangers and treat the panel as being live at all times.
I assume you will probably be using an op-amp with a differential input so that you don't need to tie the common rail to either of the d.c. connections, neither of which need to be at or even near earth potential. You'll need to make sure you have minimal d.c drift, because this will have a direct effect on accuracy.
I've not seen a sketch mentioned for measuring the direct output from the panels, though I understand some have decoded the data output from their inverter, to obtain the same information.
Basically, you can use the sketch here http://openenergymonitor.org/emon/node/31 as a strarting point, because once the input has been digitised, you treat voltage exactly the same as you treat current. The library has a filter built-in to smooth the values, but obviously you'll need to understand and change the calibration.
Re: Measuring DC voltage?
I keep meaning to remove the dc shunt page and replacing it with what I found to work better in the end when I was doing DC sensing which was these nice little modules from cool components:
Voltage and current monitoring:
http://www.coolcomponents.co.uk/catalog/attopilot-voltage-current-sense-...
Current only
http://www.coolcomponents.co.uk/catalog/acs715-current-sensor-breakout-p...
Re: Measuring DC voltage?
Hallo Jürgen :-),
it would also be possible to use this board (shunt missing) :
http://jeelabs.com/products/analog-plug
for bi-directional current measurement with very high accuracy. The emontx provides 'Jeelab ports', so it should be possible to use the software routines provided by the jeelib library (/examples/ports/analog_demo).
I have already used the same chip (4 channel MCP3424) for other purposes and found it to be very nice and accurate (and quite cheap also). There are also one and two channel versions.
Re: Measuring DC voltage?
Hello Robert!
I'm aware of the special danger with direct voltages and currents, I attended a school for electrical engineeering. So I know about the dangers and risks in theory and practice.
I will use a box where I put all compoents and the EmonTX into, so there will be only two wires going into from the panel and two wires leaving the box to the inverter. (I'll measure the AC current too with a CT).
For the current measurement I will use a ACS712 that allready isolates between the current and the voltage output.
As the ACS712 uses 5V and can measure currents bidirectional (-20 to +20A) the output is centered around 2,5V. Higher voltage means positive current, lower means negative current. If I connect the current path in reverse direction I'll get 2,5V (0A) to 0,5V (20A), so no problem for the ATMEL 3,3V inputs, only a litte bit of mathematics for the ATMEL.
Re: Measuring DC voltage?
Are you wiring this panel into an inverter? If so that may be the best place to get the readings from?
Re: Measuring DC voltage?
Ok I found the function in the /examples/ports/analog_demo file. That's really simple. I only had to multiply the value by 3,225 to get the correct value in milivolts.
Udc = analogRead(A0)*3.226; // Read input from Analog Pin 0=CT2. Pin 1=CT3.