Home > Circuits > 24 Hour Timer
Modified:21:51, 22 October 2013
INTRODUCTION
This circuit was designed to switch off battery chargers after 12 or 24 hours, for RC cars and car batteries, as I was forever forgetting about them but it can be used for any purpose, and with just one compnent change, can time for weeks!

The circuit can be used in 2 modes, as a one off timer that consumes no current when it switches off, and also as a cyclic timer that will repeat its timing repeated.

CIRCUIT DESCRIPTION
Designing long duration timers using conventional RC timing networks are difficult due to the large values needed. For example, a 555 monostable needs a 1M resistor and a 3300uF capacitor just to produce a 1 hour delay, and the accuracy is questionable. Therefore a digital approach has been taken for this design.

The theory is that an astable produces steady pulses, and a counter divides them until the required time has expired. The block diagram shows how this can be achieved.

The dividers are binary counters that effectively divide the astable frequency by 2 at every stage. In this design there are a total of 23 stages thus producing a division of 2^23 = 8,388,608. Therefore if the astable produces 100 pulses a second, then the time before the final output goes high will be 4194304 / 100 seconds = 41943 seconds, over 11 hours.

To get a time of 24 hours at the last output, the astable must have a frequency of 48.545185Hz (see table later on). The frequency of the astable can easily be reduced by increasing VR1 to 1M giving up to 10 days delay or even longer with higher values. To calculate the time use

Timing Period (s) = 4194304 / Osc.Freq.

CIRCUIT DIAGRAM

The circuit uses the CMOS 4060 14-stage binary counter with on board capability to include an astable. This is formed in IC1 using R2,3/C2/VR1. This sets the frequency to the required rate. The reason a fairly high frequency was used (as it could have been done with one IC) is that it is easier to build and calibrate an astable of around 50Hz rather than that of about 0.1Hz, and more accurate.

An LED is connected to Q5 giving a flash rate of 48Hz/ (2^5) = 1.5Hz showing that the counter is working. The clock to the second counter is taken from Q7, being 0.375Hz or one pulse every 2.6 seconds. This is further divided up to Q13 and Q14 which provide outputs that go high (the "on" part of the cycle) after 12 and 24 hours, giving the option to select either.

The output connects to a PNP transistor that will be conducting as long as the base is low, during timing, thus energising the relay until the timing is complete and the input goes high, thus releasing the relay and switching off the timer.

CN2 connects to the second set of contacts (SW3) of the relay so that any device can be switched to a maximum of 5A @ 12v or 2A @ 220vac. This should switch the live side of any device you want to control.

As soon as power is applied, R1/C1 reset the counters and the relay is energised, thus starting the timing..

TIMINGS AND DIVIDER OUTPUTS

Output, 2^
IC - Pin
Stage
Divisor
Low Time (sec)
Active
Time
1
1 -
Q0
2
0.0206
2
1
Q1
4
0.0412
3
1
Q2
8
0.0824
4
1
Q3
16
0.164
5
1
Q4
32
0.329
6
1
Q5
64
0.659
7
1
Q6
128
1.318
8
1
Q7
256
2.637
9
2
Q0
512
5.273
10
2
Q1
1024
10.55
11
2
Q2
2048
21.09
12
2
Q3
4096
42.19
13
2
Q4
8192
84.38
1 min, 24 sec
14
2
Q5
16384
168.8
2 min, 49 sec
15
2
Q6
32768
337.5
5 min, 38 sec
16
2
Q7
65536
675
11 min, 15 sec
17
2
Q8
131072
1350
22 min, 30 sec
18
2
Q9
262144
2700
45 min
19
2
Q10
524288
5400
1 hrs, 30 min
20
2
Q11
1048576
10,800
3 hrs
21
2
Q12
2097152
21,600
6 hrs
22
2
Q13
4194304
43,200
12 hrs
23
2
Q14
8388608
86,400
24 hrs
PCB LAYOUT
12hr / 24hrReset
PCB Dimensions = 67mm x 40mm

SW2 can be replaced with a 3 pin header and jumer link (as shown in the first photo) or wired to an external switch.

To calibrate the timer, connect up either way - shown below.VR1 sets the frequency of the astable and for correct timing should be set for 48.45Hz. A frequency meter or oscilloscope is useful here to set the frequency. Alternatively monitor the 13th divisor output - Q4 on IC2, pin 7 and monitor the low and high time with a stopwatch or timer. It should equal 84 seconds. Try to be accurate since any error will be magnified a further 1024 times by the rest of the dividers.


SW3

VIN
VTM
0V
By connecting the power to VTM, the unit with switch the relay on for its duration then off for the same amount of time, then repeat, thus producing a 50/50 cyclic timer. By connecting power to Vin and the a PTM switch from Vin to VTM, a one shot timer can be configured, perfect for battery chargers.

Connections for a ONE-SHOT TIMER

This method of connection needs the start button to be pressed to begin timing - note there is no current drain after timing has finished, the circuit switches the relay and itself off.

Connections for a CYCLIC TIMER

This connection will cause the timer to begin timing immedaiately activating the relay. After that timing period is up, the relay releases and after another equal timing period, repeats the cycle.


DOWNLOADS
Designed and Written by Phil Townshend 2008
Back to Circuits page...

www.edutek.ltd.uk - Working Electronics For Students & Teachers