Level 6 · Logic · project 3 of 4 · 60 min · ●●●●○

The Four-Step Chaser

A 555 ticks five times a second and a CD4017 counter walks the light from LED to LED, round and round. Hold a button and the chase freezes.

new here? Start with First Light — one battery, one resistor, one LED. It teaches the loop, LED direction, and why the 220 Ω resistor matters.

You'll make four LEDs that chase each other round a loop
You'll learn a 555 clock and a counter that resets early
Watch for electrolytic capacitor polarity; both chips the right way round

What you need

🔧 Try before wiring →

you'll learn: Logic gates

Circuit map

The circuit you'll build, running on the Workbench right now.

simulating…

If it doesn't work

The boring ways this circuit actually breaks — check these first before you unwire everything.

  • One LED stays on and nothing moves. The counter isn't getting clock edges. Check the jumper from 555 pin 3 to 4017 pin 14, then check pin 13 (INH) is pulled to − by the 100 kΩ. If those are fine, the 555 isn't ticking: check R1, R2, the pin 2 to pin 6 jumper and the capacitor's polarity.
  • All four LEDs look on at once. The clock is much too fast for your eye. A 10 nF or 100 nF capacitor in place of the 10 µF makes the 555 tick about 480 or 4800 times a second. Check the capacitor's marking.
  • The light runs through the four LEDs, then disappears for a while. The Q4-to-RESET jumper is missing or on the wrong pin, so the counter runs on through Q4 to Q9 with nothing attached. Q4 is pin 10, RESET is pin 15.
  • The chase skips or stutters on a 4.5 V battery. A bipolar NE555's output doesn't quite reach the + rail, and on a low supply that can sit near the 4017's clock threshold. Fresh batteries usually fix it; a CMOS 555 (TLC555 or ICM7555), whose output swings right to +, fixes it for good.
  • FREEZE doesn't freeze, or the chase freezes by itself. The button must connect + to pin 13, and the 100 kΩ must run from pin 13 to −. Without the pull-down, INH floats and the counter stops and starts at random.
  • The LEDs are dim. Expected: a 4017 output can only give a few milliamps. The simulation shows about 6 mA; a real chip gives less.

What you're building

Four LEDs that light one at a time, in order, over and over: a light that runs round a loop like the bulbs on a fairground sign. Two chips do it. A 555 timer makes a steady tick. A CD4017 counter counts the ticks and lights one LED per count. Hold the FREEZE button and the counter ignores the ticks, so the light stays where it is until you let go.

This is the first circuit on the site where one chip drives another. The 555 doesn't know the LEDs exist. The 4017 has no idea how fast time passes. Each does one job, and a single wire between them makes a machine.

The clock: a 555 that ticks

You may have met the 555 already as a blinker. Here it's wired the same way, called astable (it never settles in one state). A capacitor charges through two resistors, R1 and R2, until it reaches two-thirds of the supply; the 555 then switches its output low and empties the capacitor through R2 alone, down to one-third; then it starts again. The output is high while the capacitor charges and low while it empties.

The charge and discharge times come from the datasheet formulas, with R1 = R2 = 10 kΩ and C = 10 µF (0.000 01 F):

high: 0.693 × (R1 + R2) × C = 0.693 × 20 000 × 0.000 01 ≈ 0.139 s

low: 0.693 × R2 × C = 0.693 × 10 000 × 0.000 01 ≈ 0.069 s

One full tick is 0.139 + 0.069 = 0.208 s, so the clock runs at 1 ÷ 0.208 ≈ 4.8 ticks a second. (The shortcut formula gives the same: 1.44 ÷ ((R1 + 2·R2) × C) = 1.44 ÷ (30 000 × 0.000 01) = 4.8 Hz.) The 0.693 is the natural log of 2: it's how long a capacitor takes to cover the slice of its charging curve between one-third and two-thirds full.

