Let’s build a DIY adjustable 9-hour timer circuit using crystal quartz and traditional digital integrated circuits. It can be a fun project to work on in your spare time or to use up old integrated circuits you have lying around.

In this article, we’ll explore the process of creating a DIY timer circuit using basic digital components, such as the CD4060, CD4020, and CD4013, among others. We’ll also add some basic functions such as a power-saving clock, an automatic switch-off alarm, and programmable timer durations from less than an hour to 9 hours.
How This Project Came to Be
We — and by we, I mean me, the one writing this — always set a 7-ish-hour timer on a phone before sleeping. It’s not ideal, but at least I can ensure that I’ll get adequate sleep hours regardless of the time of day I go to sleep.
The problem is that getting on the phone just to set a timer could, unsurprisingly, push the sleep hours further out because of the many distractions. Furthermore, having a charging mobile phone right next to your head might not be the best practice.
Anyway, that’s basically what sparked this fun, longish-duration timer DIY project. Moreover, it’s also a great opportunity to put many of the old digital ICs in our storage to good use.
Even so, we must acknowledge that our DIY solution won’t be as convenient or hassle-free as any of the run-of-the-mill store-bought timers. Without further ado, let’s begin.
Goals Of This Project
First things first, let’s create a list of objectives or goals we want from this project, basically, what this timer circuit is going to do for us. This info will help us understand the basic scope of this project.
- It must be a timer circuit that can count up to 9 hours with enough accuracy for everyday use.
- It needs an audible alarm system similar to an alarm clock.
- It should have a way to reprogram or adjust the timer duration (doesn’t necessarily need to be convenient; jumper wires or DIP switches will do).
- It can only have basic digital ICs and no microcontroller (MCU) or specialized integrated circuits.
- It should be fairly power-efficient, at least for a circuit with multiple old-school ICs.
These objectives are not based on any strict rules; some of them are definitely flexible. For example, if we don’t have certain components for the task, we could go with substitutes with different functions.
However, the general ideas stand: We want a DIY solution for a relatively accurate timer circuit that can count up to 9 hours.
Now that we’ve worked out the function of our timer circuit, let’s put together a functional block diagram based on that information.
Functional Block Diagram
The block diagrams below will help us figure out the components or parts required for this circuit. The diagram isn’t entirely accurate; some details still need to be worked out. But it at least gives us a rough idea of how the circuit should work.

It may look complicated, but looks can be deceiving. We can roughly divide the circuit into two main parts (excluding the power supply stuff for now), which are the Timer Part and the Alarm Part. Let’s do a quick run-through from top to bottom, starting with the timer part.
🕑 The Timer Part
The timer part of the circuit deals with timing and counting. What it does is count for a certain set duration, then output a signal when it finishes counting.
Timer Start/Stop — this block represents switches, two switches to be exact, an On switch and an Off switch. The switches are regular SPST normally-off pushbutton switches, and their functions are:
- The On switch starts the timer when pressed (no function if the timer is already running).
- The Off switch stops the currently running timer (no function if no timer is running).
Timer Controller — this is where the on/off signal from the switches comes to. It controls the two timer components (oscillator and counter) based on the signal coming from the switches.
It also receives a feedback signal from the matcher to a stop oscillator when the timer is finished (power-saving clock). This function ensures that the oscillator stops after the alarm, thereby saving energy.
Oscillator — this is one of the two main timer components, the other being the counter. It generates the main clock signal that will be counted by the counter later. Also, it’s directly controlled by the timer controller (turns it on or off). The oscillator consists of two parts: a crystal oscillator and dividers.

The crystal oscillator generates a stable high-frequency clock signal at 32,768Hz. This high-frequency signal then gets divided down by the dividers to 0.5Hz. The 0.5Hz is actually what’s being sent to and counted by the counter (we’ll discuss why 0.5Hz later).
Counter — this is another part of the timer circuit. As its name suggests, it counts the incoming clock signal from the oscillator. Just like the oscillator, it’s also being controlled by the timer controller.
Detector/Matcher — this is the component that detects when the counter has reached a certain count. We’ll talk about how it detects (or matches) the counter outputs later. Unsurprisingly, this is also where we will program the duration for the timer.
When the timer finishes, it sends a signal to the alarm time delay, which then starts the alarm. Simultaneously, it would send a signal to the timer controller, telling it to stop the timer (oscillator and counter) to conserve energy.
🔔 The Alarm Part
The alarm part concerned the alarm circuit; it’s a way for the timer to remind us that the counting is finished. It receives a trigger signal from the timer when the time is up, then it sets off an alarm letting us know.
Alarm Time Delay — this part acts as a controller for the actual alarm. When the alarm time delay receives the trigger signal from the matcher, which tells it that the counting finished, the timer delay starts the alarm.
However, since it’s a time delay circuit, it will stop the alarm after a certain delay duration. We’ll figure out the delay duration when designing the circuit. Without the time delay circuit, if nobody presses the alarm dismiss button, the alarm will just remain on forever, wasting the battery’s energy.
Alarm — this part is the load of the previously mentioned time delay. It’s the part that will tell us the timer is finished. We planned to use a buzzer for this part, maybe with a simple melody, but you could use anything, really.
Alarm Dismiss — this is a regular SPST button, just like the timer start/stop buttons from earlier. Its function will have nothing to do with the timer circuit; instead, it will stop the alarm (dismiss/wake). To be more specific, it will force reset the time delay circuit, thereby silencing the alarm.
The Completed 9+ Hours Timer Circuit
The schematic below shows the complete 9-hour timer circuit (currently set for 7.2 hours). There are a couple more additions to the circuit, so let’s go over those first.

