A power factor meter measures the phase relationship between voltage and current in AC circuits, revealing how efficiently your loads use electricity. In Indian homes with ceiling fans, tube lights, and appliances, poor power factor wastes energy and increases electricity bills. This guide shows you how to build an Arduino-based power factor meter using the ZMPT101B voltage sensor and ACS712 current sensor.
What Is Power Factor?
Power factor (PF) is the ratio of real power (watts) to apparent power (VA):
PF = Real Power (W) / Apparent Power (VA) = cos(phi)
where phi = phase angle between voltage and current
PF = 1.0: Perfect (resistive load -- heater, incandescent bulb)
PF = 0.5-0.7: Poor (old fluorescent tube lights, small motors)
PF = 0.8-0.95: Acceptable (modern appliances, LED drivers)
PF = 0.95-1.0: Excellent (PFC-equipped power supplies)
Example: Indian ceiling fan
Apparent power: 230V x 0.3A = 69VA
Real power (watt meter): 55W
PF = 55/69 = 0.80 (lagging, inductive)
Measuring Power Factor with Arduino
The method: measure the zero-crossing times of both voltage and current waveforms. The time difference gives the phase angle, from which PF is calculated:
Phase angle = (time_difference / period) x 360 degrees
PF = cos(phase_angle)
At 50Hz: period = 20ms
If current zero-crossing is 2ms after voltage:
Phase = (2/20) x 360 = 36 degrees
PF = cos(36) = 0.81
Circuit Design: ZMPT101B + ACS712
SAFETY WARNING: This circuit connects to 230V AC mains. Use extreme caution. The ZMPT101B provides galvanic isolation between mains and Arduino. Never touch exposed connections while powered.
Connections:
ZMPT101B: AC input → 230V mains (through load)
Signal output → Arduino A0
VCC → 5V, GND → GND
ACS712 (30A): Load wire through sensor hole
Signal output → Arduino A1
VCC → 5V, GND → GND
OLED: SDA → A4, SCL → A5
Both sensors output a centred sine wave around 2.5V (at no load).
Zero crossing detection: when signal crosses 2.5V (512 on 10-bit ADC)
Arduino Code for PF Measurement
#define V_PIN A0 // ZMPT101B
#define I_PIN A1 // ACS712
volatile unsigned long vZeroTime = 0;
volatile unsigned long iZeroTime = 0;
void setup() {
Serial.begin(9600);
// Set up Timer1 for precise timing
}
void loop() {
// Detect voltage zero crossing (rising edge)
int vPrev = analogRead(V_PIN);
while(true) {
int vNow = analogRead(V_PIN);
if (vPrev = 512) {
vZeroTime = micros();
break;
}
vPrev = vNow;
}
// Detect current zero crossing (rising edge)
int iPrev = analogRead(I_PIN);
while(true) {
int iNow = analogRead(I_PIN);
if (iPrev = 512) {
iZeroTime = micros();
break;
}
iPrev = iNow;
}
// Calculate phase difference
long phaseDiff_us = iZeroTime - vZeroTime;
float period_us = 20000.0; // 50Hz
float phaseAngle = (phaseDiff_us / period_us) * 360.0;
float pf = cos(phaseAngle * PI / 180.0);
Serial.print("Phase: "); Serial.print(phaseAngle, 1);
Serial.print("deg PF: "); Serial.println(abs(pf), 3);
delay(500);
}
Displaying Results on OLED
Add an OLED display to show voltage, current, power, and power factor in real time. Use the Adafruit SSD1306 library and format the display with large font for PF reading and smaller font for V/A/W values.
FAQ
Do Indian electricity boards charge for poor power factor?
For residential consumers: no, Indian discoms charge only for real power (kWh). For commercial and industrial consumers: yes, a power factor penalty applies below 0.85 or 0.90 (varies by state). However, poor PF at home still means higher current draw, more cable heating, and wasted capacity on your MCB/wiring.
How can I improve power factor at home?
Add a capacitor across inductive loads (fan, motor). Typical ceiling fan PF correction: 2.5-4uF 440V capacitor in parallel. This is why modern fans come with a capacitor built in. LED bulbs and modern appliances have internal PFC.
Add comment