In this tutorial, we’ll learn how to measure main-line voltage using a low-cost potential transformer. A potential transformer reduces a high-voltage circuit to a lower-level voltage for the purpose of measurement. It’s been used in the energy sector for decades.
These transformers are typically big and bulky, so this do-it-yourself (DIY) project will incorporate one at a reduced size that can be easily interfaced with a microcontroller. The one used in this tutorial is the ZMPT101B. It’s a single phase with input peak-to-peak ratings of 311 and an output peak-to-peak of 2.5, which is a 0-5V range.
Potential transformers (PTs) are inserted in parallel in the main line. Their construction is similar to any other conventional transformer, except that PT’s only transform voltage from high to low (they’re also called a step-down transformer). This allows a voltage to be read by an external system that calculates the main voltage, power, etc.
The system flow is shown here:
A few points to note…
- The sensor requires calibration before use. This can be done in the circuit or by rotating the potentiometer knob. Rotating the knob adjusts the resistance.
- The transformer’s output must be divided using a voltage divider.
- The resistance values can easily be calculated as we know the maximum input and output peak voltages.
- The circuit’s internal calibration requires knowledge of the hardware and software. Using a predefined library for the PT sensor is a great resource to help.
This is the circuit of the Arduino PT sensor:
For simplicity, we’re using the DIY PT library. As such, the calibration function is predefined, so we’re off the hook when it comes to calculating it. Reading and translating the voltage is also simplified by defining it as a single function. Then, a user simply needs to call the function from his or her code.
The project code:
- First, we imported the ZMPT101B potential transformer header file into the code.
- Next, Arduino’s analog pin0 is declared as the input pin for Arduino.
- In the setup function, the serial monitor is started at 9600bps.
- The PT calibration function is called in the setup function.
- In the loop/main function, the voltage is read every one second and printed on the serial monitor.
- To view the main voltage, open the Arduino serial monitor at 9600bps.
Project circuit diagram:
The circuit diagram for this project is simple. The PT sensor module requires 5V to operate properly. We supplied this via Arduino’s 5V output.
Next, all you have to do is connect the PT output pins with Arduino’s analog pin0.
Now, it’s your turn to try this DIY project!
Where to buy the necessary parts?
- Arduino: Mouser
Filed Under: Microcontroller Projects