Low rider

A project log for Annoy-o-tron Tiny

The (in)famous beeping prank made as small as possible

Nick SayerNick Sayer 06/26/2020 at 22:360 Comments

Well, I had an opportunity to to put the prototype on my µCurrent and it came back at something like 90 µA, which seemed quite high to me.

The challenge is that you want to have a relatively fast clock while beeping so that you can run lots of instructions between pin toggles (yes, I could have used the timer PWM output instead of toggling a pin by hand, but those pins are shared with the programming interface, and it's just a whole lot easier to put low impedance or capacitive loads on the unshared B2).

Well, since you can switch clock sources and prescaling on the fly, I decided to use differential clocking. So we use the 8 MHz oscillator pre-scaled by 8 for beeping (1 MHz), and use the 128 kHz oscillator pre-scaled by 1 for the long wait periods. During the wait, we set up the timer with a divide-by-1024 prescale itself, and wait 1250 counts - 10 seconds - between interrupts. With this, the long term current draw seems to be approximately 7 µA - astonishingly low. In principle, the battery could last almost a year, except that the actual beeping is going to cost something. Still, if we assume a draw of 5 mA during beeping, and we beep for 1/4 second, that's about 350 nAH per beep, or well over 100,000 beeps on one battery (since the active current required by the Tiny9 at 1 MHz and 3 volts is around 300 µA, most of the assumed power is for the speaker).