Too high voltage measurement compared to mains voltage (uno + emonTX Shield)

Hi all,

I have an arduino uno with a emonTX shield purchased recently, along with a AC-AC adapter (77DE-06-09) with a euro plug.

I'm using the standard sketch from here:

https://github.com/openenergymonitor/emonTxFirmware/tree/master/emonTxSh...

However, I'm getting readings around 275-285 V on the mains voltage... This seems much too high... I also checked with a standard energy meter that plugs into the power outlet, this showed 230 V (as would be expected).

I didn't change the calibration factors yet -- just seems strange the measurement is so far off, when I got the AC-AC adapter from the shop ?

The calibration factor in the sketch is 300.6 as shown in this code line

if (CT1) ct1.voltage(0, 300.6, 1.7); // ct.voltageTX(ADC input, calibration, phase_shift).

However, the calibration page only makes reference to the factors 220.0 and 260.0, if I read the page correctly. (http://openenergymonitor.org/emon/buildingblocks/calibration).

Can someone confirm the 300.6 figure for the emonTX shield?

 

Since I have the energymeter I can adjust my calibration figure to make the output correct. Shall I just do that, or should I be concerned something else is wrong?

 

Attached picture of setup (the arduino was powered by a USB-PC cable). The green cable is to set the DS18B20 to dig4 on the uno, by the way...

 

Many thanks for your kind input

Lasse

ps: additional question popped up: when I power the arduino from an external power supply (not the PC), I can't get my sketch to run before I hit the "reset" button on the arduino... When powering from the PC this is done upon uploading the sketch and when hitting the "serial monitor" command...

However, when the emonTX shield is on top of of the UNO, its not easy to actually reach the RESET button on the UNO PCB since its underneath the shield... Am I doing something wrong - should the sketch start without hitting reset? I tried adding a 3s delay in the setup(), read somewhere that that may be a good idea so the RFM12B would have time to startup... But still the sketch doesn't start unless I physically hit the RESET button.

The power adapter should be fine: 9V and >500mA (650mA I think),

-------------------- 

  delay(3000);
  rf12_set_cs(5); //set RFM SS pin 5, according to option 2 http://wiki.openenergymonitor.org/index.php?title=EmonTx_Arduino_Shield 
  rf12_initialize(nodeID, RF_freq, networkGroup);                          // initialize RFM12B
  rf12_sleep(RF12_SLEEP); 

lassetobiasen's picture

Re: Too high voltage measurement compared to mains voltage (uno + emonTX Shield)

Don't think the picture uploaded - trying again.

lassetobiasen's picture

Re: Too high voltage measurement compared to mains voltage (uno + emonTX Shield)

hmmm file upload is not really working for me.

Anyway, I'll upload it to the web in stead. 

Picture is here: http://www.lassetobiasen.dk/images/2014-10-23_uno%20setup.jpg 

Sketch is here: http://www.lassetobiasen.dk/images/Shield_CT1234_Voltage_Temp_LST.ino 

 

Robert Wall's picture

Re: Too high voltage measurement compared to mains voltage (uno + emonTX Shield)

If you look at the circuit diagram on Solderpad, the voltage divider is 120 kΩ and 10 kΩ, so plugging those numbers into the formula
voltage constant = 230 × 13 ÷ 11.5 = 260
("13" is the inverse of the voltage divider ratio, "11.5" is the Euro adapter output voltage from the data sheet for 230 V in). There are component tolerances of course, 5% on the adapter voltage and 1% on each resistor, so if those have all gone the wrong way you might well see a very high voltage. The purpose of calibration is to correct for those. I suggest you start with a calibration constant of 260, and adjust it so that you get the same voltage as your energy meter (but check its claimed accuracy first).

(I suspect the example sketch hasn't been corrected for the newer adapters and the changed divider ratio, it was 11 on the earlier shield.)

Sorry I can't help with the reset problem.

Robert Wall's picture

Re: Too high voltage measurement compared to mains voltage (uno + emonTX Shield)

The coefficients for the Shield are in the table - now! I don't quite know why they were missed off. They are the same as the emonTx V3, as the divider ratio is the same for both.

dBC's picture

Re: Too high voltage measurement compared to mains voltage (uno + emonTX Shield)

In the case where it doesn't run without a manual reset, does the Uno's LED flash briefly, or does the LED remain completely dark?  

If the LED flashes and then goes off, that suggests it's coming out reset ok and probably jumping to the system image ok.  Most bootloaders turn the LED off just before they jump to the system image.  You could then add some code right at the beginning of setup() to turn the LED on, and see if that runs.   Check the Blink example if you're unsure of how to do that, but basically you need to make pin 13 an output and set it high.  Assuming that works, i.e. you've now got a hung system with the LED on, then move that LED-on code further south until it doesn't come on, and you'll be able to narrow down where it's hanging.

If the LED remains completely dark then that suggests not even the bootloader is able to run, which would suggest a voltage issue, but given it "recovers" with a manual press of the RESET button that seems unlikely.  The BOD is pretty good at bringing the CPU out of reset after the voltage has stabilised, so my money is on a firmware hang.

lassetobiasen's picture

Re: Too high voltage measurement compared to mains voltage (uno + emonTX Shield)

@ Robert:

Thank you for your reply, that makes more sense. As you may remember I was getting watt readings slightly too high (+20%) but this was due to the voltage having an incorrect calibration figure. So this all seems to come together.

@dBC:

The UNO POWER LED goes green, and remains green (I don't think the other LEDs on the uno flash though). And the emonTX shield red LED doesn't flash at all -- I have it set for 2 seconds on in my sketch, this doesn't happen unless I hit the manual reset on the UNO (kind of fiddly with the shield in the way!)

I am away on business for a few days (Ahh France) but I'll take your advice on moving some LED-on code around to see where it hangs!

Previously I have had some mishaps due to my own bad soldering, hopefully this is not again an issue ;-)

Thanks both for replying!

Kind regards,

Lasse

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.