In this post I have explained how to make 2 accurate long duration timer circuits ranging from 4 hours to 40 hours, which can be upgraded further for getting even longer delays. The concepts are fully adjustable.
A timer in electronics is essentially a device which is used for producing time delay intervals for switching a connected load. The time delay is set externally by the user as per the requirement.
Introduction
Please remember that you can never produce long accurate delays using only a single 4060 IC or any CMOS IC.
I have confirmed practically that beyond 4 hours IC 4060 begins deviating from its accuracy range.
IC 555 as a delay timer is even worse, it's almost impossible to get accurate delays even for an hour from this IC.
This inaccuracy is mostly due to capacitor leakage current, and inefficient discharging of the capacitor.
ICs like 4060, IC 555, etc basically generate oscillations which are adjustable right from a few Hz to many Hz.
Unless these IC are integrated with another divider counter device such as IC 4017, getting very high accurate time intervals may not be feasible. For getting 24 hour, or even days and week intervals you will have integrate a divider/counter stage as shown below.
In the first circuit we see how two different modes of ICs can be coupled together to form an effective long duration timer circuit.
1) Circuit Description
Referring to the circuit diagram.
- IC1 is an oscillator counter IC consisting a built in oscillator stage and generates clock pulses with varying periods across its pins 1,2,3,4,5,6,7,9,13,14,15.
- The output from pin 3 produces the longest time interval and therefore we select this output for feeding the next stage.
- The pot P1 and the capacitor C1 of IC1 can be used for adjusting the time span at it pin 3.
- The higher the setting of the above components the longer the period at pin #3.
- The next stage consists of decade counter IC 4017 which does nothing but increase the time interval obtained from IC1 to ten folds. It means if the the time interval generated by IC1s pin #3 is 10 hours, the time generated at pin #11 of IC2 would be 10*10 = 100 hours.
- Similarly if the time generated at pin #3 of IC1 is 6 minutes, would mean a high output from pin#11 of IC1 after 60 minutes or 1 hour.
- When power is switched ON, capacitor C2 makes sure that the reset pins of both the ICs are appropriately reset, so that the ICs begin counting from zero rather than from some irrelevant intermediate figure.
- As long as the counting progresses, pin #11 of IC2 remains at logic low, such that the relay driver is held switched OFF.
- After the set timing lapses, pin#11 of IC2 goes high activating the transistor/relay stage and the subsequent load connected with the relay contacts.
- The diode D1 ensures that the output from pin#11 of IC2 locks the counting of IC1 by providing a feed back latch signal at its pin #11.
Thus the whole timer latches until the timer is switched OFF and restarted again for repeating the entire process.
Parts List
R1, R3 = 1M
R2, R4 = 12K,
C1, C2 = 1uF/25V,
D1, D2 = 1N4007,
IC1 = 4060,
IC2 = 4017,
T1 = BC547,
POT = 1M linear
RELAY = 12V SPDT
PCB Layout
Formula for Calculating Delay output for IC 4060
Delay Period = 2.2 Rt.Ct.2(N -1)
Frequency = 1 / 2.2 Rt.Ct
Rt = P1 + R2
Ct = C1
R1 = 10(P1+R2)
Adding Selector Switch and LEDs
The above design could be further enhanced with a selector switch and sequential LEDs, as indicated in the following diagram:
How it Works
The main element of the timing circuit is a 4060 CMOS device, which is made up of an oscillator along with a 14 stage divider.
The frequency of the oscillator could be tweaked through potentiometer P1 in order that the output at Q13 is around a single pulse each hour.
The period of this clock beat could be extremely quick (around 100 ns), as it additionally resets the whole 4060 IC by way of diode D8.
The 'once each hour' clock pulse is given to the 2nd (divide-by-ten) counter, the 4017 IC. One of several outputs of this counter is going to be logic high (logic one) at any given instant.
When the 4017 is reset, output Q0 goes high. Right after one hour, output Q0 will turn low and output Q1 may become high, etc. Switch S1 as a result allows the user to choose a time interval through one to six hours.
When the chosen output becomes high, the transistor turns off and the relay gets switched OFF (thus turning off the connected load).
Once the enable input of the 4017 is furthermore attached to the wiper of S1 any succeeding clock pulses turns out to have no impact on ihe counter. The device will consequently continue to be in the switched OFF condition until the reset switch is presed by the user.
The 4050 CMOS buffer IC along with the 7 LEDs are incorporated to offer indication of the range of hours which may have essentially elapsed. These parts could, obviously, be removed in case an lapsed time display is not needed.
The source voltage for this circuit is not really crucial and could be cover anything from 5 and 15 V, The current usage of the circuit, excluding the relay, will be in the range of 15 mA.
It is advisable to pick a source voltage that may be matching the specifications of the relay, to ensure that any problems are avoided. The BC 557 transistor can handle a current of 70 mA, so make sure the relay coil voltage is rated withing this current range
2) Using Only BJTs
The next design explains a very long duration timer circuit which uses only a couple of transistors for the intended operations.
Long duration timer circuits normally involve ICs for the processing because executing long duration delays requires high precision and accuracy which is possible only using ICs.
Achieving High Accuracy Delays
Even our very own IC 555 becomes helpless and inaccurate when long duration delays are expected from it.
The encountered difficulty for sustaining high accuracy with long duration is basically the leakage voltage issue, and the inconsistent discharging of the capacitors which leads to wrong starting thresholds for the timer producing errors in the timing for each cycles.
The leakages and inconsistent discharge issues become proportionately bigger as the capacitor values get bigger which becomes imperative for obtaining long intervals.
Therefore making a long duration timers with ordinary BJTs could be almost impossible as these devices alone could be too basic and cannot be expected for such complex implementations.
So How can a Transistor Circuit Produce Long Accurate Duration Time Intervals?
The following transistor circuit handles the above discussed issues credibly and can be used for acquiring long duration timing with reasonably high accuracy (+/-2%).
It's simply due to effective discharging of the capacitor on every new cycle, this ensures that the circuit begins from zero, and enables accurate identical time periods for the selected RC network.
Circuit Diagram
The circuit may be understood with the help of the following discussion:
How it Works
A momentary push of the push button charges the 1000uF capacitor fully and triggers the NPN BC547 transistor, sustaining the position even after the switch is released due to the slow discharging of the 1000uF via the 2M2 resistor and the emitter of the NPN.
Triggering of the BC547 also switches ON the PNP BC557 which in turns switches ON the relay and the connected load.
The above situation holds on as long as the 1000uF is not discharged below the cut off levels of the the two transistors.
The above discussed operations are quite basic and make an ordinary timer configuration which may be too inaccurate with its performance.
How the 1K and 1N4148 Work
However the addition of the 1K/1N4148 network instantly the transforms the circuit into a hugely accurate long duration timer for the following reasons.
The 1K and the 1N4148 link ensures that each time the transistors break up the latch due to insufficient charge in the capacitor, the residual charge inside the capacitor is forced to discharge fully through the above resistor/diode link via the relay coil.
The above feature makes sure that the capacitor is completely drained off and empty for the next cycle and thus is able to produce a clean start from zero.
Without the above feature the capacitor would be unable to discharge completely and the residual charge inside would induce undefined start points making the procedures inaccurate and inconsistent.
The circuit could be even further enhanced by using a Darlington pair for the NPN allowing the use of much higher value resistors at its base and proportionately low value capacitors. Lower value capacitors would produce lower leakages and help to improve the timing accuracy during the long duration counting periods.
How to Calculate the Component Values for the Desired Long Delays:
Vc = Vs(1 - e-t/RC)
Where:
- Vc is the voltage across the capacitor
- Vs is the supply voltage
- t is the elapsed time since the application of the supply voltage
- RC is the time constant of the RC charging circuit
PCB Design
Long Duration Timer using Op Amps
The disadvantage of all analogue timers (monostable circuits) is that, in an effort to achieve fairly long time periods, the RC time constant needs to be correspondingly substantial.
This inevitably implies resistor values of greater than 1 M, that may result in timing mistakes caused by stray leakage resistance within the circuit, or substantial electrolytic capacitors, that similarly can create timing problems because of their leakage resistance.
The op amp timer circuit shown above accomplishes timing periods as much as 100 times more time compared to those accessible using regular circuits.
It achieves this by lowering the capacitor charging current through a factor of 100, consequently improving the charging time drastically, without requiring high value charging capacitors. The circuit works in the following way:
When the start/reset button is clicked C1 gets discharged and this causes output of op amp IC1, which is configured as a voltage follower, to become zero volts. The inverting input of comparator IC2 is at a reduced voltage level than the non -inverting input, hence the output of IC2 moves high.
The voltage around R4 is around 120 mV, which means that C1 charges via R2 with a current of approximately 120 nA, which apprers to be 100 times less than what could be attained in case R2 had been attached direct to positive supply.
Needless to say, if C1 had been charged through a consistent 120 mV it could rapidly achieve this voltage, and stop charging any further.
However, the lower terminal of R4 being fed back to the output of IC1 ensures that as the voltage across C1 goes up so does the output voltage and therefore the charging voltage given to R2.
Once the output voltage climbs to approximately 7.5 volts it surpasses the voltage refernced at the non-inverting input of IC2 by R6 and R7, and the output of IC2 becomes low.
A tiny quantity of positive feedback supplied by R8 inhibits any kind of noise existing on the output of IC1 from getting boosted by IC2 as it moves from the trigger point, because this normally produce false output pulses. The timing length can be calculated by the equation:
T = R2 C1( 1 + R5/R4 + R5/R2) x C2 x ( 1 + R7/R6)
This may appear somewhat complex, but with the part numbers indicated the time interval can be set as long as 100 C1. Here C1 is in microfarads, let's say if C1 is selected as 1 µ then the output time interval will be 100 seconds.
It is very clear from the equation that it is possible to vary the timing interval linearly by substituting R2 with a 1 M potentiometer, or logarithmically by using a 10 k pot in place of R6 and R7.
Chanogura Geoffrey says
Hi, can I use ic 555 instead of 4060 in the first circuit, because here 555 is the only one I can access
Swagatam says
Hi, you can use it but it won’t provide accurate time intervals like 4066 IC
Mohammed Reda Mohssin says
hello, from you get the pin 16 in the first circuit can you explain as soon as possible please .
Swagatam says
Pin16 is the supply positive or the Vcc pin for both the ics, 4017 and 4066…
Mohammed Reda Mohssin says
what is the replacement of ic44060 i cant find it near me
Swagatam says
I think it is ic 4020, but the pinout configuration may be different, please check the datasheet of the ic…
Steve Rickman says
Great site! I discovered you site while teaching my grandson electronics.
The long time delay using the 4060 and 4017 is almost identical to the timer I’ve been building with him on breadboard.
My question is please where can we purchase the PCB board you have kindly designed? Here in uk PCB company’s are extremely expensive.
Please let me know if you have the facility to produce these for sale.
Many Thanks Steve
Swagatam says
Thank you, glad you liked the site, however unfortunately I no longer manufacture PCBs, so it may not be possible for me to make it for you. Procuring a single piece can be always expensive no matter which country you are in. I would rather suggest you to build the circuit on a stripboard by soldering the parts which will produce more accurate results. Please let me know if you have any further questions.
Ketan says
I refer 1st circuit in this delay calculation formula Delay Period = 2.2 Rt.Ct.2(N -1) has been given. can you clear me N stands for what
Swagatam says
N stands for the Q number, Q1, Q2, Q3 Qn….please see the figure 1 in this datasheet:
https://www.st.com/resource/en/datasheet/m74hc4060.pdf
Val says
In your BJT timer circuit what is the maximum time I can get in this circuit and what components should I use to get an adjustable timing upto 8 hours
Swagatam says
Hi Val, In the BJT timer circuit 8 hours may not be feasible. You will have to employ the first circuit for an 8 hour long time delay.
dng says
Hello Swagatam,
I like your article!
I am interested in using design no. 2) “Using Only BJTs”.
What is R in the formula?
If I am feeding my capacitor straight from the supply voltage, like in your drawing, surely Vs = Vc, right?
In that case Vc/Vs = 1, and then ln(1) = 0, which does not yield a result.
How can I calculate the delay time of this circuit?
Swagatam says
Thank you dng,
R indicates the 2M2 resistor.
I got this formula from Wikipedia.
I think it is better to check the timing practically by using arbitrarily selected RC values, and then finding out the intended values through simple cross multiplication, since the operation is very linear and proportional.
dng says
Thx Swagatam,
I tried to calculate the time for the OpAmp circuit you show towards the end of the article, but I cannot get the 100s for the case where I use your standard values shown and a 1 uF value for C1. I converted all the R values into Ohm, and the C values into uF.
Could you pls tell me what I am doing wrong?
R1 100 Ohm = 100 Ohm
R2 1 MOhm = 1000000 Ohm
R3 100 kOhm = 100000 Ohm
R4 100 Ohm = 100 Ohm
R5 10 kOhm = 10000 Ohm
R6 3.3 kOhm = 3300 Ohm
R7 5.6 kOhm = 5600 Ohm
R8 10 MOhm = 10000000 Ohm
C1 1 uF = 1 uF
C2 1 nF = 0.001 uF
T = R2 C1( 1 + R5/R4 + R5/R2) x C2 x ( 1 + R7/R6)
T = 1000000*1*(1 + 10000/100 + 10000/1000000) x 0.001 x (1 + 5600/3300)
T = 272420.909 s
Swagatam says
Hi dng,
The R2 and C1 are the main timing components, which you can adjust until you get the desired time delay at the output. I still believe doing the practical trial and error method which can enable you get the perfect and the most precise component values for the required delays.
You can probably try the following modification in your calculation:
100 = R2*C1*(1 + 10000/100 + 10000/1000000) x 0.001 x (1 + 5600/3300)
dng says
I liked the plain transistor circuit because of it’s simplicity. I tried the circuit with a 4000uF cap, but only achieved marginally longer delays (a few seconds). Increasing 2k2 causes the circuit to become unresponsive.
Swagatam says
The base resistor of BC547 is 2M2 not 2k2, and it can give very long delays, I have tested it myself and I could achieve very long delays, you might be doing something wrong in the circuit.
Jose says
Very educational and helpful. I need a circuit that turns ON for 5 hours and OFF for 19 hours. Needs to be low power and uses 5VDC or less.
Swagatam says
Thank you Jose,
You can try the following concept with appropriate adjustments:
https://www.homemade-circuits.com/how-to-make-simple-programmable-timer/
Matt says
I need a circuit that has a 30 day timer, and can power a small motor at the end of the 30 day timer, until the motor or attached mechanism trips a momentary switch, and then the 30 day timer restarts.
Swagatam says
I think the following concept can be tried for your application:
https://www.homemade-circuits.com/making-programmable-timer-circuit-using/
shankar rao says
i need two chambers working alternative with 6 hrs delay and if one is damaged the remaining should on circuits
i need hard ware design or any module which is suitable send me i will purchase
Swagatam says
You can try the following circuit:
https://www.homemade-circuits.com/how-to-make-simple-programmable-timer/
Sorry, ready-made prototype cannot be supplied from this site.
B.K.LEELESH says
Hello sir, Good morning.
sir, this is with regard to the first design in this article. I want to run three different loads to on and off at two different delay periods. Is it possible sir.
with thanks,
leelesh
Swagatam says
Hello B.K.
you can definitely use the first long duration timer concept to accomplish your application, for running 3 different loads, each with two different sets of ON/OFF delay periods.
Leelesh says
Thank you sir,
Jesus Amaris says
Hello engineer, I need help to design a timer with a unique 4060 if it is possible. I need an on time of 30sec and an off time of 1min. I can do it with a 555 and a 4017. But since the 4060 has its own oscillator I would like to try it and with this I save space and money. I appreciate if you can make an outline and your kind attention. Thanks.
Swagatam says
Hello Jesus, I will try to design it for you and let you through this comment soon….stay tuned.
John Callaghan says
Hi Swagatam, you have created a great site, I discovered it during my search for a very long duration delay on timer, that I need to source or get someone to make; what I need is a low cost, reasonably accurate delay timer, that can be started manually by bridging 2 pins, it will time down for 3 or 6 months, (that is previously set to either of times as required) at the end of the period it turn on a relay to turn on an external flashing LED indicator light. The timer would be restarted manually as required by either bridging the 2 ‘start’ pins or another set of pins
Do you know of any such timer or anyone interested in making say 40 units as soon as possible, any assistance would be greatly appreciated Thanks John Callaghan
Swagatam says
Thank you John, to get the required results you can upgrade the first circuit from the above article, by adding more number of 4017 ICs with the existing 4017 IC. The transistor relay driver can be removed from the shown position and the same can be attached to the selected output of the last 4017 IC. To reset the entire circuit, you can connect all the pin15 of the 4017 ICs, and connect a push button parallel to C2.
John Callaghan says
Hi Swagatam thanks for you very informative reply, it seems like it is the solution to my problem; I now need to get someone to built me a prototype with a 6 month timing period, so i can assess its operation, do you know of anybody that may be interested, I am happy to pay a reasonable price for a working prototype.
Thanks a Lot for your assistance
All the Best
John
Swagatam says
Thank you John,
At the moment I do not know anybody who can assemble a practical prototype for you, however I will inquire about it, if I find somebody suitable, will inform you regarding the same.
Upul Karunarathna says
Hello Swagatam,
I made the first circuit using 4060 IC and 4017 IC. Please tell me how to calculate the P1 value to get impulses with 60 min intervals from 4060 IC. So the time interval between 4017 IC pin would be 1 hour. please show me the calculation. Thank you very much.
Swagatam says
Hello Upul, The formula is given in the article, but I have never used it so can’t confirm its results….the easier way is to check it by some trial ans error. For example if the P1+R2 value is 500k, and C1 value is 0.1uF which gives a timing of 30 minutes, then if C1 value is made two time more to 0.2uF will produce 1 hour timing output from the 4060. Therefore, the response is very linear. You can test with a small capacitor to get the sample timing, and then dimension the capacitor accordingly to get the desired time output from the 4060 IC
Upul Karunarathna says
Thank you so much for your quick reply. The answer is very useful for me. I can try this and get my work done. Thank you so much for publishing this kind of circuit diagram. wish you all the best.
Swagatam says
You are most welcome Upul!
Amdani Wijaya says
Thanks for sharing.
I want to ask about the third circuit that using OP-AMP IC. What is the resistance value of R3 (trimpot) to be set when building this circuit?
Swagatam says
It is 100k preset
Vu Phan says
Swagatam,
I made a simple monostable mode 555 circuit and it works perfectly with an LED at the output. However, when I try to connect the output to a relay switch, it switched at first but then it wont return to original state. I tried the whole process on Multisim, and it only works once – switch on and off, after that nothing switch at all no matter how many time I hit the virtual button . I’m not sure where im tripping at. Could you help me?
I look around where to upload my schematic for an easier look or even your email so I could contact you but couldn’t find any.
Swagatam says
Hi Vu, did you build it practically by using real parts? Soft wares can be misleading, but if you build it physically it will surely work. You can refer to the examples presented in the following article
10 Best Timer Circuits using IC 555
Relay can be connected directly across pin3 and ground with a protection diode across the relay coil
Vu Phan says
Hi Swagatam,
What is N in this formula?
Delay Period = 2.2 Rt.Ct.2(N -1)
Swagatam says
Hi Vu, N corresponds to the pinout sequence number among the outputs of the IC 4060
Vu Phan says
Hi Swagatam,
Can you help me with how to make a timer circuit that first count the switch off time then close, count the switch on time then off. More like off (timer) –> on (timer) –> off.
Both timers are desired to be adjustable around 1 minute to 1 hour.
Thank you in advance!
Swagatam says
Hi Vu, You can try the following design, it is exactly what you are looking for!
Simple Programmable Timer Circuit
Vu Phan says
Swagatam,
Thank you for your response. I have checked out the link provided, currently trying to gather the parts but when I watched the video, I realized that this schematic repeats itself with infinitely loop, and that’s not what I wanted. I only need it to run 1 loop, no repeating. Could you help me with that?
Swagatam says
Hi Vu, the diode across pin#3 and pin#11 of the upper IC latches the system and enables the circuit to work in a one-shot monostable mode, removing this diode allows the circuit to work in a cyclic manner.
Duleep Kumara says
I am interested in this IC 4060 and IC 4017 timing circuit. How can I
add a circuit to this circuit, to set a time range when I go out of Home.
Please help me.
Swagatam says
You can try the second concept, and use the S1 switch for programming the timing, along with the 500k pot P1
DemalCal says
Hello, I’m interested in apply the first circuit. I need to make the NO and NC change in 5.5 hours (5 hours, 30 minutes). I’m not sure how to use equations to calculate resistances and capacitors, specially because in Delay piriod has a N parameter that I don’t know what it is.
Thank you for your answer
Swagatam says
Hello, if the ON and OFF timing are equal then you can implement it using a single IC 4060 stage, the IC 4017 can be ignored and removed.
For timing component value calculation, you can first determine any small random timing using random R and C values. Once the random time value is found using random parts, you can use them as the sample yardstick to determine the 5.5 hour values.
More can be learned in the following article
https://www.homemade-circuits.com/how-to-make-simple-programmable-timer/