There are many applications for which a timer is very useful to turn a device on or off automatically after a preset interval - for example, switching off an irrigation system after 30 minutes of use, turning off a battery charger to prevent overcharging, etc.
Timing short intervals of milliseconds to minutes can easily be achieved using a NE555 timer chip. Unfortunately, this device is not suitable for timing longer intervals, and so a suitable alternative is required.
A schematic of the 4060B chip is provided below:
The pins labelled in red Q4-Q14 are the binary outputs: Q4 for the 16's, Q5 for the 32's, Q6 for the 64's and so on up to Q13 for the 8192's, and Q14 for the 16384's.
Just three external components are required to control the 4060B counter - two resistors and one capactor. The frequency of the internal oscillator (i.e. the speed of the count) is set according to the equation given at the bottom of the schematic below:
Since Q14 represents the 16,384's and Q4 represents the 16's - we know it will take 1,024 times longer (16,384 / 16) for Q14 to flip from 0 to 1 than it takes Q4. So, for an example 2-hour timer (=7,200 seconds), we just need to fine-tune the circuit so that Q4 turns on after 7,200 / 1,024 seconds = 7.03 seconds, knowing that if that is done correctly, after exactly 2 hours Q14 will flip from 0 to 1.