- We add the power supply to both circuits in the form of a 9V battery. It’s for convenience when testing the circuit. For a real-world power source, we’ll have to measure the power consumption and determine what’s best for the circuit.
However, given that this circuit only contains CMOS chips and the 555, it can operate safely within voltage ranges of 5V to 15V. We can use a different voltage source as long as it’s within that range. - Right by the battery, there are also a couple of filter capacitors, C5 and C6. They filter the current from the power source, helping the circuit run more stably.
- Lastly, we add an indicator LED (LED2) to the 1Hz signal (CD4013’s pin 1). It will blink when the counter is counting. Of course, we can’t forget the current-limiting resistor, R11.
We didn’t add a power switch to the circuit, however. It’s because the circuit already has a power-saving clock function, which prevents the main components from running when they don’t need to.
Anyhow, you can add the power switch if you like. Additionally, note that when first powering on the circuit (same as when first adding the battery), the timer or alarm may start running immediately. In that case, we just press the reset button.
Programming the Timer using Binary
To set the timer, we need to convert the decimal number of the time (in seconds) to a base-2 binary one. There are many tools online to help you do so; you can look up “decimal to base-2” on Google, or you could do the math yourself if you fancy.
For example, if we want to set a 2-hour timer, here’s what we need to do. First, convert hours into seconds.
$$2\text{ hours}\times60\times60=7,200\text{ seconds}$$
Next, convert the seconds (base-10) number into binary (base-2).
$$7,200_{10} = 1110000100000_{2}$$
Then, take note of the nth bits with a value of “1”; in this case, they’re the 5th, 10th, 11th, and 12th bits (start at the right, where the rightmost bit is the 0th). Remember that each bit (digit) here corresponds to our counter’s Q number output (nth bit = Qn).
This means that we need to connect Q5, Q10, Q11, and Q12 to the AND gate inputs (CD4082) to match them. The AND gate will detect whether the current count has reached 7,200 seconds (2 hours); it will output “1” when all the Q outputs match “1”.
If we want to be absolutely certain that we have the correct timer duration, we can add up the decimal values of the Q outputs matched by the AND gate. If it matches the number of seconds we started with, then it’s correct.
$$2^5+2^{10}+2^{11}+2^{12}=32+1024+2048+4096=7200$$
That’s rather neat, isn’t it?
How to Use this Timer Circuit
First, we set the timer duration by connecting specific CD4020 outputs to the CD4082 inputs (see above).
Secondly, turn on the circuit (connecting the battery). If LED2 starts off blinking, press S2 to stop it. If the buzzer starts buzzing, pressing S3 will stop it.
Thirdly, when you want to start the timer, press S1 (LED2 should blink afterward). To stop the timer before the alarm goes off, press S2.
Lastly, BZ1 will ring when the timer finishes. Press S2 to stop the buzzer immediately, or wait around 5 minutes, and it will stop on its own.
Testing the Circuit on the Breadboard
We’ve also done some test runs with the circuit assembled on the breadboard. We set our timer to a few different timer durations and run it alongside a timer app on a mobile phone. The results are very satisfactory; our DIY timer is pretty much on par with the digital counterpart in terms of accuracy.

These test run results are excellent thus far. However, how long can the timer last off a fully charged 9V battery? To find that out, we need to take the total current consumption of the circuit, both when it’s running and when it’s not. The results were:
- 20mA when the timer is on hold (oscillator and counter stop).
- 25mA when the timer is running (oscillator and counter working)
- 40mA when the buzzer is working (oscillator and counter stop).
For context, a regular 9V battery should have 0.5Ah, or 500mAh, of electrical capacity. Since this circuit consumes in excess of 20mA, a 9V battery alone isn’t going to be a viable choice.
It’s true that these CMOS chips are relatively power-efficient. However, compared to more modern MCUs, they still consume significantly more energy, especially when six CMOS chips are required to complete the circuit.
In conclusion, if we want to deploy this circuit for an actual use, it’s better to power it mainly from a source such as a 5V USB and a regulator. We can also add a battery as a backup power source.
Conclusion
The circuit performs its job well enough; however, it’s certainly basic and rudimentary, lacking some nice-to-haves, such as timer progress estimation or easily adjustable duration (like a keypad or similar).
Furthermore, it also consumes a bunch of power and is rather bulky due to the multitude of ICs and the corresponding wiring. It’s a better fit for an educational or fun project than an actual circuit we could deploy.
Having said that, the circuit works well, and we get it to do everything we planned at the start. This project is — no doubt — a success. As for the missing features we mentioned earlier, we might do a second version with those in mind in the future.
Visit our Patreon page below to read more of this article, where we go into greater detail about each IC and their roles, along with some of the challenges and nuances we ran into along the way.
👉 Read the extended 9-Hour timer circuit article on Patreon
Exclusive posts on Patreon come free of advertisements and in PDF format with high-definition illustrations. Membership fees will allow us to continue to do what we do without as much reliance on advertisement. Thank you very much.
The full article will also be included in our next edition of the ebook (Vol. 5) when it comes out.
Hello. I’m Chayapol, but I could also go by Aot. I write and draw illustrations for ElecCircuit.com.
I usually cover articles related to digital electronics, logic, or basic principles or ideas on the site.