Discover the capabilities of the ZMPT101B voltage sensor and learn how to interface it with Arduino for precise AC voltage measurement. This voltage transformer module allows you to measure AC voltages up to 250 volts with analog output. As the input voltage changes, the output voltage of the sensor adjusts accordingly.
What is ZMPT101B Voltage Sensor?
You can download the ZMPT101B voltage sensor datasheet here.
ZMPT101B Voltage Module Pinout
The ZMPT101B module has 4 pins:
- VCC: Module power supply: 5 V
- GND: Ground
- OUT: Module output which is analog.
You can see Pinout of ZMPT101B Voltage Module in the following image:
Interfacing ZMPT101B Voltage Sensor with Arduino: Step-by-Step Guide
Step 1: Circuit
Connect the module to the Arduino according to the following image.
Step 2: Code 1
Upload the following code to your Arduino and then open the Serial plotter window from the Tools menu. If nothing is connected to the module inputs (module input is 0 volts), your diagram will show a number around 512 (i.e. 2.5 volts).
If you apply 220V AC to the input, you will see a voltage sinusoidal diagram on the Serial plotter.
/* ZMPT101B - AC Voltage sensor Show AC wava in serial plotter modified on 7 Sep 2020 by Mohammad Reza Akbari @ Electropeak
Make sure the sine wave is complete in the serial plotter, specifically the minimum and maximum parts of the chart. If your voltage pattern is not complete, you have to turn the potentiometer on the module to display the full waveform.
If the waveform is cut from the top or bottom, you will see an error in your measurement in the next step.
Step 3: Code 2
This module measures the peak-to-peak voltage. In this code, first it finds the maximum measured value (peak voltage) and then converts it to RMS value. You can see the result in the Serial Monitor.
/* ZMPT101B - AC Voltage sensor Calculate Voltage modified on 7 Sep 2020 by Mohammad Reza Akbari @ Electropeak
You can see the results for measuring city electricity voltage in the figure below.
In conclusion, by following the step-by-step guide and interfacing the ZMPT101B voltage sensor with Arduino, you can effortlessly achieve precise and reliable AC voltage measurement. This versatile module, with its analog output and wide measurement range of up to 250 volts, provides valuable insights into voltage patterns. Whether you’re monitoring city electricity voltage or working on other AC voltage measurement projects, the ZMPT101B voltage sensor, combined with Arduino, offers an accessible and accurate solution. Unlock the potential of your projects with this powerful combination of technology.
Remember to implement proper safety precautions when dealing with high input voltages. For more detailed instructions, additional resources, and information on other Arduino-related topics, visit Electropeak website.