D

DIY Electronics

— Building circuits, programming microcontrollers, and making things blink
49 members Created Jun 2026

Building a simple AM radio receiver from scratch

Building a USB Power Meter with INA3221

The INA3221 measures voltage and current on three channels simultaneously over I2C, which makes it ideal for a multi-rail power meter. I used it to build a USB-C power delivery analyzer.

The device sits inline on two USB-C conductors, measuring VBUS current and voltage plus the CC wire voltages to decode PD negotiation. An STM32F103 (Blue Pill) reads the INA3221 and drives a small OLED display showing real-time power on each rail. A circular buffer in SRAM stores the last 60 seconds of readings for peak detection.

Calibration: the INA3221 shunt resistors need to be matched — I used 0.02 ohm 1% resistors for good accuracy without excessive voltage drop at high current. At 5A USB-C output, the shunt drops only 100mV, acceptable for PD operation. The measured values match my bench meter within 1%.

0

Report thread

Why are you reporting this thread?

Restore the redacted content?

This will make it visible to everyone again. The clear action is logged in the mod log.