You can see the charging in plain Ohm's law. At the bottom of the swing the capacitor holds 1.5 V (a third of 4.5 V), so the two resistors have 4.5 − 1.5 = 3 V across them and pass 3 ÷ 20 000 = 150 µA into it. At the top, 3 V, only 1.5 V is left for the resistors, so the current halves to 75 µA. That slowing-down is why the charge curve bends.

The counter: a CD4017

The 4017 is a decade counter: it counts from 0 to 9. It has ten outputs, Q0 to Q9, and exactly one of them is high at any moment, the one matching the count. Each time its CLOCK input goes from low to high (a rising edge), the count goes up by one and the high output moves to the next pin. After 9 it wraps round to 0.

The 555's output goes into CLOCK. So every 0.208 s the clock rises once and the high output steps along: Q0, Q1, Q2, Q3, …

Three more inputs matter here:

  • RESET (pin 15): while it is high, the count is forced to 0.
  • CLOCK INHIBIT (pin 13, often labelled INH or ENABLE): while it is high, the counter ignores the clock. Low, it counts.
  • VDD (pin 16) to +, VSS (pin 8) to −.

Counting to four instead of ten

Ten LEDs is a lot of wiring, so this chaser uses four. The trick is one jumper: connect Q4 to RESET. The count goes 0, 1, 2, 3, and the moment it reaches 4, Q4 goes high, which pulls RESET high, which sends the count straight back to 0. Q4 is high for well under a microsecond, far too short to light anything, so to your eye the count simply runs 0-1-2-3-0-1-2-3. Want a six-step chaser? Move that jumper to Q6. Any length from 2 to 9 works the same way.

One lap of four LEDs takes 4 × 0.208 ≈ 0.83 s, a bit over one lap a second.

The pinout is scrambled, on purpose

The 4017's outputs are not in order along the chip. Counting anticlockwise from the notch:

  • Left side, pins 1–8: Q5, Q1, Q0, Q2, Q6, Q7, Q3, VSS.
  • Right side, pins 9–16: Q8, Q4, Q9, CARRY OUT, INH, CLOCK, RESET, VDD.

So Q0 is pin 3, Q1 pin 2, Q2 pin 4, Q3 pin 7, Q4 pin 10. It looks random, but it's a fixed standard, the same on every 4017 ever made. On a real breadboard you can run the four leads so the LEDs sit in a line; on the Workbench they sit next to their pins, so the light hops about: pin 3, pin 2, pin 4, pin 7.

One resistor for four LEDs

Every LED needs something to limit its current. Normally that means one resistor per LED. Here only one output is ever high, so only one LED is ever on, and all four can share a single 220 Ω between their short legs and −.

The 4017's outputs are weak, like the CD4011's. The simulator models each one as about 200 Ω between the pin and the rail it is driving, so the lit LED sees:

(4.5 − 2.0) ÷ (200 + 220) ≈ 6 mA

The green LED needs about 2.1 V, so it gets (4.5 − 2.1) ÷ 420 ≈ 5.7 mA on paper; at this small current its drop is a touch lower and the simulation shows 5.8 mA.

That 6 mA through the shared 220 Ω lifts the shared node to 0.006 × 220 ≈ 1.3 V. The three dark LEDs have their long legs held at 0 V by their low outputs and their short legs at 1.3 V: they are reverse biased by 1.3 V, which is nowhere near the 5 V an LED can take backwards. They stay off. On a real CD4017B, which the datasheet rates at about 1 mA per output at 5 V, expect the LEDs dimmer than the simulation shows, but clearly lit.

The FREEZE button

INH has a 100 kΩ pull-down to −, so it normally sits at 0 V and the counter counts. The button connects INH to +. Hold it and INH sits at 4.5 V: the clock keeps ticking, but the counter ignores it, so whichever LED was lit stays lit. The pull-down passes 4.5 ÷ 100 000 = 45 µA while you hold the button, and nothing at all when you don't.

