# Long duration timers - Notes for beginners

Tips for beginners on long duration timers.

1. One of the many things I've seen pop up time and time again is people's requirement for timers with periods of many minutes (or very low frequency oscillators). Often a 555 is mistakenly suggested.

1.0 Long period timers and low frequency oscillators

It is quite common to require a circuit to time long periods, or to supply a very low frequency signal.

The problem that many beginners don't realise is that the same techniques (RC oscillators of various descriptions) used for audio frequencies may not be applicable to very low frequencies.

This document seeks to inform when it is time to use another technique, and to suggest alternative techniques to consider.

2.0 What are the "normal techniques?

For oscillators as frequencies around the audio frequencies (say 10Hz to 100kHz) it is fairly simple to design an RC oscillator. Very few special precautions are required, and on-line calculators are available for the 555.

For timers (which are essentially oscillators that only produce a single pulse at a time) time periods corresponding to these frequencies -- hundredths of seconds to tens of uS -- are similarly straightforward.

2.0 How long is a long time?

While frequencies lower than 10Hz and times longer than a tenth of a second are obtainable using RC oscillators, as you venture further in this direction there are factors that can be ignored in higher frequency oscillators that start to play a larger and larger part.

In this region, the frequency stability with voltage or temperature may be far worse, and noise immunity may be far lower.

Once the period of an RC oscillator exceeds a couple of seconds, these additional factors may dominate. At the very least, the frequencies and periods may be significantly different from calculated values. At worst oscillators won't oscillate, and timers won't time.

A long time is partially defined by requirements of stability and accuracy, but times exceeding a couple of seconds are "long" for almost all purposes.

3.0 What is the problem?

Briefly, the problems are:

1) leakage
2) input currents
3) sensitivity to noise

As has been pointed out by 55pilot (and this is paraphrased a little):

The latter point is worthy of some clarification (and is probably NOT for beginners). Normally, where the charging or discharging of a capacitor results in the voltage on that capacitor approaching the supply rail asymptotically, the voltage crosses the threshold (1/3 or 2/3 Vcc) in a fairly linear manner. Thus the time the signal is close (however you measure close) to a threshold remains constant as a proportion of the period. Thus the effect of noise on period is fairly linear. However, when charging currents are low, and internal leakage and/or loading from the inputs of the 555 are significant with respect to these, the voltage across the capacitor may be asymptotic to a lower voltage than Vcc (it is asymptotic to a voltage that corresponds to a current through the charging resistor(s) which equals the sum of any discharging effects such as leakage and input currents). Due to this, the proportion of time the RC circuit spends close to the trigger level can be dramatically longer, and hence the effect of the same amount of noise can be disproportionately larger.

With long durations, you typically have large value capacitors and high value resistors. The low currents cause problems, and they are worse than you might initially calculate them to be!

55pilot (paraphrased a little) describes it well here:

Note that in the first example, the leakage current may be a worst case value. Typically it may be lower. You might thing that is a good thing -- we it is, but it hides a trap. The leakage characteristics of a capacitor change with age, temperature, etc., so it is entirely possible that you can have a circuit that worked when you made it in winter, but fails in summer, or fails after it's left turned on for a while, or fails after a couple of years.

4.0 What can be done?

The options are:

1) use capacitors with lower leakage
2) divide a higher frequency
3) use a uC
4) use a constant current source

Option 1 sounds good because it allows us to use a familiar circuit. However there is no free lunch. 55pilot (again):

The issues that 55p points out are that the internal resistance of the supercaps limits the speed of charge and discharge so you may end up not being able to charge (or discharge) them fast enough if you have a duty cycle that is not close to 50%.

In addition, discharging such a large capacitor quickly may require a current in excess of what the 555 allows.

Option 2 (dividing a higher frequency) may be suitable in some cases. There are many chips available which can divide the frequency of an oscillator (the oscillator output must be compatible with them though). Dividing by almost any number, from 2 to 4096 (or more) can be done using the appropriate IC. (edit: there are a plethora of such dividers available).

So, if a 0.1Hz signal is required, one could produce a 410Hz signal and divide that by 4096.

The disadvantage of dividing an output is that generally speaking you lose control over the mark-space ratio of the signal. If this is critical, another approach (or very careful thought) is required.

Option 3 is to use a microcontroller and program it to give you the required signal at an output pin.

The advantage is that these can be obtained in very small packages (from 8 pins and up) and they can be programmed to do far more than just provide a series of pulses.

The disadvantage is that you require programming experience to use them, and also some hardware to program them (this varies in price and complexity)

Option 4 is to use a constant current source. This partially deals with the problem of the charge current decreasing as the capacitor charges. However the constant current needs to be large enough to ensure that it always exceeds the leakage and input currents of the 555.

This is only a partial solution, and will not work in all cases. It's also probably more complex that some other options.
martino and Gartmorn like this.
Continue to site