Arduino Projects

ZMPT101B 80-250V AC Voltage Sensor with Arduino, Voltage Monitoring

ZMPT101B AC voltage Sensor:


ZMPT101B 80-250V AC Voltage Sensor with Arduino, Voltage Monitoring- In today’s article, you will learn how to measure Mains AC voltage using the ZMPT101B 250 volts AC voltage sensor, Arduino Nano or Arduino Uno, and an SSD1306 Oled display module.

Since this is my first article and video on the ZMPT101B AC voltage sensor module so I will try my level best to explain each and every detail including.

  1. The ZMPT101B mains voltage sensor technical specifications.
  2. Pins description.
  3. Circuit diagram.
  4. How to install all the required libraries.
  5. Arduino programming.
  6. The ZMPT101B AC voltage sensor calibration. And
  7. Practical demonstration.

So, without any further delay let’s get started!!!

Amazon Links:

Arduino Nano USB-C Type (Recommended)

ZMPT101B AC voltage sensor

SSD1306 Oled display Module

5V Buzzer

Other Tools and Components:

ESP32 WiFi + Bluetooth Module (Recommended)

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

ZMPT101B 250V AC Mains Voltage Sensor:

An image showing the ZMPT101B AC voltage sensor connected to an Arduino board.

The ZMPT101B is a voltage sensor module commonly used for measuring alternating current (AC) mains voltage. It is designed to work with a voltage range of 80 to 250 volts AC. The module includes a voltage divider circuit and an internal operational amplifier to provide an analog output proportional to the measured voltage.

The ZMPT101B can be used in various applications, such as power monitoring, smart home automation, energy management systems, and industrial control systems. It is commonly utilized in projects where measuring the AC mains voltage is required for monitoring or control purposes.

It is important to note that when working with mains voltage, proper safety precautions should always be taken, and it is advisable to consult relevant electrical codes and standards. Additionally, if you plan to use the ZMPT101B module, it is recommended to refer to the manufacturer’s datasheet and documentation for detailed specifications, wiring diagrams, and usage guidelines specific to the module.

ZMPT101B datasheet.

ZMPT101B Technical specifications:

  1. This is a compact single-phase AC Voltage Sensor module based on the micro-precision voltage transformer ZMPT101B.
  2. Turns Ratio: 1000:1000
  3. The Rated Input and Output current is 2mA.
  4. Voltage range is between 80 and 250V AC.
  5. The high precision on-board Op-Amp circuit is based on the LM358 Operational amplifier IC.
  6. Operating Temperature: -400 C to ±600
  7. The supply voltage is 5 volts to 30 volts DC.
  8. With the help of on-board potentiometer the output voltage can be adjusted. In simple words it is used for calibration. I will practically demonstrate this in a minute.

ZMPT101B Pinout description:

An image displaying the pinout and technical specifications of the ZMPT101B AC voltage sensor.

We have a terminal block on one side and 4 male headers on the receiver side. Connect the Mains AC voltage Live and Neutral wires to the L and N contacts on the ZMPT101B AC voltage sensor using the terminal block.

The 4 male headers are clearly labeled as VCC, OUT, GND, GND.

ZMPT101B voltage Sensor with Arduino:

An image featuring the ZMPT101B AC voltage sensor connected to an Arduino board for voltage measurement

I am using my newly designed Arduino Nano and LoRa based development board. But you can also do the same exact connections on a breadboard. And instead of using Arduino Nano you can also use Arduino Uno.

Anyway, The VCC and GND pins of the ZMPT101B voltage sensor are connected to the Arduino 5V and GND pins. Whereas the voltage sensor OUT pin is connected to the Arduino Analog pin A0.

The SSD1306 Oled display module VCC and GND pins are connected to the Arduino 3.3V and GND pins. Whereas the SCL and SDA pins are connected to the Arduino analog pins A5 and A4. A5 is the SCL and A4 is the SDA.

The 5V buzzer is connected to the Arduino Digital pin D4. If your only goal is to measure the AC mains voltage then there is no need to use the buzzer. But if you want to monitor the Over-voltage and Under-voltage then you can use this buzzer. You will only need to define the over-voltage and under-voltage limits in the programming.

You can read my previous article, if you want to make the same development board. Or you can follow this circuit diagram if you want to manually wire up all the electronics.

ZMPT101B with Arduino, Circuit:

