Decade chaser
A 555 astable clocks a CD4017 decade counter and ten LEDs take turns to light, with no microcontroller. There is no microcontroller in it: the simulator solves the 15 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.
Teaching? Assign it to your class in one click.
Intermediate About 25 minutes to build and run. Runs in your browser. Free, and no account needed.
The parts retail for about $6.85. On Mokxi they're free.
What you'll learn
- A 555 astable as a clock source
- How a decade counter steps one output at a time
- Why the LED wires cross: outputs are not in pin order
- How the RC values set the blink speed
- Difficulty: Intermediate
- Time: About 25 minutes
- Parts: 17
How it works
The 555 timer is an astable clock. A capacitor charges through two resistors and discharges through one, so the output flips about four times a second.
Each rising edge from the clock tells the CD4017 to move its one high output along: Q0, Q1, Q2, up to Q9, then back to Q0. Whichever output is high lights its LED, so one light appears to run along the row.
The LEDs have no resistors. The CD4017 outputs cannot push much current, so the chip limits it itself.
Parts list
17 parts, plus the jumper wires. They retail for about $6.85; on Mokxi they're free.
- 1 × Full-size breadboard
- 1 × Power, 5 V
- 1 × NE555 timer
- 1 × Resistor, 10k ΩIn Starter Kit, Claw Machine Kit, Halloween Prop Kit.
- 1 × Resistor, 33k ΩIn Starter Kit, Claw Machine Kit, Halloween Prop Kit.
- 1 × Capacitor, 4.7 µFIn Power Bank Kit.
- 1 × CD4017 decade counter
- 1 × LED, greenIn Starter Kit, Halloween Prop Kit, Logic Lab Kit.
- 9 × LED, redIn Starter Kit, Halloween Prop Kit, Logic Lab Kit.
Wiring table
Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.
| Part and pin | Connects to |
|---|---|
| NE555 timer pin RESET | 5 V |
| NE555 timer pin VCC | 5 V |
| Resistor, 10k Ω pin 1 | 5 V |
| CD4017 decade counter pin VDD | 5 V |
| NE555 timer pin GND | Ground |
| Capacitor, 4.7 µF pin 2 | Ground |
| CD4017 decade counter pin VSS | Ground |
| CD4017 decade counter pin INH | Ground |
| CD4017 decade counter pin RST | Ground |
| LED, green pin C | Ground |
| LED, red (1) pin C | Ground |
| LED, red (2) pin C | Ground |
| LED, red (3) pin C | Ground |
| LED, red (4) pin C | Ground |
| LED, red (5) pin C | Ground |
| LED, red (6) pin C | Ground |
| LED, red (7) pin C | Ground |
| LED, red (8) pin C | Ground |
| LED, red (9) pin C | Ground |
| NE555 timer pin THR | NE555 timer pin TRIG |
| Resistor, 33k Ω pin 2 | NE555 timer pin TRIG |
| Capacitor, 4.7 µF pin 1 | NE555 timer pin TRIG |
| CD4017 decade counter pin CLK | NE555 timer pin OUT |
| Resistor, 10k Ω pin 2 | NE555 timer pin DIS |
| Resistor, 33k Ω pin 1 | NE555 timer pin DIS |
| LED, red (5) pin A | CD4017 decade counter pin Q5 |
| LED, red (1) pin A | CD4017 decade counter pin Q1 |
| LED, green pin A | CD4017 decade counter pin Q0 |
| LED, red (2) pin A | CD4017 decade counter pin Q2 |
| LED, red (6) pin A | CD4017 decade counter pin Q6 |
| LED, red (7) pin A | CD4017 decade counter pin Q7 |
| LED, red (3) pin A | CD4017 decade counter pin Q3 |
| LED, red (8) pin A | CD4017 decade counter pin Q8 |
| LED, red (4) pin A | CD4017 decade counter pin Q4 |
| LED, red (9) pin A | CD4017 decade counter pin Q9 |
The notes that come with it
There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.
// A 4017 LED chaser: a 555 clock and a decade counter. No code.
//
// The 555 on the left is an astable: the capacitor charges through RA and RB
// and discharges through RB, over and over, and OUT is a square wave at
//
// f = 1.44 / ((RA + 2 x RB) x C) = 1.44 / (76k x 4.7 uF) = about 4 Hz
//
// Every rising edge on the 4017's CLK moves the one high output along: Q0,
// Q1, Q2 ... Q9 and round again. The outputs are not in order around the chip
// (pin 1 is Q5, pin 3 is Q0), which is why the wires to the LEDs cross.
//
// The LEDs have no resistors. A CD4017 output can only push a few milliamps
// (it is a 500 ohm switch at 5 V), so it limits the current itself. Change
// the capacitor in the properties panel to speed the chase up or slow it down.
//
// Things to try: wire Q5 to RST instead of grounding RST, and it counts to
// five and starts again.
Troubleshooting
The usual mistakes with this circuit, and the fix for each.
- The lights run in a jumbled order This project
Each LED must go to its own output. Q0 is pin 3 and Q5 is pin 1, so follow the output names, not the pin numbers. - The chase is too fast or too slow This project
Change the capacitor value. A bigger capacitor slows the clock, a smaller one speeds it up. - Nothing moves This project
Check that RST and INH go to ground. If either is high the counter holds or resets. - The output does nothing or stays high. NE555 timer
Pin 8 goes to the supply, pin 1 to ground, and RESET (pin 4) must be tied high. Floating reset is the most common mistake. - The frequency is unstable or wrong. NE555 timer
Tie pin 5 to ground through a 10 nF capacitor. In astable mode f is about 1.44 divided by (R1 + 2 x R2) x C. Watch the polarity of electrolytic caps. - The LED is dim, burns out, or the pin reads wrong because the resistor value is off. Resistor
Read the color bands again. A 220 ohm to 330 ohm resistor suits a typical LED on 5 V. 10k is a common pull-up or pull-down value. Check with a multimeter if unsure. - A pull-up or pull-down resistor is missing, so the input floats and reads random values. Resistor
Tie the input to 5 V or ground through about 10k. Or use INPUT_PULLUP and wire the switch to ground. - An electrolytic capacitor heats up, bulges or pops. Capacitor
Electrolytics have a polarity. The stripe marks the negative leg, which goes toward ground. Also keep the voltage under the rated value, such as 10 V or 16 V.
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.