Build it

  1. Rails: + along the top, − along the bottom, battery between them.
  2. Chips: both across the centre gap, notches the same way. 555: pin 8 to +, pin 1 to −. 4017: pin 16 to +, pin 8 to −. Check these four wires twice.
  3. 555 reset: pin 4 to +, so the 555 is always allowed to run.
  4. The timing network: R1 (10 kΩ) from + to pin 7. R2 (10 kΩ) from pin 7 to pin 6. Jumper pin 6 to pin 2. The 10 µF from pin 6 to −, + leg to pin 6, striped − leg to the rail. Pin 5 can stay unconnected.
  5. The clock line: 555 pin 3 to 4017 pin 14.
  6. Count to four: 4017 pin 10 (Q4) to pin 15 (RESET).
  7. FREEZE: 100 kΩ from pin 13 to −; button from + to pin 13.
  8. The lamps: a long LED leg on each of pins 3, 2, 4 and 7, in the order you want them to light. All four short legs to one row, and the 220 Ω from that row to −.
  9. Battery in. The light should run round the four LEDs a bit faster than once a second.

The very first tick can look odd. A real 4017 can wake up on any count from 0 to 9. If it wakes on 5 to 9, no LED is lit until it counts through 9 and wraps to 0, about a second at most, and from then on the chase runs normally. On the Workbench the counter starts at 0, and because the 555's output jumps high at switch-on, that first rising edge steps it to Q1 at once.

Debug like an engineer

Split the machine at the wire between the chips. First the clock: put the meter (or an LED with its own 220 Ω) on 555 pin 3. It should flick on and off nearly five times a second. If it doesn't, the 555 or its timing parts are wrong, and the 4017 is innocent. If the clock is fine, look at the counter: pin 15 must be low except for that blip, pin 13 low unless you press FREEZE, and pins 16 and 8 on the rails.

🧠 Your challenge

No single right answer. That's the point.

  • Change the speed. Which part would you change to make the chase twice as slow? Work out at least two different swaps and the new tick time for each with the 0.693 formulas. Which swap also changes how long the clock spends high compared with low, and does the chaser care?
  • Make it longer. Move the reset jumper from Q4 to Q6 and add two LEDs. Which pins do they go on? What's the new lap time?
  • A bounce instead of a lap. Make the light go 1-2-3-2-1-2-3… using only the counter and LEDs: one LED can be fed from two different outputs if each feed has its own diode. Which outputs, and why do you need the diodes?
  • Make the 555 tunable. Put the 10 kΩ potentiometer in series with R2. Predict the fastest and slowest tick. At what speed does the chase stop looking like a moving light and start looking like four LEDs that are all on?
  • Harder: CARRY OUT (pin 12) is high for counts 0 to 4 and low for 5 to
    1. Predict what it does with the Q4 reset in place (careful). Then move the reset to Q8 and predict again: how could CARRY OUT light a fifth LED for half of every lap?

For grown-ups: safety notes

  • Battery power only: 4.5 V from three AA cells cannot shock you.
  • The 10 µF capacitor is an electrolytic and has a polarity: its + leg goes to 555 pin 6, the striped − leg to the − rail. In backwards it can bulge, leak or pop. If it gets warm, take the battery out.
  • Both chips are powered backwards if they go in upside down, and a chip powered backwards gets hot within seconds. Check the notches and the four power wires before the battery goes in.
  • The CD4017 is a CMOS chip: a static spark can damage it. Touch something earthed before handling it, and keep it in its foam or tube.
  • Never leave a 4017 input floating with the power on. RESET is held by Q4 and INH by its 100 kΩ pull-down; a floating input makes the count jump around at random and can make the chip run warm.
  • The four LEDs share one 220 Ω, which is only safe because just one of them is ever on. If you rewire so two outputs can be high together, give each LED its own resistor.

Checked against

Keep building