Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›ZMPT101B AC voltage sensor

Component guide · Intermediate · 3 min read

ZMPT101B AC voltage sensor

Pinout, Wiring and Code

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the ZMPT101B AC voltage sensor isZMPT101B AC voltage sensor pinoutWiring the ZMPT101B AC voltage sensorExample codeSetup and tuningWhat you needAlternatives and when to choose themTry itCommon mistakesFAQsParts and next steps
Short answer

The ZMPT101B module measures AC mains voltage through a small isolating transformer and outputs a safe AC signal centred on half the supply voltage. Your code samples that signal, removes the offset and calculates RMS volts. Calibrate it against a multimeter using the trimmer. The mains side must be fully enclosed and wired by someone qualified.

Key specs at a glance

Input
AC up to about 250 V (mains)
Isolation
ZMPT101B precision voltage transformer, 4 kV isolation
Output
AC signal centred on VCC/2
Supply
5 V (3.3 V on some boards with reduced range)
Adjustment
Trimmer for output gain
Frequency
50 or 60 Hz
!Safety: Mains voltage can kill

This part is often wired to 230 V mains. Do all wiring with the plug pulled out, keep mains wires inside a closed box with strain relief, add a fuse, and never touch the board while it is plugged in. If you are new to mains wiring, have an electrician check it before you switch on.

01

What the ZMPT101B AC voltage sensor is

The ZMPT101B is a tiny precision transformer. On the module, mains voltage drives it through a resistor, and an op-amp turns its output into a scaled AC waveform sitting on a DC offset so the ADC can read both halves.

With an ACS712 or a split-core CT for current, it forms the basis of a DIY energy monitor. For a ready-made, safer option, see PZEM energy meters.

02

ZMPT101B AC voltage sensor pinout

The pins on the ZMPT101B AC voltage sensor and what each one does.

PinFunction
VCC5 V
GNDGround
OUTAnalog output (AC around VCC/2)
L / N terminalsMains input (live and neutral), high voltage
PinFunction
VCC
5 V
GND
Ground
OUT
Analog output (AC around VCC/2)
L / N terminals
Mains input (live and neutral), high voltage
03

Wiring the ZMPT101B AC voltage sensor

Disconnect mains before touching any wire. Fuse the live input, use an enclosure and keep low-voltage wiring away from the screw terminals. Scale OUT for a 3.3 V ADC.

ZMPT101B AC voltage sensor pinArduino UnoESP32
VCC5V5V (VIN)
GNDGNDGND
OUTA0GPIO 34 via 10k/20k divider
L / NMains (enclosed, fused)Mains (enclosed, fused)
VCC
Arduino Uno:
5V
ESP32:
5V (VIN)
GND
Arduino Uno:
GND
ESP32:
GND
OUT
Arduino Uno:
A0
ESP32:
GPIO 34 via 10k/20k divider
L / N
Arduino Uno:
Mains (enclosed, fused)
ESP32:
Mains (enclosed, fused)
04

Example code

The calibration factor depends on your trimmer setting. The EmonLib library offers a ready-made voltage and power calculation.

RMS voltage over several mains cycles · Arduino C++Verify & upload in Electrolark
const int PIN = A0;
const float CAL = 0.75;            // adjust until the result matches a multimeter

void setup() { Serial.begin(115200); }

void loop() {
  const int N = 1000;              // about 0.12 s, or 6 cycles at 50 Hz, on an Uno
  long sum = 0; static float offset = 512;
  double sq = 0;
  for (int i = 0; i < N; i++) {
    int v = analogRead(PIN);
    sum += v;
    double d = v - offset;
    sq += d * d;
  }
  offset = sum / (float)N;         // track the DC centre
  float vrms = sqrt(sq / N) * CAL;
  Serial.print(vrms, 1); Serial.println(" V AC");
  delay(500);
}
05

Setup and tuning

Calibrate

set the trimmer so the waveform does not clip (check with Serial Plotter), then change CAL until the reading matches a true-RMS multimeter.

