4017 Frustration

WBahn

Joined Mar 31, 2012
32,840
exactly...

keeping good dime using crystal is ok though it will still drift a bit. to completely get rid of drift one can use internet time or atomic time receiver.
atomic clock receivers are not expensive but are antenna is directional. and since every household has internet, that is why i proposed using controller with WiFi built in. an overkill but low cost and low parts count...
plus plenty of muscle to do anything fancy for special occasions like birthdays, New Year, whatever...(heartthrob, comet, party mode...)
Another alternative for very good and simple time keeping is to use the mains frequency. In large parts of the world, this is very tightly controlled. So as long as you are in a place where power outages are uncommon, you get atomic-clock long-term accuracy for almost no cost (the circuitry to get your timebase input is very simple). If you want black-out protect, then you can implement a battery-backup that uses a watch-crystal oscillator as a timebase. Put in a circuit to keep a rechargeable battery maintained and you have a nearly maintenance-free solution that keeps excellent time and works through even fairly prolonged outages with very little clock drift.
 

MrChips

Joined Oct 2, 2009
34,812
If you still want to use CD4017 10-bit counters to build a clock, the first step is to design a 12-bit ring counter using two CD4017 counters. The resistors shown are for limiting the output current and for controlling the brightness of the LEDs. Any value from 330 to 1000Ω is recommended. Use 0Ω at your own risk. (The resistor at U1-Q0 output must be higher than 330Ω and depends on the colour of the LED. Or use one of the AND gates to drive the LED.)

CD4017 12-bit ring counter.jpg

Here is how the circuit works.

U1 is clocked on the first ten clock pulses while both MR (reset) and CP1 (clock inhibit) are held low.
When U1-Q9 goes high, U1 stops counting and U2 starts counting. Thus, U2-Q1 goes high on the 10th clock input.

On the 13th clock input, U2-Q4 goes high, resetting U1 back to state-0. U1-Q0 goes high and resets U2 to state-0.
U2-Q4 is high for only 500 ns.
 

ThePanMan

Joined Mar 13, 2020
920
Since I've never built such a device I would have to imagine that having LED's chase around a clock face could become confusing at every 59 minutes. 12:00 would look almost the same as 12:59. The viewer would have to be cognizant of the nearness of the 59th LED to understand it's almost 1:00. (AM or PM) On another hand, if for the hours you had quarter hour indicators you'd have something that is more like an analog clock. The hour hand moves closer and closer to the 1:00 position on a mechanical clock. In order to somewhat simulate that I - personally - would have LED's that indicate the quarter hour as well. So that when the clock is approaching 1:00 the face would show 3/4 hours pass 12:00 plus the actual minute indicator.

I remember my first digital watch. It was mechanical. I was still in elementary school. Every morning I'd look at my watch. I had to be at school by 8:00 AM (IF memory serves). I'd look at my watch and see it was still in the 7 o'clock hour and think I still had time. It usually wasn't until the watch said 7:54 that I'd realize I was going to be late to school. Whereas an analog clock, which I was used to, I could see just how close to 8:00 it was and knew I had to leave. Introducing a clock face that can still look like 7:00 plus some number of minutes CAN become confusing. So to avoid that confusion I'd opt for the quarter hour indication. At 12:45 the clock would display 12 3/4 hours as well as the 45th LED being lit up. I'll draw a picture later. Right now I have to renew the registration on my 747. (that's what the wife calls her car - it's big).
 

MrChips

Joined Oct 2, 2009
34,812
I am anticipating that the clock design will consist of 12 LEDs for hours, 60 LEDs for minutes, and 60 LEDs for seconds.
The hours, minutes, and seconds will be discrete LEDs of three different colours.

The complete circuit is not difficult and I will show this later.
 

BobTPH

Joined Jun 5, 2013
11,515
I am anticipating that the clock design will consist of 12 LEDs for hours, 60 LEDs for minutes, and 60 LEDs for seconds.
The hours, minutes, and seconds will be discrete LEDs of three different colours.

The complete circuit is not difficult and I will show this later.
That is one possibility. I imagined 60 LEDs in a circle approximating the position of the hands on an analog clock. I.e, the hour could be between the 12 points that mark the hours.
 

Ian0

Joined Aug 7, 2020
13,132
That is one possibility. I imagined 60 LEDs in a circle approximating the position of the hands on an analog clock. I.e, the hour could be between the 12 points that mark the hours.
It has to advance every 12 minutes. That could be done by dividing by 6 with the first 4017, then dividing by 10 with the second for the minutes, then ORing outputs 0, 2, 4, 6 and 8 to provide the clock for the hours.
 

dl324

Joined Mar 30, 2015
18,328
I am anticipating that the clock design will consist of 12 LEDs for hours, 60 LEDs for minutes, and 60 LEDs for seconds.
He plans to use RGB LEDs. Has not yet said whether they're common anode or common cathode. I expect that to be a significant complication.
 

AnalogKid

