Professional Documents
Culture Documents
Power Factor Measurment Using Arduino
Power Factor Measurment Using Arduino
To measuring the power factor with microcontrollers in the first we used Op-Amp to zero
cross detection to find the phase shift between current and voltage phase, the op-amp convert
the sine wave signal comes from CT and PT with different amplitude to square wave with
about 4v amplitude, then we connect these two square wave to XOR gate inputs.
XOR gate output will be 1 just when the inputs have different signals so when the load is
resistive XOR gate output is 0 because both voltage and current phases start and ends in the
same time, but when the load is inductive or capacitive XOR output is 1 because there are
phase shaft between voltage and current,
Hence we can find the power factor by measuring the "ON-time" of XOR output, and put it
in the power factor formula :
PF= COS(f*dt*360)
Where:
PF=Power Factor
f= Frequency
dt=Time difference between two phases and/or XOR output ON-time
Circuit:
Here we have two circuits, the first one using Current transformer(CT) and Voltage or
potential transformer(PT), the only difference between them is that second circuit with no
transformer and no insulation between microcontroller and main voltage so its dangerous if
you touch any point in the circuit, but its cheap, small size, light weight and similar to
commercial socket power meter.
Filtering capacitors in this circuit is important to removing power supply noise( voltage
ripple) to insure logic gate works well.
Arduino LCD wiring:
Results:
3-For current transformer you can use an Clamp-on transformer, I opened my old cheap
clamp meter and used its transformer and works well.
You can improve this project to power factor correction by adding some relay and capacitor
and improving the code.
Parts list:
Arduino board https://goo.gl/XR3mXG
IC 4030 or IC 4070 (XOR gate)
Voltage Transformer 15V or less
Current transformer 5A/5mA
Resistor kit https://goo.gl/p4JvQY
Resistor 100K
Resistor 220 ohm
Resistor 200 ohm
Potentiometer 10K or 100K (Potentiometer Kit https://goo.gl/z5b4X1)
Ceramic Capacitor kit https://goo.gl/q29Du3
Capacitor 47pF (2pcs)
Capacitor 100nF
Capacitor470uF (Capacitor Kit https://goo.gl/6zqbJy)
LCD display 16x2 https://goo.gl/yTjFJS
Diode 1N4148 (4pcs) (Diode kit: https://goo.gl/zA6r7x)
LM324
Connecting wires https://goo.gl/BVC3pM
Breadboard https://goo.gl/rGuHzY
Energy meter: https://goo.gl/DztkwW
CODE:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int pin = 13;
float rads = 57.29577951; // 1 radian = approx 57 deg.
float degree = 360;
float frequency = 50;
float nano = 1 * pow (10,-6); // Multiplication factor to convert nano seconds into seconds
float pf;
float angle;
float pf_max = 0;
float angle_max = 0;
int ctr;
void setup()
{
pinMode(pin, INPUT);
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop()
{
//delay(500);
angle = 0; // Reset variables for next test
angle_max = 0;
}