Skip to main content

How to Make a Long Duration Timer

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.


A simple timer can be built through many countless options. You can transistors, CMOS gates like NAND gates, NOT gates, linear ICs like 555, 741, 324, or simply more specific type of CMOS IC like the 4060.All these devices besically generate oscillations which are adjustable right from a few Hz a second to a atomic fraction of a Hz.

Further more these ICs can be integrated together to form more complex timer circuits that may be used for generating very long time intervals.

In this post we see how two different modes of ICs are coupled together to form a long duration timer circuit.

Simulation and Working

Referring to the circuit diagram.

  1. 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.

  2. The output from pin 3 produces the longest time interval and therefore we select this output for feeding the next stage.

  3. The pot P1 and the capacitor C1 of IC1 can be used for adjusting the time span at it pin 3.

  4. The higher the setting of the above components the longer the period at pin #3.

  5. 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.

  6. 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.

  7. 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.

  8. As long as the counting progresses, pin #11 of IC2 remains at logic low, such that the relay driver is held switched OFF.

  9. 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.

  10. 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.

simple Long Duration Timer using IC 4017 and IC 4060

Parts List

R1, R3 = 1M
R2, R4 = 12K,
C1, C2 = 1uF/25V,
D1, D2 = 1N4007,
IC1 = 4060,
IC2 = 4017,
T1 = BC547,
POT = 1M linear

PCB Layout

Long Duration timer PCB layout