Joined Aug 1, 2013
12,130
I was going to point out that because all of the outputs in #62 are mutually exclusive, you could reduce the number of LED resistors from 12 to 1. But . . .
Here is a revised solution to eliminate the output resistors.
Are you relying on the output stage p-channel transistor's channel resistance to limit the LED current?

ak
 

MrChips

Joined Oct 2, 2009
34,812
Let us look at the 60-second LED counter and display consisting of 60 LEDs arranged in a circle. The 60-minute counter is exactly the same as the 60-second counter and therefore will not be discussed.

For 60 LEDs, we create 6 groups or 10 LEDs. Only one LED is lit at any given time.
One CD4017 cycles from 1 to 10. A second CD4017 cycles from 1 to 6 and selects which group of 10 will be activated. The cycle repeats after 60 clock pulses.

The schematic shows only the first two decades. The next 4 decades repeat using outputs Q2 to Q5 of U2.
The output from U2-Q6 is used to clock the 60-minute counter.

CD4017 divide by 60 counter.jpg
 

Ian0

Joined Aug 7, 2020
13,132
Let us look at the 60-second LED counter and display consisting of 60 LEDs arranged in a circle. The 60-minute counter is exactly the same as the 60-second counter and therefore will not be discussed.

For 60 LEDs, we create 6 groups or 10 LEDs. Only one LED is lit at any given time.
One CD4017 cycles from 1 to 10. A second CD4017 cycles from 1 to 6 and selects which group of 10 will be activated. The cycle repeats after 60 clock pulses.

The schematic shows only the first two decades. The next 4 decades repeats using outputs Q2 to Q5 of U2.
The output from U2-Q6 is used to clock the 60-minute counter.

View attachment 367423
If you do it 6x10 instead of 10x6, it gives you a clock for the hours at once per 12 minutes.
 

MrChips

Joined Oct 2, 2009
34,812
I was going to point out that because all of the outputs in #62 are mutually exclusive, you could reduce the number of LED resistors from 12 to 1. But . . .


Are you relying on the output stage p-channel transistor's channel resistance to limit the LED current?

ak
Yes.
The measured current is 3.8 mA with red LED and 3.0 mA with blue LED.
 

MisterBill2

Joined Jan 23, 2018
27,522
PANMAN makes a very goodpoint in post#63!! A dozen short lines of 3, or a few more, LEDs at 5 minute spacings, a bit inside the minutes circle, would certainly meet my approval, although that would mean a much greater parts count. so quarter-hour indications will be much simpler.
An interesting and very original third option would be a ten segment ring, a bit inside the minutes ring, dividing the hour into six minute sections. Certainly that be a strong hit against " The Tyranny of Twelve". Some folks would appreciate it, others would be permanenetly confused. But it would certainly be unique. AND it would be a very simmple circuit to add-on.
 

ThePanMan

Joined Mar 13, 2020
920
Since I've never built such a device I would have to imagine that having LED's chase around a clock face could become confusing at every 59 minutes. 12:00 would look almost the same as 12:59. (edit - and so would every hour on the dial)
Following up on what I was saying about being confused once every hour I came up with these drawings. Look at them closely. The first two clocks represent 12:59 (one minute before 1:00) which looks suspiciously close to 12:00. And 1:00. The difference between both clocks is ONE minute. My proposal (second set of clocks) was to have 48 LED's around the hour circle (inside or out - I drew them outside). Every 15 minutes the hour LED progresses one position so that at 12:59 it looks more like it's almost 1:00. ((NOTE: I put the digital times in the middle to display the intended time. You don't need digital in the middle of analog. It's just there for clarity in my examples)) The shaded rectangles represent lit LED's.
Screenshot 2026-05-20 at 10.00.23 AM.pngScreenshot 2026-05-20 at 10.00.52 AM.png
Now look at the difference:
Screenshot 2026-05-20 at 10.00.42 AM.pngScreenshot 2026-05-20 at 10.01.09 AM.png
While both clocks clearly look like 1:00, the 12:59 clock looks far more like almost 1:00 than the first clock.
 
Last edited:

ThePanMan

Joined Mar 13, 2020
920
In fact, 12:59 looks suspiciously closer to 11:59 (AM or PM) on the first set of clocks. Using decade counters (or even octal counters) would be very complex wiring. A microcontroller would be the easier route as has been suggested.
 

ThePanMan

Joined Mar 13, 2020
920
Let us look at the 60-second LED counter and display consisting of 60 LEDs arranged in a circle. The 60-minute counter is exactly the same as the 60-second counter and therefore will not be discussed.

For 60 LEDs, we create 6 groups or 10 LEDs. Only one LED is lit at any given time.
One CD4017 cycles from 1 to 10. A second CD4017 cycles from 1 to 6 and selects which group of 10 will be activated. The cycle repeats after 60 clock pulses.

The schematic shows only the first two decades. The next 4 decades repeat using outputs Q2 to Q5 of U2.
The output from U2-Q6 is used to clock the 60-minute counter.

View attachment 367424
Why aren't you using the built in "Carry Out" pin to clock the next counter? That's how I've always done it.
 
Top