Skip to content
← Projects

AC/DC Power Meter

Measures AC and DC loads, and works out the full power triangle in firmware for AC.

AC/DC Power Meter
FIG. 1 — Hand-wired perfboard, sensing and conditioning on one board

The problem

Real power on an AC load is not a voltmeter multiplied by an ammeter. Once the load is reactive, real and apparent power stop matching, and two multimeters cannot show you that. I wanted one instrument that measured both AC and DC and worked the rest out itself.

What I built

An AVR-based meter for 50 Hz AC and for DC, built for current up to ±30 A, DC voltage up to about 34 V, and AC voltage up to about 75 V RMS.

Current is measured with an ACS712 hall-effect sensor, chosen because the same part works for AC and for DC. Voltage takes two paths: a resistive divider for DC, and an op-amp front end for AC that shifts and scales the waveform so it fits the range the microcontroller can read. There is no AC or DC switch, so the right path is connected by hand.

What it works out

Voltage and current are sampled together, many times per cycle, so the timing between the two waveforms is kept — that timing is what the power factor depends on. From those samples the firmware works out RMS voltage and current, real power, apparent power, reactive power and power factor: the whole power triangle for an AC load.

What it does not do

Three things, all of them in the firmware rather than the hardware.

No DC power reading. The calculation is written for AC, and the step that makes it work for AC cancels the signal on a DC load. A DC level shows up only as a raw number.

Small currents read as zero. Measurements are rounded to whole volts and amps before the calculation runs, so with the 30 A sensor a load drawing less than about 0.7 A reads as nothing.

The inductive or capacitive indication is unreliable. It is a rough comparison of which waveform crosses its midpoint first, and it can give the answer the wrong way round.

What I’d change

Three things. First, a faster controller. At 50 Hz the Arduino Uno could not take enough samples per cycle to resolve the timing between the voltage and current waveforms, and that is the main reason the inductive or capacitive indication cannot be trusted. A faster part would fix that and leave headroom for the maths. Second, keep each measurement as a decimal instead of rounding it to a whole number, so small currents stop reading as zero. Third, finish the DC side, so a DC load gets a real power reading instead of a raw number.

Sensing module
FIG. 2 — Sensing module
ACS712 hall-effect sensor, hand-soldered
FIG. 3 — ACS712 hall-effect sensor, hand-soldered
Captured waveform during testing
FIG. 4 — Captured waveform during testing
Controller and divider network
FIG. 5 — Controller and divider network