Electronic – How to measure mains AC voltage with an ADC from a microcontroller

mainsvoltage measurement

I want to measure the Mains voltage (230V/50Hz) using an ADC channel from a microcontroller.

This is my current approach …

Below I have two schematics that add two voltages (one direct, one alternating).

Added to that, the both the AC and DC signals are going through voltage divider, but that isn't important.

I'm guessing that the output voltage on the second schematic is lower because of the impedance of the capacitor?

Schematics

Best Answer

If you only want to monitor the MAINS VOLTAGE, then you don't need to convert the entire sinusoidal waveform, add offset, etc. etc. You seem to be asking the wrong question.

The common way of monitoring mains voltage is to FIRST ISOLATE the voltage with a transformer. This could be a very small transformer as found in a discarded wall-wart power supply, etc. Then rectify and integrate (filter) the voltage so that you have a DC voltage that is faithfully proportional to the mains voltage. This DC voltage can be simply scaled with a voltage divider, perhaps a potentiometer, and fed directly into the ADC input.

Here is a typical circuit which is very good for monitoring mains voltage...

enter image description here

Ref: https://mlabsbd.wordpress.com/2013/11/16/how-to-measure-ac-voltage-with-micro-controller/