A circuit diagram illustrating the interfacing of a ZMPT101B AC voltage sensor with an Arduino board.

  • Connect the VCC pin of the ZMPT voltage sensor with 5V of the Arduino Nano.
  • Connect the Vout pin of the ZMPT voltage sensor with A0 pin of the Arduino Nano.
  • Connect the Ground pin of the ZMPT voltage sensor with Ground of the Arduino Nano.
  • Connect the VCC of the OLED with 3.3V of the Arduino Nano.
  • Connect the ground of the OLED with Ground of the Arduino Nano.
  • Connect the SDA pin of the OLED with A4 pin of the Arduino Nano.
  • Connect the SCL pin of the OLED with A5 pin of the Arduino Nano.
  • Connect the buzzer with D4 pin of the Arduino Nano.

Now, let’s go ahead and take a look at the programming.

Altium Designer + Altium 365 + Octopart:

Arduino LoRa Free SMS

Altium 365 lets you hold the fastest design reviews ever. Share your designs from anywhere and with anyone with a single click. it’s easy, leave a comment tagging your teammate and they’ll instantly receive an email with a link to the design. Anyone you invite can open the design using a web browser. Using the browser interface, you’re able to comment, markup, cross probe, inspect, and more. Comments are attached directly to the project, making them viewable within Altium designer as well as through the browser interface. Design, share, and manufacture, all in the same space with nothing extra to install or configure. Connect to the platform directly from Altium Designer without changing how you already design electronics. Altium 365 requires no additional licenses and comes included with your subscription plan.

Get real-time component insights as you design with Octopart built into Altium 365. Octopart is the fastest search engine for electronic parts and gives you the most up-to-date part data like specs, datasheets, cad models, and how much the part costs at different amounts etc. Right in the design environment so you can focus on your designs. Start with Altium Designer and Activate Altium 365. Search for electronic parts on Octopart.

Download the Required Libraries:



You will also need to download the ZMPT101B library. Go to the Sketch menu > then to Include Library > and click on the Manage Libraries. Search for the ZMPT101B library and install it.

An image featuring the ZMPT101B Arduino library.

ZMPT101B Arduino Programming:

Code Explanation:

We simply define the sensitivity.

Then we define the pin and the frequency. In my case, I am using Analog pin A0 and the mains frequency on my side is 50Hz. If on your side the frequency is 60Hz then use 60Hz.

All these other instructions are for the SSD1306 Oled display module.

Inside the void setup() function, I have activated the serial communication. I set the buzzer as output. Next, I set the voltage sensor sensitivity and I activated the Oled display module.

Inside the loop() function only this instruction does all the things. We simply read the voltage and then print it on the Oled display module.

Next, connect your Arduino board to the laptop and upload the program.

ZMPT101B Practical Demonstration:

I am going to use a 12V adaptor to power up my Arduino Development board. Next, I am going to supply AC voltage to the ZMPT101B.

An image depicting the setup of a ZMPT101B AC voltage sensor connected to an Arduino for measuring mains AC voltage.

You can see the measured AC voltage on the Oled display module. I don’t know if this value is correct so I am going to use my digital multimeter to measure the actual mains AC voltage.

As you can see the actual voltage is 189 volts AC while the measure voltage fluctuate around 190 volts. This value is pretty close and for me it’s acceptable. If on your side the voltage difference is more than you can use this potentiometer to fine tune the value. While calibrating the sensor make sure you don’t touch ac voltage wires or the contacts on the bottom side of the PCB. As it can be really dangerous.


I fine tuned my ZMPT101B voltage sensor and now the measured value is pretty close to the actual voltage. Its ok if you see small fluctuations.

Now, we can define limits in the programming. Let’s say when the voltage drops below 100 volts, the Arduino can automatically turn off the AC, TV, or any other sensitivity loads. And the same thing you can do for the over-voltage. On my designed Arduino development board, I have also used LoRa Ra-02 transceiver module which can wirelessly send data over a long distance around 5 kilometers. So, using the LoRa module I can monitor a power station or I can use it to check if the AC Voltage is available or not. In my upcoming video, I will use it for making a power monitoring system. So, that’s all for you now.

Watch Video Tutorial:

Related Articles

One Comment

  1. i love this project . i am working on using ZMPT101B in project with MCU ESP32 . i need to know if this Arduino code can work with the ac voltage sensing in ESP chip ?

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button