Anyone who runs a bench full of development boards knows two pains: you never know how much power each board really draws, and a hung board needs someone to pull the cable. Pierre Dubouilh of Kernwerk designed one small board that solves both. It is an inline USB-C power meter for up to 20 V and 5 A that can also cut and restore power to the device behind it, and its brain is an ATtiny816 microcontroller that costs $0.71.
What the board does
- Measures. A TI INA237 reads voltage and current across a 5 milliohm shunt on the input side, with a resolution of 250 uA up to 8 A.
- Power-cycles properly. Two back-to-back MOSFETs open VBUS and the output is drained. Then two solid-state relays open the CC lines, so the charger sees the device as unplugged and renegotiates USB Power Delivery from scratch. Power returns after 10 seconds. Opening the CC lines is the important detail: just switching VBUS can leave a PD charger in a confused state.
- Protects. Above 6 A by default, the INA237 raises an alert and the FETs open within a few milliseconds.
- Stays out of the way. USB 2.0 data passes straight through, and optional screw terminals accept a plain 5 V to 20 V DC supply for boards that are not USB-C powered.
Meters can be daisy-chained with ordinary Qwiic cables. Each one has a name and an address, and an identify command blinks its LEDs so you can find it on a crowded bench. Readings and commands go over I2C or RS-485; the team switched the newer revision to RS-485 for longer cable runs while keeping I2C as an option.
Why an ATtiny816
The ATtiny816 needs almost nothing around it: no crystal, no external flash and no USB chip. It is flashed through a single UPDI pin with a 3.3 V USB-serial adapter and a 1 kOhm resistor. The firmware runs the internal oscillator at 10 MHz and reads the factory calibration stored in each chip to correct its clock and baud rate, which keeps the energy-count timing within a few tenths of a percent without a crystal. The bare-metal C++ firmware uses 4.4 KB of the 8 KB flash and 181 of the 512 bytes of RAM. The chip has only one I2C interface, so a second one was bit-banged to talk to the INA237.
Dubouilh says the design went from idea to an ordered, assembled PCB and firmware in about two hours, with Claude Code checking the KiCad schematic and drafting the first PCB layout, which he then cleaned up by hand. The first fabricated batch works: metering, remote reset and flashing were checked with a phone fast-charging through the meter. The team plans to open-source the KiCad project, firmware, case and fabrication scripts.
Our take
Kernwerk built this to measure the energy per AI inference on edge boards, a number that rarely appears in datasheets. But the design is useful to anyone automating a test rack or CI setup for embedded hardware. The CC-line trick for a real USB-C power cycle is worth copying even if you never build the whole meter.
Image credit: Kernwerk, cropped and resized.
About the author: Aswinth Raj is an electronics engineer and the editor of CircuitDigest, where he has published more than 150 hands-on projects and tutorials across Arduino, PIC, ESP32, Raspberry Pi and EV battery systems. He selects the stories on this page for what engineers and makers can actually learn or build from. Connect on LinkedIn
Add a comment
No account needed. Your comment appears once a moderator has reviewed it.