Hackster is hosting Impact Spotlights highlighting smart energy storage. Start streaming on Thursday!Stream Impact Spotlights on Thursday!

Hesam Moshiri's STM32-Powered AC Measurement Tool Tracks Voltage, Load, and More

Featuring a handy calibration interface and a clear OLED display, this project aims to make power measurement easy.

Gareth Halfacree
1 year agoHW101

Maker Hesam Moshiri has designed a circuit for measuring a range of metrics on alternating current (AC) supplies — including power factor, real power, voltage, and current, all using an STMicroelectronics STM32 microcontroller.

"I introduce a circuit that can measure AC RMS [Root-Mean-Square] voltage, RMS current, active power, power factor, and energy consumption (kWh) of the loads," Moshiri explains of his creation. "I used a low-cost STM32 microcontroller and provided four push buttons for initial calibration. The device can independently measure the parameters and display the results on a bright 1.3-inch OLED display. The measurement error rate is around 0.5 per cent or lower."

This handy power meter is driven by a low-cost STMicro STM32 microcontroller. (📹: Hesam Moshiri)

The heart of Moshiri's measurement tool is an STMicro STM32G030F6 microcontroller, providing a single Arm Cortex-M0+ core running at 64MHz with 32kB of flash, 8kB of RAM, and an analog-to-digital converter (ADC). This is housed on custom two-layer circuit board, put together in Altium Designer, with screw terminals for the AC input at one side and the load at the other — providing the ability to measure power usage of active devices, as well as the voltage of the incoming AC supply itself.

"To calibrate the board," Moshiri notes, "you need to have an accurate true RMS multimeter. I have measured the current consumption of this load separately […] and it was around four amps; however, here it says 17 amps," Moshiri notes in a demo of the board, using the four buttons to adjust the reading to match the earlier test.

A video demonstration of the circuit is reproduced above, while full details including Gerbers are available on PCBWay; Moshiri notes that "some parts of this circuit carry dangerous mains voltage," and that beginners should "seek guidance from experienced users" before attempting to build their own.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles