The CD4017 is the chip behind the classic “chasing LED” circuit — ten lights that switch on one at a time in sequence, looping back to the start. It does this with almost no external logic at all, which is exactly why it’s a beginner staple: pair it with a 555 timer for the clock signal and the whole build is two chips, a handful of resistors, and ten LEDs.

Pinout

CD4017 decade counter pinout diagram, DIP-16 package 4017 1 Q5 2 Q1 3 Q0 4 Q2 5 Q6 6 Q7 7 Q3 8 GND 9 Q8 10 Q4 11 Q9 12 CO 13 CE 14 CLK 15 MR 16 VDD

Hover or tap a pin above to see what it does.

Looking at the chip from above, notch or dot at pin 1, standard DIP-16 package:

Pin Name What it does
1 Q5 Decoded output 5
2 Q1 Decoded output 1
3 Q0 Decoded output 0
4 Q2 Decoded output 2
5 Q6 Decoded output 6
6 Q7 Decoded output 7
7 Q3 Decoded output 3
8 GND (VSS) Ground
9 Q8 Decoded output 8
10 Q4 Decoded output 4
11 Q9 Decoded output 9
12 CO Carry out — one pulse per 10 clock cycles, for cascading
13 CE Clock enable, active low — tie to GND for normal counting
14 CLK Clock input
15 MR Master reset, active high — tie to GND for normal counting
16 VDD Positive supply, 3–15V

The outputs are not in pin-number order, and this isn’t a mistake to double-check against a different source — it’s a deliberate quirk of the internal Johnson-counter design. Q0 is on pin 3, Q1 is on pin 2, Q2 is on pin 4, and it only gets more scrambled from there. Wiring LEDs to Q0 through Q9 in the sequence they’ll actually light up means wiring them to pins 3, 2, 4, 7, 10, 1, 5, 6, 9, 11 in that order — not pins 1 through 11 in numeric order, which is the easy mistake to make copying a breadboard layout by eye.

How it counts

Internally, the CD4017 is a 5-stage Johnson counter with decoding logic that turns its internal state into exactly one active output at a time. Each rising edge on CLK (pin 14) advances the count by one: the currently active output goes low, and the next output in the Q0→Q9 sequence goes high. After Q9, the next clock pulse wraps back around to Q0 — a full 10-count cycle, which is where “decade” in the name comes from.

MR (pin 15) forces the counter back to Q0 immediately when pulled high — useful for a manual reset button, or for forcing a known starting state at power-on. CE (pin 13) pauses counting on whichever output is currently active, without resetting anything, when pulled high — useful for a “freeze the chaser” input without losing position. CO (pin 12) produces one pulse for every full 10-count cycle regardless of which specific outputs a project actually uses, which is what makes cascading multiple CD4017s straightforward: feed one chip’s CO into the next chip’s CLK to count past 10, 100, or further, in decade steps.

The classic LED chaser circuit

The textbook pairing is a 555 timer in astable mode (see the 555 pinout guide) generating a steady square wave into the CD4017’s CLK pin, with ten LEDs — each through its own current-limiting resistor — wired to Q0 through Q9. Adjusting the 555’s timing resistor and capacitor changes the chase speed directly, since every CD4017 output step is triggered by one 555 output cycle. It’s a genuinely satisfying first “real circuit” beyond a single blinking LED, and the whole build needs no microcontroller or code at all.

Common mistakes

Wiring LEDs to pins in numeric order rather than Q-number order. Covered above — the single most common mix-up, since it’s easy to assume pin 1, 2, 3 means Q0, Q1, Q2 in that order.

MR left floating. An unconnected reset pin can pick up noise and reset the counter at random, especially near a switching 555 clock signal — tie it firmly to GND unless a reset button is wired to it deliberately.

Forgetting current-limiting resistors on the LEDs. Same rule as any LED — see how to choose the right resistor value for an LED if a value hasn’t been picked yet.

Expecting a fast chase speed at low supply voltage. Like most CMOS logic, the CD4017’s maximum reliable clock frequency scales down with supply voltage — a chase that runs fine at 12V may misbehave or skip if the same clock frequency is pushed at 3V.

If you’re building the chaser above and haven’t wired a 555 astable circuit before, the 555 timer pinout and how it works covers the clock-generation half of this pairing in full.