# ZMPT101B Voltage measurement

Joined Jun 5, 2009
134
Hello,

Has anyone ever used one of these ZMPT101B current transformers for measuring AC voltage with a microcontroller?
I’m struggling to get any linearity with it at all and I can’t understand why.
Here is what I’m doing:

I’m using a Variac which can produce voltages from 1vac – 330vac
If I supply the module with a steady 5.00vdc, the output pin reads 2.500v.
The output voltage doesn’t start decreasing until about 90vac input.
At 330vac I get 2.350 volts on the output of the module.

330vac – 90vac = 240vac. 240vac is the range it can measure.

2.500vdc-2.350vdc = 0.15vdc. This represents the output voltage of the module measuring voltages from 90vac to 330vac.
0.15 / 240 = 0.000625 Per Volt.

So, if I wanted to measure 200vac, my voltage output on the module should be 200*0.000625 = 0.125. 2.500-0.125 = 2.375vdc.
If I put the above into practise, at 200vac my output voltage is way off. Even if I adjust the numbers and try and measure different voltage ranges, I can’t seem to get any linearity at all.

I know I'm doing something wrong.

Is my approach all wrong? How would you go about implementing this sensor differently?

Any help is hugely appreciated.

#### tsan

Joined Sep 6, 2014
116
It seems to be, that you are mixing DC and AC. It is a transformer and input is AC and the output is also AC, at least on the typical modules sold on Ebay.

Joined Jun 5, 2009
134
It seems to be, that you are mixing DC and AC. It is a transformer and input is AC and the output is also AC, at least on the typical modules sold on Ebay.
Yes. This is exactly my problem!

Thank you.

#### tsan

Joined Sep 6, 2014
116
Output voltage is level shifted to half VCC. With 5V VCC, output is 2.5 VDC when there is no input voltage. Voltage swings around 2.5V according to input AC signal. 2.5 VDC offset can be removed in microcontroller code to have an AC signal only. Then the signal can be scaled. Here is an example that I posted earlier on another thread,

ZMPT101b + Arduino UNO example

#### KeithWalker

Joined Jul 10, 2017
1,919
ZMPT101B is the part number of a current transformer but it is also used by retailers as the number for a current sensor module that incorporates that transformer. That is what you have. The output of the module is a 1- 5 VAC peak to peak signal offset by +2.5VDC. If you just take a single reading from the analog input pin it will be 2.5V with no AC input to the module but could be anything fro 0 to 5V instantaneously with an input. You need to sample the input at more than 120 times a second to measure the signal. Here is a tutorial with an example on how to do it:
https://surtrtech.com/2019/01/21/easy-measure-of-ac-voltage-using-arduino-and-zmpt101b/
Regards,
Keith.