Pocket Concepts' Microchip ATtiny45-Powered Ammeter Really Pushes What You Can Do with 4kB
Tiny debugging tool provides a real-time readout of current consumption on a compact OLED display.
Pseudonymous YouTuber "Pocket Concepts" has set themselves the challenge of building a useful portable gadget with a display driven by one of the lowest-end Microchip microcontrollers around: the humble ATtiny45, with its compact 4kB of program memory.
"Sometimes when I'm prototyping a multimeter just isn't the tool I want for doing inline current measurements," Pocket Concepts explains. "So I set out to make an ammeter with my competing needs of fast prototyping and semi-permanence in mind. Can this all be done using an eight-bit microcontroller with only 4k of memory?"
The resulting design uses a Y-shaped board layout, putting positive and negative contacts on the forks and a USB Type-C connector on the leg. There are quick-connect terminals for hooking in wires, while the PCB of the forks themselves expose a large contact area β making them compatible with crocodile clips. The bulk of the board, meanwhile, is dominated by a compact OLED display providing a real-time readout of the circuit's power consumption in amps.
"The schematic consists of two main parts," Pocket Concepts explains. "The current sense opamp which is offset by VCC/2 so that I can measure current direction, and the [Microchip] ATtiny45 chip which drives the OLED and does the calculations from ADC to current. I was very close to not being able to fit [the] program on the 4kB of program memory on the ATtiny45: I think I ended on 98% [usage] and I didn't have much more I could get rid of."
The project is documented in the video embedded above and on Pocket Concepts' YouTube channel; hardware design files and firmware source code have been published to GitHub under an unspecified license.