Measure altern voltage (220v)

Hello!!

At first place, sorry for mi english, i´m not english native speaker.

I need measure altern voltage (220v) with my arduino. I was looking for this topic but unfortunely i did'nt found anything. There are several sketches but nothing about the electronic circuit needed for it.

I am dummy with arduino and his world so any help that you can give me will be really welcome.

Regards.

See How to build an arduino energy monitor | Archived Forum

When working with line voltages (and currents) such as 220AC, you need to be very careful not to destroy your board or kill yourself - that voltage can kill. If you are not comfortable working with electronics, do NOT work with line voltages - you run serious risk of destroying your board or yourself. :o

This is going to sound complicated.... It's really not, but I'm not going to give you all the details so you'll have to do a little research...

The Arduino cannot directly read AC (it can be damaged by the negative half of the cycle) and it can be damaged by voltages greater than +5V.

Do you have a multimeter? You're going to need one to calibrate your Arduino.

  1. Use a transformer to step-down the voltage and to provide isolation from 220V. 12V transformers are common, but it's not too critical. (Make sure that's an AC transformer, not a DC power supply or a charger.)

  2. Add a diode (or a bridge rectifier) to convert the AC to DC.

  3. Add a capacitor to filter the DC (in this application, a 100uF capacitor or higher should be good).

  4. Measure the DC voltage with your multimeter. The capacitor should charge-up to about 1.4 times the AC voltage, after the 0.7V drop across the diode (or the 1.4V drop across a bridge rectifier). Transformers are usually rated at full-load, and with a light load you'll probably get more. So a 12VAC transformer might give you about 18VDC.

...At this point, you've essentially built an unregulated power supply where the DC voltage is proportional to the AC voltage.

  1. Calculate and wire-up a [u]Voltage Divider[/u] to give you a little less than 5V. The total resistance should add-up to about 10K Ohms, but it's the ratio that's important.

  2. Add a [u]Protection Diode[/u] to protect against unexpected voltage spikes.

  3. Measure the 220VAC with your multimeter and measure the DC voltage into your Arduino (out of the voltage divider) to confirm it's about 5V.

...That's it for the hardware unless you want to add a display, etc.

  1. Read the [u]Analog Input[/u] and note/calculate the ratio between the AC voltage and the ADC reading.

  2. Use the above ratio to in your sketch to calculate the voltage. (i.e. If 220VAC gives you an ADC reading of 1000, then 110V will read 500, and a reading of 909 would be 200VAC.

Thank you very much!!