Need Help? Please leave a comment, I'll get back soon with a reply!


  1. You can alter the timing by increasing or decreasing the value C1 and the 1M pot.

    Connect more number of 1u parallel to C1 and adjust the 1M pot by some trial and error for geting the desired timing.

    Alternatively the formula for timing may be seen here:

    pin11 4017 is the output. pin3 of 4060 will blink but at the rate of minutes as per the setting of the above timing parts.

    pin7 of 4060 will blink faster, which indicates the timer is working corectly.

  2. The relay should be 12V, the supply voltage should be 12V and the transistor any NPN type general purpose.

    You can connect LEDs with series 1K resistor across pin7 and ground of IC4060 and same for IC 4017 at its pin11.

    The LEDs will provide the appropriate indications regarding the working of the circuit.

  3. Hi Swagatam,

    How could I alter this circuit to delay 1Hr OFF to ON, 1Second of being ON then OFF, and continue to cycle continuously (1hr OFF 1sec ON)?

    Thanks for your help. Your a legend!

  4. Hi Jason,

    Thanks! You can try the following circuit, it will suit your need well:

  5. Hai, I want the relay to activate for 15 hours and de-activate for 9 hours. so wat are the changes I have to made in the above circuit?? Pls help...

  6. Hi, you will need to build the following circuit for achieving it, not the above one:

  7. so, if I want the relay to activated for 9 hrs means i have to set 54 minutes in the IC1 with the help of POT P1. So by rotating the P1 knob, how I can able to know that i adjusted the knob for 54 mins??
    And u said me to connect the clock's alarm output positive trigger to pin12 of IC4060 via a 1uF capacitor. but the +12v dc is already connected at the junction of pin12 of IC1, pin15 of IC2 via 1uf capacitor. so if I connect the alarm output at this junction means will the relay get active at the alarm time??

  8. you will have set the pot appropriately or opt for a fixed resistor in that place through some experimentation.

    First try any arbitrarily chosen small value resistor, note after how many seconds pin3 of 4060 becomes high. After you get the value you can calculate the 54 minute resistor accordingly by cross multiplication:

    selected resistor/R = "x"seconds/54 x 60

    where R is the unknown resistor, x seconds is the noted timing, the selected small value resistor could be 10K (use only one resistor)

  9. ....yes the alarm output should be connected to pin12 of 4060 via a 1uF capacitor, this reset the whole action and itiate the timing from zero.

    Relay will get activated if a PNP transistor is used at pin11 of 4017

  10. ok. will a ordinary analog or digital table clock which is running on 1.5v battery work with the above circuit for my requirement??

  11. No, the trigger will require at least 5V at pin12.

    however the input could be amplified using a BC547 transistor, whose emitter could be used for triggering pin12 of 4060, collector could be connected to the IC supply, base to clock trigger via a 10k resistor.

  12. i made a diagram as u said. pls check it whether it is correct...
    I placed a 10k resistor next to 1k for calculatig time. is that correct??
    And u told me use a PNP transistor at pin11 of 4017 to activate the relay at alarm timing. so do i need to replace that BC547 with BC557??

  13. BC547 collector should join with positive and the emitter to the 1uF capacitor...

    If you are using a fixed timing resistor at pin2 then only one resistor should be included to make the calculations easier, if two are used then use the sum of both in the calculations.

  14. .....also connect a 100k resistor across emitter of BC547 and ground so that the capacitor can discharge for the repeat cycles.

  15. pin2 !!!?? u mean pin10, right??
    And i did modification as u said. pls check it...
    Thn u said "Relay will get activated if a PNP transistor is used at pin11 of 4017". sry, i didnt understand that. pls explain that...

  16. pin2 was in response to the PIR circuit not this one, when you said the 555 was get hot.

    the diagram is correct now.

    Yes use BC557 instead of BC547

    Initiate (switch ON) the circuit exactly at the time when you want the clock to trigger, this will reset the timer to start, the relay will switch ON, and the circuit will start counting for the desired 10 hour period. After this you can leave the circuit for automatic operations everyday.

  17. I remove IC# 2 and P1, and it work well,.. but replacing R2 with 2M ohms, it activates relay after 3 hours, but never deactivate,..

  18. remove D1 for getting an alternate 3 hour ON, 3 hour OFF switching from the circuit

  19. Hello sir, please i need a circuit to turn off a relay after 14 or 15 hours ... Thanks.

  20. Hello Amir, you can use the above circuit for the application, use a BC557 instead of the shown BC547 and connect the relay across its collector and ground.

  21. Swag...

    It'd be neat if you devised a circuit that could:

    1. Detect Darkness
    2. Wait an adjustable amount of time, say 1-3 hours
    3. energize a light, or relay
    4. Stay on for an adjustable amount of time 3-8 hrs

    That'd be a huge improvement over typical solar garden lights, as they typicall come on too early, and stay on too long.


  22. Hi Unknown , I'll try to design it and post it in this blog soon.

  23. Hi sir i need ur help on the circuit i have constructed as per the above diagram but i coudnt get response or out put ...

  24. Hi Subramania, the output will be activated only after the set time has can connect an LED at pin3/ground via a 1K resistor of the IC4017..this LED will light up at switch ON and will shut off after some time indicating that the time period is sequencing. or you can connect such LEDs across all the outputs of the IC4017 for a clearer view and confirmation about how the time period may be proceeding.

  25. Hi!
    Can I use 555 monostable circuit for charging my battery for about one hour.i think that it will be not much accurate I don't want it to be much accurate but just wanted to charge my battery for about one hour and then the relay shut off the charger.

  26. hi, yes you may do it if you know the approximate time the battery would take to get charged optimally...

  27. Sir, i want to use the ckt for automatic ON/OFF air cooler 240V, 11-18A . How can i do it ? is
    step up of relay out put required ?

  28. Abhijit, you can use the above circuit for your purpose, the relay contacts will need to be wired with AC220V and the air cooler socket.....just disconnect the mains wire connected with any one of the socket terminals and connect it to the relay pole, connect another wire from the N/O contact of the relay and join it back at this socket terminal.

  29. sir, i want to know time duration formula of this timer ckt.plz help me.

  30. you can find it here:

    C will be in Farads

  31. Dearest Swagatam,

    So this circuit will work with 5v at input, and deliver 5v to the relay, so that I can use a homemade SSR? I'd like to use it to turn off my basement lights a few hours after they are turned on. No one ever remembers to turn them off, and I find them still burning days or weeks later. That is not acceptable, and yet PIR switches are unacceptable for this purpose, because the area is so huge...

  32. Dearest Tom, yes definitely you can use it for the intended purpose, however an SSR could be unnecessarily costly, instead you can try the second circuit from the following link, which looks much cheaper and yet effective:

  33. Hi swagatam sir.I want a timer which should off for 2 seconds in 24 hours and drive relay with can i achieve this with the above circuit.

  34. Dear i need a diagram timer for 45minute on and 45m 0ff and so on

  35. Dear swagatam how can i change it to 30minute ON 30mn OFF and so on

  36. Hi Kishore, you can try the above shown circuit, just add a 100uF capacitor in series with the transistor base, and tune the 4060 IC to produce a 1.2 hour time pulse

  37. use the above circuit without the 4017 IC...connect the transistor relay driver directly with the pin#3 of 4060 and tune the IC to produce 30 minute frequency or 45 min...

  38. Swagatam, another great circuit, follow a lot of yours.
    I have 2 questions, what's the current draw of the circuit? I suspect it's extremely low since its only a timer.
    2Nd. I want the timer to control my solar panels because the way the sun comes around my house I have to keep moving my panel from 2 spots the relay would need to support 37v Min, and 8amps Min also needs to switch every 6 hours a timer is my only option as one panel gets full sun from 6am till 12pm then the other from 12pm till 5:30pm however I can't be at home to move it haha but I can't run one panel in each spot together as it's to much for my controller so a timer would be good to switch one panel on at a time

  39. Thank you unknown,

    however a timer is not what may be appropriate for your purpose.

    Sorry I could not correctly understand why you cannot connect both the panels in parallel and use it with the existing controller.....??

    If you are thinking that your controller would burn then that's not correct, as long as the specs of both the panels are similar.

    It's the connected output load that matters, not the input wattage, if the output load exceeds above the controller's handling limit in such a case there could be a danger to the controller, having said that today all controllers have built-in overload protection so under any circumstances the device is never at a risk of burning.

    So I think you should connect the panels in parallel and enjoy maximum power from them, and in fact prevent unnecessary wastage of energy:)

  40. Yes that's correct my mppt controller supports 260w at 12v 20amps output, my panel is 250w the controller also supports up to 150v voc input. It does have a cut out when the power exceededs it's limit then connects back once panels fall back under, I just thought I wouldn't want to risk it for the price of the controller I paid I wanted to be safe then sorry.
    I do also have my panels the same specs and brand so they don't pull each other down and config issues. I think it would be okay since panel on the side in the mornings on a nice sunny clear day only produces 3amps max since its not direct sunlight. However I have seen it peak to 19.5amps if both did that it would be a massive 40amp on the output and 16amp on the input for a 20amp controller?

  41. The input current will not harm your controller as long as the following two things are maintained, as per the specs of the controller:

    1) Don't allow the connected output loads to exceed 250 watts, and
    2) Don't allow the input voltage from the panel to exceed 150V.

    If the above two criteria are maintained there's no way your controller could get damaged.

  42. There's only about 60v max voltage going into the controller.
    It's connected directly to a battery bank which is fused, but there's a 600w inverter connected to the battery bank? Are you saying I can't exceed my inverter past 250w?

  43. OK so if the inverter is linked with your battery, it would be the battery which would supply the power to the inverter, not the controller, so the 250 watt load issue is not related with the charger controller rather the battery

    The controller would be only associated with the charging current which I assume would constitute much less than the 250 watt under any circumstances your controller appears to be safe and sound, therefore combining the two panels together is perfectly advisable.

  44. Thanks swagatam it's working great, currently we are in summer over here in Australia sun rises at about 5:30am I get 16-18amps from then till 6pm I have however had it jump to 20amps :/ both panels got sun for a bit then it went cloudy and blocked one panel dropped to about 10amps I've yet to experience the controller to cut out and see how it handles over current, don't want it to constantly be cutting out because it hits past 20amps output, or is this not how mppt works? Does it just waste the extra current to heat?
    Sorry to go way off topic from your circuit, but is it possible to have 2 separate pv arrays 2 separate controllers (1 for each array) 2 separate battery banks (1 for each again) but one inverter both banks parallel to the inverter? It will be a 24v set-up.

  45. Thanks Anton, I am glad to know this.

    An MPPT will never waste anything through dissipation, however if it gets an input beyond its rated specs then it will simply block the excess power...which is I think as good as wasting power.

    So if you want to take the maximum advantage of the available resources then either you can go for an upgraded or higher rated use separate devices for the two panels, as you have already planned to do.

    Using two separate controllers and batteries for the two panels will not harm anything, just increase the set up cost, you can surely go ahead with it, no issues.

  46. Thanks for all the info, I'm still deciding on 2 separate controllers or one single big one the maximum amp controller I've seen is 40A which is why I'd probably need 2 so the batteries charge up within the time of the sun being out.

    As for my 20A controller I've got 2 panels connected for 12v a 235w panel and a 250w panel as you said it will only use what it needs and I can now see that because when the batteries are nearly charged the amps drop to only a few amps but if I put a load on, the amps go up. Having the panels in parallel seem to be better than series as they tend to drag each other down a bit having 66vmp and 8.1imp the controller doesn't hit 20amps whereas in parallel it will sit at 20amps with 8imp and 33vmp each panel it can utilise all the current from both panels then convert some voltage to make it to 20amps.

    Do you think it's possible to earth an inverter that has live and neutral-live? Is there a way? I will eventually get an inverter that has 0v neutral but at the moment my 600w inverter is doing good, just want to leave it in permanent with earth protection but it has no neutral as both wires will give you a zap.

  47. Thanks for updating your progress!
    yes connecting the panels in parallel would give better results, especially if the controller is an MPPT type so please make sure it is an MPPT if you happen to buy a new one.

    Your present inverter output should not be associated with an "earth" connection in any manner otherwise that would result in a short circuit or heavy power losses....not recommended unless it has a neutral specified with a permanent 0V

  48. Yes I only buy mppt controllers, they are the best.
    Would any electronic device turn this wire into a neutral maybe like an isolation transformer? Or no point?
    Not to mention if it was tied to earth any device with a metal chassis will be live. I would like to put a rcd on the ac side but there would be no point because there's no earth I want to protect against a malfunction that could cause a shock or is there no need? It's only a 600w inverter.

  49. Instead of worrying about the inverter earthing, it would be easier to "earth" the appliances in case of a leakage the appliances would produce no shock, as we normally implement in our homes.

  50. Yeah the appliances are earthed I don't have the earth going to the chassis of the inverter though it just goes into my switchboard then down to an earth rod in the ground. Should I also allow the metal chassis of the inverter to be connected to earth or will this cause an issue if the inverter ends up 'live' to the case it will send it to all the appliances?

    Sorry for all the questions and going off topic.

  51. I think it would be better to keep the inverter away from the house earthing, because anyway it's not so crucial to earth the inverter as long as the appliances are earthed

  52. can i get 30 minutes Auto On and Off from this circuit

  53. for 30 min ON/OFF the 4017 may not be can achieve it with the 4060 stage itself...connect the relay driver with the pin#3 of the IC 4060 for the required delays by adjusting the pot accordingly

  54. Hi Swagatam,

    I'm looking at building a circuit the has 2 timers.
    - 1 switches on for 12 hours and off for the remaining 12 hours.
    - the other switches on for 15 minutes and off for 45 minutes.

    can it be done with power source 12VDC?
    I'm a newbie. don't know much about electronics. I used an arduino to do this but I'm looking at a much cheaper option.

  55. Hi CJ, you can build two of the following circuits and adjust their controls accordingly for the results:

    However If you are a newcomer then you may find it difficult to build it successfully

  56. Hello sir..
    I m making a solar street light and i want that when our lights is switched on, and after about 4 to 5 hours it will dim the light automatically..
    Plz help me to make that type of circuit

  57. Hello Harjinder, you can connect a 4060 timer stage in between the light and the solar circuit through which you can set the required switch OFF delays.

    If possible I'll try to present it in my website soon.

  58. Good afternoone Sir!
    I want to use this timer circuit for my solar street light in two ways:-1st )for 24v and 2nd)36v.
    which types of relaies must I use and which parts to be changed?

    Secondly,Do you have a circuit which can 1st Detects a Darkness then after an adjustable time
    give a light for some hours and at the end go to OFF position?


  59. Good day Beni,

    I think you should try the following concept:

    here you just have to remove the entire PIR section, connect an LDR across R6 and 7805 positive, and connect a 1M across R6 and ground, and use only the pin#3 relay driver section.
    once you implement will be able to precisely achieve what you are looking for...

  60. Dear Swagatham,
    can you please modify this circit as follows
    I have a 12hr mode Quarts clock with needles. My idea is to fix 12 LED's at each hour positions. One LED should lit at a time. Eg, if time is 3'O Clock, third LED should glow. After 1hr 4th LED should lit. This process continues.
    By this arrangement, it is easy to understand the time at night by the LED position.

    I know, CD4017 have only 10 otputs, I think, two CD4017 can be cascaded to obtain 12 outputs. If yes, design that way, otherwise, use any different IC have 12 outputs.

  61. Dear Anil, you can do it the following way:

    connect the pin13 of the first IC 4017 with its own pin11, which is last or the 10th output.

    connect this junction with the base of a BC547 through a 1K resistor, connect the collector with pin#8 of the second 4017 IC. connect emitter with ground.

    finally connect the pin#7 of the second 4017 with pin#15 of the first through a 1K resistor, remember you must disconnect the pin#15 of the first IC 4017 from ground before doing this.

    also make sure to connect a 0.47uF capacitor positive to Pin#15 of the first IC.

    Pi#15 of the second IC can be connected with ground, but remember to connect pin#14 of both the ICs together.

  62. Good evening. Pls I need a circuit that can switch between 3loads with 4 hours intervals

  63. you can use the same circuit as shown in the above article, with the following modifications:

    use 2, 4, 7 as the outputs for the loads, and connect pin#10 with D1 anode....ignore pin#11 keep it unconnected.
    set pin#3 of IC 4060 for 3 hour clocks

  64. Thanks admin! Pls am using Proteus on my PC before but I mistakenly uninstall it and I was unable to install it back......

  65. sorry I do not have any solution to that problem!!

  66. Thanks for your response at admin...

  67. Hi, Admin,
    I need 3 kinds of circuit which is for the paddy field pest control light(LED) up to 40LED which can be run on 9V battery or 6v AA battery.
    Conditions are below.
    1) Switch on the unit(40led light run with 9V or 6v battery) and it should off 2hrs 30min to 3hrs.
    2) Auto switch on when out door light dims then Auto off after 2hrs 30min to 3hrs.
    3) sl no 2 with solar charger..

  68. Purushottaman,

    you can try the last circuit presented in the following article

    You will need to use 12V AAA battery, by connecting 8 AAA 1.5V cells in series, connect 2 such series in parallel...16 AAA cells in all

  69. thanks sir,,,

  70. Hi. Swag
    a question.
    is it posible to make this timer a repeat timer ?????.
    i have some repeat timers from Rons website but they are not working as they should work.
    after 2 runs they stop working even with the resistor between the pins 8 and 16.
    i have desided that i wil make my light instalation for my aquarium with timers and fading leds so the effect wil be almost the same as we spoke earlier.
    i hope that you can help me out here.
    the lost of voltage with the dimmer is solved.
    as you say simply the collectors direct at the positive and the leds on the emiters.
    other posibility is to use a second power supply and put the collectors on that one with a little higher voltage.

    it was verry helpfull what you told me and i dig a little more in to it and try to understand the matery better than i did at that time.

    hope to hear from you soon .

    Johan. the dutchman

  71. Hi Johan,

    In the above circuit you can make it work as a recycling timer, simply by removing the entire D1 link, and the ON/OFF ratio can be also modified by changing the T1/R4 connection configuration with the IC output pinouts.

    for your question regarding the LED location in emitter side and raising the collector voltage, I am sorry that will not help because the emitter voltage will be always less by 0.6V than the base voltage value, no matter what voltage you try on the collector side...therefore the emitter LEDs will follow the base voltage regardless of the collector voltage.

  72. Is the C1 & C2 are electrolytic capacitor. If so what about polarity?

  73. Thanks for your quick reply

  74. Sir,I want to make 2hrs on time and 2hrs off time repeatedly working timer circuit can you help me giving daigram

  75. Hi Vipul, you can select any 4060 IC based timer circuit and get the required output, a example circuit is shown below

  76. I am getting it but not fully, what about other pins of second ic4017

  77. How many Ic4017 will be needed to give 3months. Thanks so much Swagatam.

  78. No change with the other pins, they will connect exactly same as the first 4017, except the feedback diode which will always connect across pin#11 of 4060 and the pin#11 of the last 4017 in the line.

  79. that will depend on what delay you select for the IC 4060 pin#3.

  80. Please sir, I need a timer that comes on for 10mins and off for 1hr. Thanks

    1. you can customize the above circuit accordingly, or you can try the concept explained in the following link:

  81. The comment section of how to make a programmable timer is not responding. Thanks sir

    1. Yes I am aware of that, it is a template problem, and the template maker is clueless about it. I informed it to the theme maker but got no reply from him.

  82. Thanks so much innovator. Please how can I customise the above circuit for 10mins on ,1 hr off.

  83. For now, please permit me to comment here in respect to "to make programmable timer" page.

    How can I customise this timer to come on 11am, off 2:30pm on again 11am, continuously.

    1. You can do it in this way.

      Referring to the post:

      First build only the upper 4060 stage, next put any random value resistor such as 100k in place of P1/R2. Use any random capacitor such as 0.22uF or 0.33uF for C1. switch ON power and check after how many seconds or minutes the green LED comes ON or the relay clicks. Note down the this will correspond to the delay cycle for the selected R/C network. Using cross multiplication you can then figure out the RC required for your 10mins and 1 hour respectively. 10 minutes setting will be for the upper timer, 1 hour for the lower timer.

  84. I appreciate your great articulation and efficiency. Well done sir
    Referring to the post:

    How can I customise this timer to come on 11am, off 2:30pm on again 11am, continuously.

  85. Thank you, you can do it by using 1M pot for P1 for the upper timer, and 10uF capacitor for C1. This 10uF should be built by using 10nos of 1uF non polar capacitors in parallel.

    for the lower timer you can use 1uF for C1, and 1M pot for P1.


Post a Comment