← Technology, Science & Infrastructure ▣ Distilled locally

A USB-C Power Meter That Goes the Extra Mile

By Nick Bild
December 2, 2026  ·  Hackster News ↗
A USB-C Power Meter That Goes the Extra Mile
Running an AI model on a battery-powered device is very different from running it on a desktop computer. Aside from getting the model to fit within the memory constraints of the hardware, there is the matter of how much energy it consumes. And that is not a question that can typically be answered by just reading a chip’s datasheet. To automate the process of collecting such information from a lab full of development boards, Pierre Dubouilh of Kernwerk recently developed a USB-C power meter with a few tricks up its sleeve. In addition to measuring power consumption, the little device can remotely power cycle the hardware that is plugged into it. As anyone who has ever run a large number of automated tests on embedded systems can appreciate, not having to walk over to a misbehaving development board to unplug it and plug it back in is a nice feature to have. Making every milliwatt count Dubouilh started by drawing up a schematic in KiCad before enlisting the help of Claude Code to check his work. The AI coding assistant then took a crack at laying out the PCB. While some manual cleanup of the layout was necessary, the initial design was functional. At the core of the meter is a 71-cent ATtiny816 microcontroller. This inexpensive 8-bit chip has enough processing power and all the peripheral hardware needed for the job, and it requires very few external components. Its factory-calibrated internal oscillator also provides the basis for sufficiently accurate timing when calculating energy consumption, eliminating the need for an external crystal. The actual measurements are handled by a Texas Instruments INA237 current and power monitor paired with a five-milliohm shunt resistor. The board supports USB-C power supplies delivering up to 20 volts at 5 amps, with current measurements having a resolution of 250 microamps. Pulling the plug remotely An arrangement of MOSFETs and solid-state relays allows the microcontroller to electrically mimic disconnecting a USB-C cable. After a ten-second interruption, the circuit reconnects the device so that USB Power Delivery negotiation starts afresh. The switching circuitry also doubles as an electronically controlled fuse, automatically disconnecting the load if excessive current is detected. Since the idea is to deploy a large number of these instruments throughout the lab, connectors were included to make it easy to daisy-chain them using standard Qwiic cables. Although the first batch of boards communicated exclusively via I2C, a subsequent revision added support for RS-485 to enable communication over greater distances. Each meter is individually addressable, and a command that flashes its onboard LEDs makes it easy to pick out a particular unit in a sea of development boards. The meter could come in handy for plenty of applications outside of AI benchmarking, of course. Fortunately for those who would like to have one on their own workbench, Kernwerk plans to release the PCB design files, the bare-metal C++ firmware (which occupies a mere 4.4 kilobytes of flash memory), and the design for a 3D-printed enclosure under an open source license in the near future.A custom USB-C power meter (📷: Kernwerk)
Originally published by Hackster News ↗ · rebuilt here from its own full-text RSS feed · all rights remain with the publisher, please read and support them there.