AC Line voltage measurement circuit

Hi guys,

I am looking to do a measurement of incoming AC voltage for my AC/DC Converters using the ESP32 DevkitV1. I know there are several breakout boards available online, but I'm designing a PCB and don't want to rely on breakout boards. I am going to breadboard this circuit but dealing with AC voltage I wanted to check with the experienced first.

I found this circuit:

And figured it would work. I do not plan to use the LCD, it will be measured and displayed on the webpage. I adjusted the 1N47xxx diode down to a 1N4782A since the ESP32 is 3.3V, and will not be using the LCD, I drew this adjusted circuit (ACPOS is L and ACNEG is N - ACLINEIN is the ESP32 Analog in port):

Does this seem safe and doable, or should I be looking in a different direction?

Thanks guys

That circuit is not safe for measuring AC mains voltages.
The GND of the Arduino is at approximately half the supply voltage.

The author of the article is a candidate for the Darwin Awards.
He's got mains voltages on a breadboard.

3 Likes

There is lots of information about safely measuring mains voltages at openenergymonitor.org.

Details of measuring mains voltages on their website are here.

2 Likes

You might use an optocoupler ?

Optical isolators are not linear.

Use a step-down transformer. It does two things for you - It steps-down to a non-lethal voltage and it completely isolates your circuit (and you and your computer if the USB is connected) from the line voltage.

...Don't buy a DC "power supply.".. You want a bare AC transformer.

Nothing is critical about the transformer except the primary voltage. If you can find a 6V secondary that would be great, but you'll need a voltage divider anyway so up to 24V is fine. (Anything over 50V is considered dangerous by most regulatory agencies.) With a center-tapped secondary you can get half of the voltage. There will be almost no current, so the current rating is not important.

Transformers are AC so you'll still need a resistor & diode for reverse-voltage protection, and a Zener can double as over-voltage protection.

Here are some over-voltage and negative-voltage protection circuits. (You can increase the resistor to between 1K and 10K for less current)

You'll probably need a voltage divider (one more resistor). You should design the voltage divider so the over-voltage protection never kicks-in under normal conditions, because you want to measure the voltage. But, you need protection against negative voltages in any case.

And because transformers aren't "perfect" you'll have to calibrate to match an actual multimeter. Generally, you'll get more than the rated voltage with a "light load" but the secondary voltage is linearly proportional to the primary voltage (as long as you don't change the load).

4 Likes

Thanks for the pointers guys. I'm trying to avoid using a transformer, but if I have to, I have to.
I'm assuming this is just as useless then?

Lethal......

Tom..... :grinning: :+1: :coffee: :australia:

Using a transformer is the only safe approach.

OK i'll see if I can source a 120V/6V transformer that's PCB mountable, unless anyone has a link for one on DigiKey or Mouser?

ZMPT101B

I would avoid that and mount your transformer where the high voltage side can be kept away from your fingers whilst you develop your circuit .

Something like This which uses a transformer

2 Likes

Find one at a second hand shop.
With lead and proper casing.
That will keep you safe...
And will cost you 1 or 2 USD.

@jim-p You are a godsend! Thank you for finding that. With a datasheet or schematic I should be able to do the same circuit as the breakout board does.

To everyone else, I appreciate all the time you have helped me with this, especially to avoid a dangerous circuit.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.