I replaced a dead battery in my Ice Tube Clock earlier this week and thought it might be nice to increase battery life. On my multimeter, the current draw of an unmodified Ice Tube Clock while sleeping was 47 uA
with 3.3 volt power supply. That is reasonably efficient, but with the picoPower features of Atmel processors, I was able to make the clock a bit more efficient. With this hack, one battery should last for the lifetime of the clock. :-)
(1) From the schematic, R1 can be attached directly to the +5v regulator output, moving the attachment before
D2. In that configuration, D2 prevents the divider from drawing current while the clock is sleeping. To make that change, I cut the trace between R1 and Vcc and soldered the red wire between the voltage regulator and R1. (The yellow wire was added later.) Sleep current fell to 33 uA
With the software changes described below
, connection between the 5v regulator output pin and the ATmega328p PC1 pin (yellow wire) is no longer necessary
(2) After replacing the ATmega168 with an ATmega328p flashed with my xmas-icetube firmware, sleep current fell to 29 uA
(3) Without external power, the output of the voltage regulator should fall to ground level; with external power, the output of the regulator should rise to Vcc. Thus, restoration of power may be monitored digitally by connecting the output of the voltage regulator to PC1 on the ATmega (the yellow wire pictured above). A complimentary software modification allowed the firmware to disable the analog comparator when PC1 is low. Sleep current fell to 25 uA
(4) Brown-out detection (BOD) is definitely a nice feature, but a user should know to replace the battery if the clock behaves strangely after sleeping or if the clock fails to keep time while sleeping. So BOD can be disabled. After disabling BOD, sleep current fell to 6 uA
. (Disabling both the analog comparator and BOD allows the internal voltage reference to power down.)
(5) During sleep, the clock does little more than wake once per second to increment the current time. Since a software lockup is unlikely, the watchdog timer is unnecessary. After disabling the watchdog during sleep, sleep current fell to 1.7 uA
A typical CR1220 cell contains about 40 mAh worth of power, and at 1.7 uA, a single coin cell can power the clock for around two and a half years!
The software portion of this hack is available from http://www.github.com/johngarchie/xmas-icetube/
, and may be enabled by uncommenting the PICO_POWER macro definition in config.h .