Electronics > Beginners
AC voltage measurement with a microcontroller
(1/3) > >>
09d08:
Hi,

I need to measure AC voltages with an ATmega328 for an inverter I'm trying to build. Is a step down transformer necessary in this case since I won't be measuring mains? I was thinking of using a voltage divider, peak detection circuit and a zener for protection but I would like to get some feedback before trying out things that have anything to do with high voltage AC. What is the correct way of doing this?
rstofer:
What voltage?

Can you convert the AC voltage to DC with a bridge rectifier and then store the DC value on a capacitor?  You would then reference one side of the rectifier/capcaitor to logic ground.  A transformer might help here to get the voltage into the realm of reasonable.  The capacitor should charge to the peak voltage of the DC as long as there is no load on it.  The ADC wouldn't load it very much.

Now that you have DC, can use a resistor voltage divider or any other scheme to get the value into range for the ADC.  If you want to offset the voltage (read from 10-20V instead of 0-20V (so you can get better precision at 15V), read Chapter 4 of "Op Amps For Everyone".

09d08:
The maximum voltage would be 220VAC. I guess I should be doing this sort of stuff with a clear head, I should have thought of using a bridge rectifier. I have a small 12V:220V transformer too but I would like to keep the circuit small so I won't use it. Anyway, thanks for your help and mentioning that great book. Here's also the schematic of the inverter I mentioned for those who are interested.
Kleinstein:
A transformer would offer isolation, that might be needed for safety reasons.

A normal small 230V/12 V transformer is not really suitable for measurement. Especially the small one (e.g. < 5 VA) are quite nonlinear due to the magnetization current.  If at all they may be ok up to about 150 V.
09d08:

--- Quote from: Kleinstein on August 23, 2018, 09:02:57 pm ---A transformer would offer isolation, that might be needed for safety reasons.

A normal small 230V/12 V transformer is not really suitable for measurement. Especially the small one (e.g. < 5 VA) are quite nonlinear due to the magnetization current.  If at all they may be ok up to about 150 V.

--- End quote ---

A transformer would definitely be safer due to isolation as you said but I doubt the bridge rectifier and voltage divider approach will cause problems. What do you think?
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod