← All projects
attiny e-ink c++ low-power

Pillbox Timer

An e-ink pillbox lid that shows at a glance whether your meds are taken and due. No phone, no app, no clock, and an estimated 3–5 years on a coin cell.

The obvious design is a clock: timestamp every lid-open and compare it to the current time. But a real-time clock means more parts, more power and more to fail, so there isn’t one.

The pillbox only knows how many seconds have passed since the lid was last opened. For a daily dose, that’s enough:

StateTime since the lid was last opened
Doneunder 20 h
Take20–28 h
Overdueover 28 h, with how many hours late

Hardware

  • ATtiny1616: sleeps at ~1 µA and wakes the moment the lid opens
  • 1.54” e-ink display: readable in any light, and holding the image costs no power
  • Reed switch and magnet: detects the lid with no buttons or exposed contacts
  • CR2032 coin cell: an estimated 3–5 years of battery life

The fun constraints

  • 2 KB of RAM for a 5 KB frame. The text is pre-rendered in thin bands, the pill icon is computed pixel by pixel as the frame streams out, and everything else is white.
  • Keeping time while asleep. A hardware timer wakes the chip every 32 seconds, about 2,700 times a day instead of 86,400.
  • No flicker. Partial refresh only redraws changed pixels. There’s no room to store the previous frame, so the firmware re-renders it from the last text it showed.
  • Three display styles: plain, cheeky (CHILL / PILL TIME / UGHHH), or pixel-art faces that frown when you’re overdue.