AC RMS voltage measurement with AVR microcontroller

Hello friend many times the readers are asking for an AC RMS voltage measurement system with AVR microcontroller or any other microcontroller.This task can be divided into two sub tasks.
1)Attenuating Line voltage to the level that can be applied to microcontroller pin.
Here is the circuit used to measure AC line voltage (230V,50 Hz) this circuit converts line voltage to the level of 0 to 5 volts. This can be understood by most of microcontroller and ADCs.Here is an op amp based circuit to do the job.
This a simple adder circuit to add some offset to your signals.

Here is the link to developer’s website where he has given value and reasons of selecting every component in very well manner.

AC RMS voltage measurement with AVR microcontroller

So half of our work is done.

2)Software to measure AC RMS Voltage value
You can directly measure DC value with ADC if you take a reading but that is not the case with AC signals.
To calculate RMS value of AC signals you should sample at least 3-4 cycles and then calculating RMS value.

Rather than developing our own algorithm from scratch we have found out this nice post about Power measurement with the help of Arduino (basically an AVR)

The guy has well explained the techniques to measure the AC voltage and currents with coding.

Here is another project of AC RMS measurement with Atmega 8535 microcontroller.

Incoming search terms:


  1. mohsin says:

    where should the neutral wire be conneted ??

  2. To know about how to measure analog voltage using analog module of PIC16F877A microcontroller go through PIC microcontrollers tutorials.

Speak Your Mind