measuring 220V ac with MCU - Page 1
Forum section: electronics / beginners

author: A2
author_rank: Contributor
timestamp: July 11, 2014, 11:15:12 am
content: I want to measure 220V ac with MCU.Instead of using step down transformer, I want to use voltage divider of 1M & 3.3K.So that 0V-220Vac gets reduced to 0V-0.724Vac.Since it will also include negative peaks & MCU cannot measure negative values unless I put some offset to it.So I have added 2.5Vdc offset.Now I know that this can be done by opamp as an adder. But since I have -ve going peaks in ac voltage, so do I need to add -ve supply rail to opamp or opamp can add both volatges without using negative rails as one of voltage is going negative.?1. Do I need negative rails?2. What should be right opamp for this application?3. Any reference schematic or any application node explaining measurement of 220V will be helpful

author: tszaboo
author_rank: Super Contributor
timestamp: July 11, 2014, 11:35:32 am
content: I wouldn't connect 220V in any configuration to an MCU this way. It would be inherently unreliable, not to mention, not safe.If you want to build a measurement system like that, use an ASIC made for that. That is characterised, tested, it has ready made solution, it works. Even if you dont listen to me, read the datasheets, it contains useful know-how information. You will find several solutions at analog devices, but TI, linear technology, and afaik, even microchip makes asic for this.http://www.analog.com/en/analog-to-digital-converters/energy-measurement/products/index.html

author: Psi
author_rank: Super Contributor
timestamp: July 11, 2014, 12:32:58 pm
content: Im not suggesting you should do the following...And this is probably more complex than what you need, but, you can decouple the AC with a capacitor and read the entire positive/negative AC waveform directly with the ADC input and a few resistors.ie,ADC input with 5K resistor to VCC and another 5k resistor to GND (so that the ADC sits at 2.5V assuming 5V VCC)Then you could connect mains through a large resistor, say 330K, and then a 100nF capacitor connected onto the ADC input.(Mains earth will of course need to connect to your GND to complete the circuit)This will generate the AC waveform centered at 2.5V on the ADC input. The amplitude of the AC signal will depend on the resistors/cap used.Then you can measure the waveform in software using the MCU and do stuff like calculate the peak volts as well as RMS. You can also sample/store the actual AC waveform.A quick simulation seems to indicate 330K, 100nf and 2x 5K is about right for 220V AC to +/- 2.4V on ADC input. However you should understand what you're doing and why it works before trying it.And just let me say again, this isn't a good idea from a safety standpoint.

author: Circuitous
author_rank: Unknown
timestamp: July 11, 2014, 01:18:37 pm
content: As suggested you can go with a dedicated energy monitoring chip like the CS5463 or CS5464, which will perform the RMS calculations and such for you.Or, a better fit for your situation might be an isolated AD converter like the ADE7913. I tried out the ADE7913, and it seemed to work just fine, and it was easy to use. I haven't really written up my findings and such, but I did review it here: