Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

ZMPT101B AC voltage sensor

ZMPT101B mains voltage sensor pinout, how its isolating transformer works, calibrating the gain pot, and the safety rules for the 230 V side.

Analog

Community draft — report a mistake

CategorySensor
InterfaceAnalog
Voltage5 V (some boards 3.3 V)
Typical price₹150

3.3 V or 5 V? OUT is an AC waveform centred on VCC/2. On ESP32/Pico power the module from 3.3 V if your board supports it, or divide OUT so it never exceeds 3.3 V.

The ZMPT101B is a tiny voltage transformer plus an op-amp. The mains side goes through the transformer’s primary (via a current-limiting resistor), so the low-voltage side sees a small, isolated copy of the 230 V waveform that an ADC can sample. Compute RMS over whole cycles to get the mains voltage — useful for under/over-voltage alarms and power-quality logging.

The blue trim pot sets the gain. Calibrate once against a multimeter.

⚠ Mains safety (230 V) — can kill. The input terminals connect directly to 230 V. The transformer isolates your board, but the module’s input side, terminals and tracks are at mains potential.

  • Use the module only inside a closed, non-metallic enclosure, with the mains side separated from the low-voltage side. No bare 230 V terminals anywhere you could touch.
  • Have a licensed electrician wire the mains side, with an MCB (and RCCB/ELCB) on the circuit. Test everything with the circuit switched off at the MCB.
  • Never touch the board, the screw terminals or your Arduino/ESP32 while mains is connected — and never connect a USB cable to your PC while the mains side is live unless the module’s isolation is the only path between them and you trust it.
  • Mount the module in its own insulated box, feed it through a fused lead, and keep low-voltage wiring away from the mains side. If you only need to know whether power is present, a USB charger and a VBUS/brown-out check is far safer (see the power-cut alert project).

Prices are indicative (Oct 2026) and vary by seller.

Pinout

PinWhat it does
VCC5 V (or 3.3 V) supply for the op-amp
OUTAnalog output: a small sine wave centred on VCC/2
GNDGround (the module has two GND pins on the same net)
LMains input terminal — 230 V live (electrician only)
NMains input terminal — neutral (electrician only)

Use it with

Common errors

Output looks clipped (flat tops)

The gain pot is too high. Turn it until the waveform on the serial plotter is a clean sine wave well inside the ADC range.

Voltage reading is 10–20 % off

Calibrate: measure the same socket with a trusted multimeter and scale your RMS value to match.

Readings jump when Wi-Fi transmits

ESP32 ADC noise. Average over several mains cycles, use ADC1 pins and add a 100 nF capacitor from OUT to GND.

↑↓ to move · Enter to open