Sample enough

cover whole cycles (20 ms per cycle at 50 Hz).

Isolation

the transformer isolates the output, but the input side and terminals are at mains voltage.

Power factor

combine with a current sensor sampled at the same time to calculate real power.

06

What you need

Shop this list5 of 5 found in our store · ₹804

  • ZMPT101B AC voltage sensor module: the sensor this guide coversZMPT101B AC Voltage Sensor Module₹120
  • ACS712 Hall-effect current sensor module: to add current measurementACS712 Hall-Effect Current Sensor Module₹69
  • ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
  • Digital multimeter: to calibrate againstDigital Multimeter₹177
  • Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
07

Alternatives and when to choose them

  • ✓PZEM energy meters: calibrated voltage, current, power and energy in one module.
  • ✓Voltage sensor modules: for DC voltages.
  • ✓ACS712: AC or DC current.
08

Try it: Ac power factor calculator

Change the values and the diagram and results update as you type.

09

Common mistakes to avoid

  • !Working on the module while mains is connected.
  • !No fuse or enclosure on the mains side.
  • !Feeding the 5 V output straight into an ESP32 pin.
  • !Sampling less than a full cycle and getting unstable RMS.
10

Frequently asked questions

Is the ZMPT101B safe?

The output is isolated, but the input terminals carry mains voltage. Enclose it, fuse it and have mains wiring done by a qualified person.

Can it measure DC voltage?

No. It is a transformer and only works with AC.

How do I calibrate it?

Measure mains with a true-RMS multimeter and adjust the trimmer and code factor until they match.

Does it work with ESP32?

Yes, with the output scaled to 3.3 V, and the ESP32's ADC benefits from averaging.

Can I measure power with it?

Yes, combined with a current sensor sampled at the same time; EmonLib does the maths.

What range can it read?

Up to about 250 V AC on standard modules.

Parts for this guide

  • ZMPT101B AC Voltage Sensor Module
    ₹120View
  • ACS712 Hall-Effect Current Sensor Module
    ₹69View
  • ESP32-WROOM-32 38-Pin Development Board
    ₹389View
  • Digital Multimeter
    ₹177View
  • Dupont Jumper Wires (40 pcs)
    ₹49View
Shop Interface Modules

Calculators

Ac power factor calculatorVoltage divider calculator

Keep learning

Component guideAdvancedPZEM-004T AC Energy Meter Module with ESP32The PZEM-004T is a mains energy meter module that measures AC voltage, current, power, energy, frequency and power factor.3 min read · IoT & WirelessComparisonIntermediateACS712 vs INA219 Current SensorsThe ACS712 is a Hall-effect current sensor that outputs an analog voltage centred at 2.5 V, rising or falling 185, 100 or 66 mV per amp for its 5, 20 and 30 A versions.3 min read · SensorsConcept explainerBeginnerAC vs DCDirect current (DC) flows one way at a steady voltage, like a battery or USB charger.4 min read · Electronics FundamentalsComponent guideIntermediateMains Step-Down Transformers for DC Power SuppliesA step-down transformer converts 230 V AC mains to a lower AC voltage such as 12 V, with the secondary electrically isolated from the mains.3 min read · Power & Batteries

Sources

  • ZMPT101B voltage transformer data sheet (Qingxian Zeming)
  • OpenEnergyMonitor EmonLib documentation

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the ZMPT101B AC voltage sensor isZMPT101B AC voltage sensor pinoutWiring the ZMPT101B AC voltage sensorExample codeSetup and tuningWhat you needAlternatives and when to choose themTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide (Arduino Uno)4 items · ₹570

ZMPT101B AC Voltage Sensor Module · ACS712 Hall-Effect Current Sensor Module · Digital Multimeter · Uno R3 CH340G ATmega328p Compatible Development Board

Run itChange the inputs and watch the output

Adjust CAL in the sketch until the result matches a multimeter, as the slider does here.

Serial monitor115200 baud
229.6 V AC

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question