Go Down

Topic: monitoring 120/240 vac (Read 2 times) previous topic - next topic


Your main problem of using a simple resistor divider network is that your circuit will be either at near ground or near mains voltage, depending upon the "polarity" of your input wiring.  Hook it up wrong and your whole arduino circuit is potentially lethal. 


Aug 18, 2011, 12:18 am Last Edit: Aug 18, 2011, 12:32 am by 2660 Reason: 1
Ok more info, first off I make my living with "high voltage" (120, 208, 240, 277,480v ) and am aware of what can go wrong. I am looking for advice on factors that affect how accurate and reliable the use are, not if it can kill you.  8)

The project is monitoring (internet) of backup generators.


Can you tell us why you CAN NOT use a isolation transformer ( a cheap take-apart AC Wall adapter ) And why you want a DIRECT way ?   So what is the "issue" here ?  My opinion is : Risk to damage the Arduino <--- BIG TIME !!!

I never said I "CAN NOT", I said I would prefer not to use them.  When finished this project will be a potted PCB in an aluminum enclosure, so the smaller I can keep the components the better.  It would also require six transformers to monitor each unit so the size of even "small" transformers adds up fast.  Transformers also add thermal load.


Why is a PC transformer an option but a wall wart isn't?

The finished product will be a one piece unit that is hardwired into the transfer switch.  


Are you trying to sense supply anomalies (interruptions, brownouts, spikes, RFI, etc.)?

For this part only voltage.


Your main problem of using a simple resistor divider network is that your circuit will be either at near ground or near mains voltage, depending upon the "polarity" of your input wiring.  Hook it up wrong and your whole arduino circuit is potentially lethal.

Yep. if it is connected wrong bad things will happen


Aug 18, 2011, 12:37 am Last Edit: Aug 18, 2011, 12:46 am by retrolefty Reason: 1
How about this, it is the same regardless of input.

Those values of resistors (megohms) are much too high to meet the 10k ohm (or less) source impedance that the arduino analog input requires, readings will be very noisy and drifty. Use a small 120/240 input / small AC secondary voltage, PC mounted transformer like I linked to below. That way you are dealing with much lower AC secondary voltage and also you would then not have to make any wired connection from the arduino ground reference to the AC neutral. Heck, size the transformer correctly and it could even also power the arduino board with a added rectifier/filter/positive voltage regulator.

Just take the secondary winding voltage and rectify, filter, and voltage divide to equate a 0-150 ACV = 0-5vdc, or a 0-250 ACV = 0-5vdc. All you need is a representative proportional sampling of the raw AC voltage, which is then scaled in your arduino software to the original voltage units.




I am looking to monitor a generators output 120/208v  &  120/240v

Hi 02660

Have you considered also monitoring the current.  Not my area of expertise but I suspect there would be large switches inline to switch from mains to generator.  Monitoring current would ensure you are seeing a load on the generator.

Regards   Bill
Don't you just hate ONE D 10 T problems?


Aug 18, 2011, 07:05 pm Last Edit: Aug 18, 2011, 07:09 pm by dc42 Reason: 1
Hi 02660,

If you are certain that you can live with the Arduino GND being connected to one side of the 120v or 240v supply, then you can use a potential divider. For example, connect 20K between the analog input and the Ardiono GND pin, 20K in parallel with 1.5M between the input pin and the +5v pin or the AREF pin, and 1.5M from the pin to the other side of the 120v or 240v supply. This will give you a reading around 0 at -375v, 512 at 0v and 1023 at +375v. Since the peak voltage of a 240v RMS AC signal is about 340v this give you some margin. This provides a source resistance of just less than 10K to the ADC in the Arduino, which is low enough for the ADC to function reliably.

Be sure that the 1.5M resistor has an adequate voltage rating, or make it up from several smaller resistor in series.

Unless you run the Arduino from batteries, you will need to provide a dedicated power supply to it (because Arduino GND will be referenced to one side of the AC supply).

You will need to use optical isolation between the Arduino and whatever it sends the data to, to overcome the problem that Arduino GND is connected to one side of the generator output.

If you just want to check whether the generator is running (and perhaps measure the frequency) rather than measure the voltage, then I suggest you monitor its output via an opto isolator instead. Drive the opto isolator from the AC voltage being monitored via a series resistor, and connect a diode in parallel with it to prevent it being reversed biased during the other half of the cycle.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up