ZMPT101B AC Voltage Sensor Module Primer

This post is in response to a reader who asked about detecting mains electricity using a microcontroller. The easiest and safest way to detect mains electricity using a microcontroller is with an optocoupler as it allows us to send data between two galvanically isolated circuits.

Pull up this previous post for more information. (https://www.electroschematics.com/detector-module/).

Now I want to take a slightly different approach for detecting (and measuring) mains electricity. It uses a dedicated single-phase AC voltage sensor module ZMPT101B.

ZMPT101B Transformer & ZMPT101B Module

The ZMPT101B module is a compact single-phase AC voltage sensor module based on the minuscule 2mA/2mA precision voltage transformer ZMPT101B made by Qingxian Zeming Langxi Electronic (www.micro-transformer.com).

Considering the ZMPT101B transformer alone, the setup is simple as it only needs a limit resistor on the primary side and a sampling resistor on the secondary side (see below).

The below table gives an overview of the little transformer (re-created from its datasheet).

The primary and secondary coils of this transformer have a DC resistance close to 110Ω at 20°C.

Coming back to the ZMPT101B module, it can handle AC voltages up to 250V (50Hz/60Hz). Its secondary circuitry, centered on the LM358 dual op-amp chip, also allows tweaking the isolated analog output via an onboard multiturn trimpot. The recommended operating voltage of the module is 5VDC.

The following is believed to be the correct schematic of the module in my hand (HW-697). I took it from the web and touched it up for better clarity!

As a side note, you may find photographs of identical modules with OP07C (https://www.ti.com/lit/ds/symlink/op07c.pdf) op-amp chip somewhere on the web. Originally the PCB layout of the module was for the LM358 chip, so those odd modules (with the wrong part) will not work as claimed (I don’t know the real facts behind this serious flaw).

ZMPT101B Module & Quick Test AC230V

So, the next step is the quick test of the ac voltage sensor module. For the test I’m using AC230V/50Hz domestic power through the simplistic setup shown below.

Warning! You’re now going to deal with a fatal high voltage source. It’s assumed that you have electrical knowledge and know what you are dealing with!

See I got a sensible analog output. Yup, it worked!

As you can see, the output displayed at that time was around 1.1Vpp with 225VAC (50Hz) input. Note at this point that the analog output has an offset (Vcc/2). That is, if nothing is wired to the input and the supply voltage of the module is 5VDC, the idle output of the module will be around 2.5VDC.

Oh, I forgot to mention, I used my trusty digital AC volt and current meter (AC230V/100A) module for the AC input voltage measurements.

ZMPT101B Module & Initial Output Signal Tweaks

In principle, the analog output signal of the module fluctuates up and down within predefined limits (when no ac input voltage is detected, it will deliver an output at half the supply voltage). Pay attention to ensure that the module’s output is a complete sinewave. If the waveform is clipped, you must refine the output to head off potential measurement errors (naturally each module has its own deviations, so the onboard amplitude adjust trimpot will be a helpful inclusion). You need to keep an eye on the output waveform before first use.

ZMPT101B Module & Arduino Uno Serial Plotter

Arduino Uno can measure voltages through its analog inputs. An analog input pin, by default, will map analog input voltages between 0V and 5V into integer values ​​between 0 and 1023 with a resolution of 4.9mV per unit (5.00V/1023 units).

To “see” the output of your ZMPT101B module, just follow the wiring scheme shown above, and upload below code to your Arduino Uno.

[code]

void

setup() {

Serial.begin(9600);

}

void

loop()

{


Serial.println(analogRead(A0));

delay(100);

}

[/code]

And then open the Serial Plotter window from the Tools menu. If you apply grid power to your module’s input, you will see something like this on the Serial Plotter.

ZMPT101B & Arduino AC Voltmeter Blueprints

I don’t see people playing with ZMPT101B much on the internet. Luckily, I got better results thru the “serial monitor” code adapted from here https://solarduino.com/how-to-measure-ac-voltage-with-arduino/ (my code is just something quick and dirty to check that it worked).

What’s Next?

Now it’s your turn! However, your microcontroller, sensor module, operating voltage and high-voltage input might be different. So, you will need to refine your code to get accurate results. Once you have your entire setup finetuned, simply leave it to do its job.

Note that this writeup is only a primer. I’ll continue working on this concept and share my thoughts when I’ll make a notable progress. Finally, I’d be interested to see if anyone’s done something new with this sensor module already. Expertise is for Everyone!

Leave a Comment