Welcome to Solarduino , A blog about DIY Solar PV and Arduino projects

DIY Voltage Phase Rotation Meter

Voltage Phase Rotation Meter is a device to detect and determine phase rotation sequence of voltage phases in 3-phase electrical system. Single Phase does not need voltage phase rotation meter as it consists only 1 live and 1 neutral. To differentiate live and neutral, you can use a test pen. When the tip of test pin is in touch with the conductor of wire and if there is light on test pen, it is the live wire. On the contrary, when no light turned on, it is the neutral wire. However, for 3 phase electrical system, there are 3 live wires and a neutral wire. The sequence of the voltage into a 3 phase loads are important to prevent malfunction of the loads and safety risk.

If you have a 3-phase loads such as compressor, motor, or pump, you need a correct phase sequence into the load or it may damage the load or it may just not working at all subject to protection or principle of operation of the load. Correct phase sequence may referring to correct rotation sequence and the first phase is not necessary to be Red phase. It can be Red-Yellow-Blue, Yellow-Blue-Red, Blue-Red-Yellow. 

SM852B Voltage Phase Rotation Tester

This is a commercial 3-phase rotation tester designed to check the phase sequence and show whether is the phase is open or not. You can get it at our affiliate link here !!!

Warning ! You may now dealing with high voltage and high power source ! We assumed that you have the basic electrical knowledge and know what you are dealing with. You may need guidance from experienced guys if you are new to electrical work. Safety and Precaution must be always have in mind. We shall not be responsible for anything happening to you.

Arduino has the ability to measure AC voltage (via module) by analog input pins. For Arduino UNO, there are 6 analog input pins (A0-A5) where you need separate pin for each measurement. If you stacked up a LCD Display Shield, Analog Pin A0 is automatically occupied by the button function. Technically you still have Analog Pin A1 to A5 for AC Voltage pin. In this project, I will use 2 AC voltage module to measure their voltage output and also the comparison of phase angle. Do not reverse the voltage polarity which may damage the pins.

A 3 phase voltage are shifted by 120 degree between phases. The correct sequence will be : phase 2 lagging phase 1 by 120 degree; phase 3 lagging phase 2 by 120 degree; and Phase 3 is leading Phase 1 by 120 degree. By comparing and define the lagging and leading, we can know the proper sequence of the system. However, as stated earlier, each phase can also be taken as phase 1, the location does not matter as long as correct phase rotation.

Arduino UNO (compatible board)

If you still not yet own an Arduino Micro-controller Board, you can get it cheap at our affiliate link here !!!

Measure Voltage using ZMPT101B Voltage Module

This module is equipped with ZMPT101B high-precision voltage transformer and op amp circuit. It can measures AC voltage within 250V. The corresponding output signal can be adjusted using the trimmer potentiometer. It measures the instantaneous voltage value in a waveform of analog values from 0 to 1023. The frequency of the wave is following the Voltage measured. Since the amplitude is adjustable, the voltage analog signal need to be calibrated. In order to calibrate, you need another voltmeter for reference. It can be either multimeter or regular voltmeter that can measure AC Voltage (RMS). The maximum voltage that the module can measured (250Vac) is referring to the Root Mean Square (RMS) value. Technically it can measure the waveform up to the peak at 353.55 Vac peak. 

You can calibrate this module in 2 ways: 1) Determine the peak voltage at serial plotter or serial monitor, convert it to RMS value and compare with other RMS voltage reader such as energy meter or multimeter. 2) upload the code to arduino board, adjust the trimpot by comparing the display RMS value in Serial monitor or LCD Display with other RMS voltage reader such as energy meter or multimeter.

The AC Voltage Module analog measurement is similar to Current Module. The voltage value will fluctuate up and down within 0 to 5V (0 to 1023 value). When no voltage detected, it will send analog signal at half the supply voltage (example 2.5V) which is about value 512. Different module will have different deviation error. Some might be reading exactly 512 when no measurement voltage detected but some may be slightly more or slightly less than value 512. You will have to manually key in the offset value during the first start or during no voltage detected. 

Single Phase AC Voltage Module

This module is equipped with ZMPT101B high-precision voltage transformer and op amp circuit. It can measures AC voltage within 250V. The corresponding output signal can be adjusted using the trimmer potentiometer. You can grab this module at our affiliate link here !!!

UNI-T Multimeter is a good quality with decent price. We have been using UNI-T multimeter for years has not been any issue. We were using UT33C model. It can measure RMS Voltage. You can get yours at our affiliate link here !!!

Peacefair PZEM-021 Energy meter is an compact AC energy meter that measures (RMS) Voltage, Current, Power and Energy. Peacefair has a lot of model to measure different current requirement from 20A up to 100A. You can get it at our affiliate link here !!!   

Calibration for ZMPT101B voltage module

Once the code is uploaded to the Arduino, if you got LCD display shield attached, you will see the RMS voltage value. For initial calibration, Make sure to turn OFF the AC voltage source that you are measuring. Press the SELECT button of the LCD Display Shield and wait for 5 seconds. It should go to 0 volt. For people out there that do not have the LCD Display Shield, you can manually offset by entering the offset value in the code and re-upload again. There are 2 offset values (voltageOffset1 & voltageOffset2) need to calibrate. 

Trimpot Potentiometer AC Voltage Adjustment 

This setting is to adjust the magnitude of AC voltage wave. Unlike AC current, we calculate and get the expected current but for AC voltage, we need a reference voltage for adjustment.

Once the previous calibration is done, you should see the value 0 volt when no voltage is detected. Now, turn on the Voltage source and turn on the reference voltage reader (the multimeter or the energy meter). Compare both of the voltage value. Turn the trimmer potentiometer (trimpot) using a small screwdriver to reduce or increase the voltage value detected by the module. You need to turn the trimpot until the voltage shown in the LCD display Shield or Serial Monitor is the same as the voltage reference value in the volt or energy meter. And Congratulations, it’s Done !!!!

