Features
- – Measures mains AC voltage up to ~250 VAC RMS for single‑phase monitoring.
- Isolated sensing via a miniature voltage transformer (ZMPT101B) for galvanic separation from mains.
- Signal conditioning with LM358 dual op amp to amplify and buffer the transformer output.
- DC‑biased analog output that swings around VCC/2 so microcontroller ADCs can read the waveform safely.
- Onboard multi‑turn trimmer for amplitude calibration to match 3.3 V or 5 V ADC ranges.
- Simple 3‑wire interface: VCC, GND, OUT (plus L and N terminals for mains input).
Description:
This module (commonly sold as an LM358 V3 / ZMPT101B AC Voltage Sensor Module) converts mains AC into a low‑voltage, isolated analog waveform that is centered at VCC/2 and scaled to your MCU supply. The transformer provides isolation and initial step‑down; the LM358 stages amplify and offset the signal so the module output is safe for ADC inputs.
Using with an ESP32
- Wiring: power the module from the same supply domain you use for ADC reference (typically 3.3 V for ESP32), connect GND to ESP32 ground, and feed OUT to an ADC pin. Connect mains L and N only when you are confident with safe wiring.
- Sampling: sample the OUT waveform at several hundred to a few thousand samples per mains cycle, subtract the DC offset (VCC/2), compute RMS in firmware, and apply a calibration factor.
- Calibration: adjust the onboard trimmer while comparing against a trusted true‑RMS meter, then store the calibration constant in flash.
Integrating with Home Assistant
- Local sensor feed: run the ESP32 with firmware (ESPHome, Tasmota, or custom code) that computes RMS voltage and exposes it as an MQTT or native Home Assistant sensor. Use the calibration constant to convert ADC RMS to mains volts.
- Automation ideas: trigger automations for over/under‑voltage, log voltage trends, or combine with a current sensor to estimate real power and energy consumption.
Notes:
- Safety first: the module interfaces with lethal mains voltages; only qualified persons should wire and test it. Even though the transformer provides isolation, probe and enclosure practices must be safe.
- Accuracy limits: expect good hobbyist accuracy after calibration; transformer phase shift, op‑amp tolerances, and ADC resolution affect final results




