Processing math: 100%

I’d like to be able to turn on a gadget roughly once a day, then guarantee that it’s turned off a few minutes later—or sooner if the gadget’s finished its task. This is a reasonably common problem, and gadgets which solve it are usually called wakeup timers.

As you might have guessed the gadget here is a microcontroller which needs to take some measurements, transmit them to a server, then do nothing until the next day. One could simply put the microcontroller into a deep sleep when it’s finished, and rely on a low-power timer to wake it the next day. For this project though I wanted stronger guarantees that it would work properly. So, I built a low-current timer which controls things. Happily there are lots of chips to make this very straightforward. I looked at two: the 74HC4060 and the LTC2956.

The 74HC4060

The 74HC4060 contains both a 14-stage counter, and the inverters needed to build an RC oscillator. If we ignore limiting the on-time, but just generate a square-wave with a period of about a day, then we need two resistors and a capacitor besides the IC.

[74HC4060 Schematic]

Tperiod2.2R1C1R22R1.

Experimental results

For the experiment below I used a CD74HC4060E1 from Texas Instruments. It’s an old chip: the datasheet is dated February 1998.

Vcc / V 3.3 3.3
R1 / kΩ 390 390
R2 / kΩ 840 840
C1 / nF 1 100
f4 / Hz 66.7 0.65
t14 / s 15.3 1,600
I / µA 360 275

Notes:

Whilst this works, and it was easy to set up, it draws about 0.3mA which is much too high. It’s possible that a different variation of the chip would draw less power. To get to a period of a day, we’d need to slow the oscillator down by a factor of about 50, which would probably also reduce the power consumption.

To provide a complete solution we could either trigger a monostable to give a fixed on-time, or use a flip-flop set on the rising-edge of Q14 and reset when some of the lower bits go high. In both cases the microcontroller could shorten the on-time

However, we can do very, very much better than the 74HC4060.

The LTC2956

The LTC29562 is described as a ‘Wake-Up Timer with Pushbutton Control’. We don’t care about the button, but the upshot is that the device will do exactly what we want given a handful of discrete components, whilst drawing just 800nA.

I am indebted to Parker Dillman of the MacroFab Engineering Podcast3 for making me aware of this part: he’s using it in his Cat Feeder Unreminder4 project.

The are a couple of variants of the LTC2956: the -1 part has an active high output designed for driving the enable pin of a voltage regulator; the -2 part has an active low output suitable for driving the gate of a p-channel high-side MOSFET switch.

Ignoring some of the chip’s features, the low-frequency oscillator is made from a faster oscillator and a divider chain, which triggers a timer. The frequency of the oscillator and the quotient for the divider are both set with resistors, and the period of the timer by a capacitor.

[LTC2956 Schematic]

Tperiod=Rperiod×Nrange400,Ton=Con75.

Times are in seconds, resistances in kΩ and capacitances in nF. Nrange is the divider ratio, set by a resistor according to the following table:

RECOMMENDED PERIOD Nrange Rrange / kΩ
0.25s to 0.8s 1 9.76
0.4s to 3.2s 4 17.4
1.6s to 12.8s 16 26.1
6.4s to 51.2s 64 35.7
25.6s to 3.4min 256 47.5
102s to 14min1,024 61.9
6.8min to 55min4,096 78.7
27min to 3.6hr16,384 100.0
1.82hr to 15hr65,536 127.0
7.28hr to 58hr262,144 162.0
29hr to 233hr1,048,576 210.0
233hr to 932hr4,194,304 280.0

Period changes

If Ton is bigger than Tperiod shown above, the period is stretched to Ton + 125ms.

The on time can be shortened by sending a short pulse to the SLEEP pin. Sending a long pulse (as configured here, long means more than 16.384s) will turn the timer off. For more details consult the data sheet.

Conclusions

It is perhaps not surprising that single chip wakeup timers exist. Nevertheless, I was pleasantly surprised that they need such little current to function.

One potential gotcha: if you connect the output of the LTC2956 to test gear with an input impedance of 1MΩ then a few Volts will drive a current of a few µA. Normally it would be safe to ignore such currents, but here they dominate the 0.8µA needed to run the chip itself.