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):
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.
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).
@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.