Measureing AC voltage in the range 0-260 VAC

Dear Concern,

Please help me. I want to Measure AC voltage in the range 0-260 VAC with Arduino. I have found a voltage divider from a Texas instrument Meter circuit. I have tested it on Proteus but the problem is when i change the input AC, the out put goes +2.21v to +1,99v. I need the circuit work for (0v to +2.21v or 0 to +5v). Please help me. I want isolated 0 to 5v for Arduino. I have Uploaded Proteus DSN and Image.

AC Voltage Devider Texas (13.9 KB)

Dear Concern,

Now i am uploading the Arduino sketch for 260VAC. Please anybody help me.

Arduino_UNO_R3_Opto_Voltage_260_Monitor_ino.ino (2.88 KB)

Hi, welcome to the forum.

It is safer to use a transformer :
If you want to measure up to 260 VAC, you need a transformer that is for 260 VAC or for higher voltages.

That schematic is drawn in a bad way. I have doubts with the circuit itself as well. The capacitors reduce the noise from the VCC, but any inaccuracy of VCC is not compensated. When you would use an internal reference of the Arduino, that circuit brings the inaccuracy of VCC into it.

You can start with: Line — 2M — 2M — (a)— 15k — (b)
At point “(a)” two clamping diodes. For example a 1N4148 to GND and to VCC, like in the schematic.
From point “(a)” a 1k resistor to analog input, like in the schematic.
From analog input to GND a capacitor of 4.7nF.
Point “(b)” should be half way of the maximum span. In this case about 1V.
You can use resistors for that (somewhat like the schematic).
It is also possible to replace the 15k with the resistors of the voltage divider.

If two or three things fail, the current through the 2M resistor can’t damage the Arduino. That is good.

I have a very big problem with the safety. Is someone supervising you ?
Do you know how to make a circuit for 260VAC mains voltages ?
What about the ground ? Is the other Line connected to arduino GND ? That is not possible, you will destroy the Arduino and the computer when you connect a computer to the Arduino.

I found your circuit. It is in the TI Application Report SLAA391.

[EDIT]: I added about point “(b)”, I forgot about that. And I found the schematic in the SLAA391 document.
[EDIT2]: I started wrong with the resistors, but I don’t want to delete this post. Is it for school and you only need it to work in the simulator or are you going to build it ? Then I would like to know which Arduino board and if the 5V is accurate.

Tnx Peter for replay,

For your info i am trying to build a AC-DC Volt meter using Arduino UNO or Mini. Now i have attached a clear Image of the Proteus Diagram. Please help me to build a 0-5v Isolated voltage ckt from 0-260v source for MCU analog input. And for your info, The 5V is accurately ensured.


I'm confused that you need a isolated voltage meter. To measure AC voltage isolated, a transformer is used. To measure DC voltage isolated, a special chip is used. To measure AC/DC not isolated, I could calculate the resistors to have the output in 0...5V range.

If you must be able to measure DC voltages, and it must be isolated, then you need a special chip or build a circuit with an opto-coupler.

The ACPL-C87 is such a chip : It is not easy to use, and a power supply of 5V is needed on the primary side.

This is a circuit with an opto-coupler (scroll down for the schematic):

Some chips measure both current and voltage isolated.

There is also a way to measure a voltage without touching it:

Tnx for replay & Sorry for confusing,

Actually i need such a circuit that can convert 0-260V AC/DC to 0-5V for Arduino UNO MCU. I am requesting a isolated circuit coz i want to protect the MCU. if you can modify my given circuit that will be better.


As soon as you connect mains to that circuit and connect the Arduino to the computer, you get a big shortcut, probably destroying the Arduino and the computer. Not because LINE1 to the resistors, but because of LINE2 to the Arduino GND.

I have many questions:

  • If you do not know how to deal with mains voltages, please do not try to make such a circuit.
  • What is it for ?
  • Do you know that you need a certain fixed sample rate to measure the AC voltage ?
  • Do you want to measure DC voltages, or the DC component of the mains AC ?

The next calculations might be wrong (I should have tested it before writing it down, but I didn’t).

The voltage of 260V AC is the RMS value. That means the top is 368V and when used according to ground the signal is a wave between -368V and +368V.
That should translate into 0V to 5V for the Arduino.
Therefor -368V becomes 0V and +368V becomes 5V. The middle will be 2.5V for the Arduino.

When I use a voltage divider of 27k, the impedance of that is 27k/2
With two resistors of 1M, the circuit can measure from -372V to +372V.

To avoid a shortcut, perhaps a floating ground can be used. I think that will be safe in most situations.
I rather would increase the input range from -600V to +600V for safety, however, attached is a circuit with floating ground. The attached circuit is not isolated !
The voltage is measured by the difference between A0 and A1.

Dear Peter,

Tnx for your co-operation. For your info The AC range is in Peak to Peak. And in Bangladesh our line voltage is 240 peak to peak max. And i want to monitor AC voltage and control of a Generator Start Stop.

Dear Peter,

I have Simulated the Circuit you have Uploaded. When 260V p-p It show +4.23V its OK. But the problem is For 0V AC it show +2.48V !. But i need 0V for 0V AC.

Well, I don't think so. Since the circuit is for an AC input that is a sine wave between -368V and +368V. If the imput is 0V AC, the Arduino measures 2.50V (when the 5V is 5.0V). That is how it is normally done with alternating voltages. A voltage level of 2.50V is created for the Arduino. That is some kind of virtual zero level.

Another option is to use a bridge rectifier and measure the peak voltage. But that is not the RMS AC voltage.

Dear Peter,

Tnx for your nice support. I have managed the Voltage measuring section of my device. Now i am working on the other part of my device. Hopefully i will finish my project soon. If any kind of support are needed i will communicate with you.

BR Reza