Learn & build · Electronics · Part II · Chapter 19
Two chips talking: a running light
Real circuits are rarely one chip. A clock feeds a counter, a sensor feeds a microcontroller, a microcontroller feeds a driver, and every one of those joins is a wire from one chip's output to another chip's input. This build makes the simplest such pair, a 555 clocking a 4017 counter so ten LEDs light one after another, and asks the question every joined pair raises: does the first chip's "high" look high enough to the second?
1. The goal and the blocks
The goal: ten LEDs light one at a time, left to right, about four steps a second, from a 9 V battery. The blocks: a clock (chapter 17's 555, faster), a counter that turns each clock pulse into "the next LED", and ten LEDs. The counter is the new part.
The CD4017 is a decade counter: it counts rising edges on its clock input, and instead of showing the count in binary (chapter 12) it makes exactly one of ten outputs high, Q0 for a count of 0 through Q9 for 9. Predict before you look: what happens on the clock edge after Q9?
Watch the LEDs on the right: one lit at a time, and after Q9 the count wraps around to Q0. Pick U2 to read what's inside it, and pick R3, the single resistor every LED shares (section 5 explains why one is enough).
2. Pin 3 is Q0
The 4017 has 16 pins, and its outputs are scattered around them: Q0 is pin 3, Q1 pin 2, Q5 pin 1. The schematic draws them in counting order because that's how you think about the circuit; the package puts them wherever its designers' layout put them, decades ago. This is normal, and it's why a schematic always carries pin numbers.
Pick pins until you've found it: which pin is Q0, the output that's high right after a reset?
3. Every input needs a voltage
Two of the 4017's inputs do nothing in this build: RST (pin 15) and INH, clock inhibit (pin 13). Both are tied to ground in the schematic. Chapter 13 explained why an unconnected input is trouble: it's a CMOS gate (chapter 12) that draws almost no current, so it drifts to whatever voltage is nearby. That matters more here than on the 555's pin 4.
You forget pin 13 (INH) and leave it unconnected. What would you most likely see?
- All ten LEDs dim
- The running light stops and starts by itself, worse when your hand is near the board
- The chip burns out
4. Does a 555's high look high to a 4017?
Here's the new question. Chapter 12 said a voltage near the supply means 1 and near 0 V means 0, "and nothing in between counts." Datasheets put numbers on that. The 4017's datasheet promises to read any input above its input-high voltage VIH as a 1 (3.5 V on a 5 V supply, 7 V on 10 V, 11 V on 15 V: about 70% of the supply), and anything below VIL (1.5, 3 and 4 V) as a 0. In between, it promises nothing. The 555's datasheet promises its output high is at least VOH, 2.75 V on a 5 V supply and 12.75 V on 15 V while it pushes 100 mA (about 2.25 V below its supply), and typically 1.7 V below. Slide the supply both chips share.
🎯 Challenge: find the lowest supply where the 555's guaranteed high still clears the 4017's VIH.
At 5 V the pair fails on paper: the 555 promises 2.75 V and the 4017 asks for 3.5 V, so even the 555's typical 3.3 V falls short. It might work on your bench, and fail with the next chip from the bag or on a cold morning (chapter 5: design with the min and max columns). At 9 V there's room: the promise is 6.75 V against the 6.3 V the 4017 needs. That's why this build runs on 9 V. In the simulator the clock reaches 7.3 V, because the 4017's input draws almost no current, far less than the datasheet's 100 mA test.
Two chips can talk only if the first one's guaranteed output-high is above the second one's input-high threshold, and its output-low below the input-low one, at the supply you'll actually use.
Where it breaks: a microcontroller's 3.3 V into a 5 V chip
The same check decides one of the most common questions in hobby electronics. A 3.3 V microcontroller pin (high is at least about 2.6 V) driving a 5 V CMOS chip like this one (VIH 3.5 V) fails on paper. The usual fixes: run the second chip from 3.3 V too (the 4017 runs from 3 V), pick a part whose inputs are made for it (the 74HCT family reads 2 V as a 1 on a 5 V supply), or put a level shifter between them. Going the other way, a 5 V output into a 3.3 V input, is worse: it can push current into the smaller chip and damage it, unless its datasheet says its inputs are "5 V tolerant." Chapter 22 meets this on real modules.
5. One resistor for ten LEDs
The circuit lab's "Two LEDs, one resistor (why it fails)" circuit showed what goes wrong when LEDs share a resistor: the one with the lower voltage takes all the current. Yet here ten LEDs share R3. Why does it work?
Why can ten LEDs share one resistor here?
- Only one output is high at a time, so only one LED is ever on, and R3 only ever sets one LED's current
- Because all ten LEDs are the same color
- The 4017 limits the current itself, so R3 doesn't matter
Why are CMOS outputs "weak"?
- Each output is chapter 12's CMOS inverter: a P-channel MOSFET from VDD to the pin, an N-channel from the pin to ground.
- On a logic chip these transistors are tiny, built to charge the next chip's input capacitance (chapter 12's ripple-carry box), not to drive loads. Fully on, a tiny MOSFET is still a resistor of a few hundred ohms.
- The datasheet says it as current: at 10 V, at least 1.3 mA (typically 2.6 mA) while holding the output within 0.5 V of VDD. That's about 0.5 V / 2.6 mA ≈ 190 Ω, close to the 220 Ω the simulator uses at 9 V.
- So an LED driven from a 4017 is dimmer than one from a 555 (whose output stage is built for 200 mA), and a 4017 output can't drive a relay or a motor at all: that needs a transistor (chapter 4).
6. The breadboard
Two chips, the same plan as chapter 17: each across the gap, power to its pins first, then each pin's strip gets its parts. Two things are new. The clock is one long blue jumper from the 555's pin 3 to the 4017's pin 14. And the bottom blue rail isn't ground here: it's the ten LEDs' shared cathode node, and R3 joins it to ground on the right. A rail is only a long strip; its color is a habit, so say so on your board with a label.
🎯 Challenge: click the bottom blue rail and count the LEDs joined to it.
7. The shopping list
| Ref | Part | Why this one |
|---|---|---|
| U1 | NE555P | The clock (chapter 17). |
| U2 | CD4017BE (16-pin DIP) | B-series CMOS: 3–18 V, so it shares the 9 V. "BE" is the DIP package. |
| R1, R2 | 10 kΩ, 68 kΩ, ¼ W | About 4.5 steps a second with C1. |
| C1 | 2.2 µF electrolytic, 16 V+ | Timing. |
| R3 | 1 kΩ, ¼ W | The shared LED resistor: about 6 mA. |
| C2 | 0.1 µF ceramic (104) | Bypass. On a soldered board, one beside each chip. |
| LED1–10 | red 5 mm LEDs | One color, so they look alike at the same current. |
8. Power up and check
- 1. Power pins first: 555 pin 8 and 4017 pin 16 at 9 V; 555 pin 1 and 4017 pin 8 at 0 V.
- 2. The tied inputs: 4017 pins 13 and 15 at 0 V. If either reads anything else, or wanders, it isn't connected.
- 3. The clock: 4017 pin 14 flipping between 0 and about 7.3 V, about 4.5 times a second: slow enough to watch on a meter.
- 4. The LEDs: one at a time, in order. Break the loop at R3 with the meter in series: about 6 mA.
9. What's wrong?
The light runs, but in a strange order: 1, 2, 3, then the 6th LED, then back near the start.
- The clock is too slow
- RST is floating
- The LEDs are wired by output order instead of by pin number
The light freezes on one LED, then moves on when you touch near pin 13.
- INH (pin 13) isn't connected to ground
- The 555 has stopped
- C2 is missing
10. Make it yours
- Count to five: wire Q5 (pin 1) to RST (pin 15) instead of grounding RST. The moment Q5 goes high it resets the count to Q0, so only Q0–Q4 ever light. That's "divide by N" from the datasheet's application list, and you can try it in the lab: open the circuit, and move RST's wire to Q5. (Keep the ground connection off: two things driving one input is its own bug.)
- Back and forth: give the end LEDs Q0 and Q5, and wire each middle LED to a pair of outputs through two diodes (Q1 and Q9, Q2 and Q8, Q3 and Q7, Q4 and Q6), so the light runs out and back: the classic "scanner". The diodes keep two outputs from fighting each other through the shared LED.
- A slower crawl: a 100 kΩ pot in place of R2, with a 1 kΩ in series, as in chapter 17.
Next: a dusk light, where a sensor makes the decision: a light sensor, a comparator and a MOSFET switch a 12 V LED strip on when it gets dark.
Previous: A 5 V and 3.3 V supply · All chapters: Learn & build.
Last updated