If you really read through the codes, we actually has reduced the potential wave amplitude by half (in formula is times 2). 

RMSVoltageMean = (sqrt(voltageMean))*2;

This is why when monitoring voltage is applied, the value measured is high and you need to reduce it. Full wave amplitude (x 1) get distorted when near to 250V which made us having this choice to overcome the distortion problem.

How the signal being processed

Root-Mean Square (RMS) voltage value is the square rooted averaged value that is derived from summation of squared of each raw values. 

 

We need 2-time calibration for each module sensorBoth calibration need to be done during no voltage measured. The first calibration is making sure when no voltage measured, it shows exactly at 0 point. It is an analog value calibration. Some modules might not showing exactly at analog value 512 when no value is detected (I have shifted it to 0 point using Arduino code for easy understanding). We need to add an offset value for this to adjust it back to origin when no value detected.

The second calibration is to further eliminate false signal value AFTER RMS calculation. Even after the first calibration is made, there are still some minor ghost or electrical noise even when no voltage are measured. We have to add another offset to make it to zero value at the final stage for display. This second calibration must be done only after the first calibration take into effect. Both calibrations can be done manually (the harder way) or automatically by pressing the SELECT Button in the LCD Display Shield and wait for about 5 seconds. Of cause you need to have the shield in order to work. You may purchase at our affiliate link here !!!

I recommend you to add a 16X2 LCD Display Shield which can be directly fit on to the top of the Arduino board without the need of extra wiring for the LCD Display. Without the LCD Display, you can only monitor the measured current value on PC via Serial Monitor. You can get the LCD Display board at our affiliate link here !!!. 

The good news is you do not need to manually calibrate the offset settings if you got the LCD Display Shield with you. Below we have attached the code that utilizes the button function that could automatically calibrate by itself when you pressed the SELECT Button. You may download from the end of this page below.  

Datalogger Shield

If you plan to record the data in a proper way, you may consider this Datalogger Shield. It allows your arduino to record your data in SD Card. Datalogger shield is often installed together with LCD Display shield. Please find it at our affiliate link here !!! For more about this Datalogger Shield, kindly visit our post here.

Hardware Connection

Once you get your 2 voltage sensor modules and Arduino Board ready, you may start to do hardware wiring. Below is the schematic of the whole wiring. You may also need some tools and accessories. Be sure your connection cable is tight and module shall be installed in such a way no movement at all. 

You can stack up screw shield, LCD Display Shield or even datalogger shield on top of Arduino UNO. No additional wiring is required as the shields are meant for adding function without need of extra wiring. If more modules or shields are stacked, if voltage dropped is obvious, you may consider using independent 5V power supply and not from the arduino board.

 

In order to connect wiring between Arduino board and module, you need the dupont line cables male to female. You can get it at our affiliate link here !!!

You may need the connector that can secure cables and isolate from accidental touch. Get the fast connector at our affiliate link here !!!

You need a fuse to protect your safety and cables!! You can get it here !!

Screw Shield / Expansion Shield

When there are a lot of wiring around especially more than 1 sensor, sharing pins will be difficult as existing pins (ground and 5V) are limited. This shield provides a lot of convenient terminals for each of the input and output pins. The shield can be mounted directly on top of the Arduino Uno board or in between the shields which made it very convenient to use. You can get it at our affiliate link here !!!

Software Codes

The final step would be adding source code onto Arduino board. I assume you have installed the Arduino Software. If you have not installed the software, the link here can bring you to the official download site. Once you have downloaded the software, you may download the code file (.ino) for this application below (right click save link). 

There are 2 source codes file attached which are source code with and without LCD display shield function. If you don’t have LCD Display shield with you, kindly choose the code that is without LCD Display Shield but you have to manually calibrate and key in the 2 offset values for both sensors. However, I still highly recommend that you get a LCD Display Shield.

With LCD Display Shield, once the code is uploaded to the Arduino board, the current value will be shown on the LCD Display. We have added the auto calibrate function, once the SELECT button is pressed, the value returns to exact zero point. You may have to wait about 5 to 8 seconds long until all values are re-calibrated. If first press is not satisfied, you may repeat by pressing it again.

I will not display the code here because it is long. You can download the .ino file to see for your own. Almost all code lines are with explanation. 

Code Concept

At first, the voltage oscillation from first module is taken as voltage reference. The second voltage wave is compared to the voltage reference. If there is no angle difference (example at 0 degree), both voltage references are taking at same phase. If the 2nd voltage is lags by about 120 degree (with allowance +/-20 degree), the second voltage is the correct second sequence of phase rotation which shall put this as second phase if the reference phase is taken as first phase. 

If the 2nd voltage is leads by about 120 degree, the second voltage is actually the 3rd phase if the reference voltage is taken as first phase.  Repeat the other set of the same procedure and you will get the rotation of the 3 phases. 

Before we end, we would like to give gratitude to you for taking the time to read the post. We would need readers like you to support us in order to keep growing. You can support us in the following ways :

Donate & Fund Raising

If you like my work, please send me a donation to encourage me to do more. Thanks

Aliexpress Affiliate

We are the member of Aliexpress affiliate marketing. Do support us by clicking the affiliate product links if you do wish to purchase them.

Like and Share

If you like our post, we need your support to like and share our posts or videos so that it can reach more and more people like you !!

Result – In Serial Monitor

Result – In LCD Display

For Arduino Code Files, Remember to Right Click > Save Link As … You may alter the internal code as you wish. Happy coding !! 

Voltage Phase Rotation Meter.ino
Voltage Phase Rotation Meter with LCD Display.ino