CD4000 counter, switch and one-shot drawer
13 chips on breadboards, powered, every input tied low and ready to rewire. There is no microcontroller in it: the simulator solves the 13 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.
Beginner About 20 minutes to build and run. Runs in your browser. Free, and no account needed.
The parts retail for about $22. On Mokxi they're free.
What you'll learn
- Powering CMOS logic chips, with VDD and VSS or VCC and GND
- Why unused inputs are tied low instead of left floating
- Flip-flops, counters and one-shots as building blocks
- Testing a chip by changing one input at a time
- Difficulty: Beginner
- Time: About 20 minutes
- Parts: 19
How it works
This is a drawer of thirteen logic chips on three breadboards: flip-flops, counters, a display driver, multiplexers, an analog switch and two one-shot timers. Each one is powered, and each input is tied to ground so nothing floats.
Nothing else is wired, so the circuit does nothing by itself. You choose a chip, move one input wire to the plus rail, add an LED and a resistor on an output, and watch what changes. Each chip's help page has its pins and truth table.
Parts list
19 parts, plus the jumper wires. They retail for about $22; on Mokxi they're free.
- 3 × Full-size breadboard
- 3 × Power, 5 V
- 1 × CD4027 dual JK flip-flop
- 1 × CD4013 dual D flip-flop
- 1 × CD4020 14-stage counter
- 1 × CD4040 12-stage counter
- 1 × CD4024 7-stage counter
- 1 × CD4060 counter with oscillator
- 1 × CD4026 counter with 7-segment outputs
- 1 × CD4543 7-segment LCD driver
- 1 × 74HC4052 dual 4-channel mux
- 1 × 74HC4053 triple 2-channel mux
- 1 × 74HC4066 quad analog switch
- 1 × 74HC123 dual monostable
- 1 × 74HC221 dual monostable
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 |
|---|---|
| CD4027 dual JK flip-flop pin VDD | 5 V |
| CD4013 dual D flip-flop pin VDD | 5 V |
| CD4020 14-stage counter pin VDD | 5 V |
| CD4040 12-stage counter pin VDD | 5 V |
| CD4024 7-stage counter pin VDD | 5 V |
| CD4027 dual JK flip-flop pin 2CP | Ground |
| CD4027 dual JK flip-flop pin 2R | Ground |
| CD4027 dual JK flip-flop pin 2K | Ground |
| CD4027 dual JK flip-flop pin 2J | Ground |
| CD4027 dual JK flip-flop pin 2S | Ground |
| CD4027 dual JK flip-flop pin VSS | Ground |
| CD4027 dual JK flip-flop pin 1S | Ground |
| CD4027 dual JK flip-flop pin 1J | Ground |
| CD4027 dual JK flip-flop pin 1K | Ground |
| CD4027 dual JK flip-flop pin 1R | Ground |
| CD4027 dual JK flip-flop pin 1CP | Ground |
| CD4013 dual D flip-flop pin 1CP | Ground |
| CD4013 dual D flip-flop pin 1R | Ground |
| CD4013 dual D flip-flop pin 1D | Ground |
| CD4013 dual D flip-flop pin 1S | Ground |
| CD4013 dual D flip-flop pin VSS | Ground |
| CD4013 dual D flip-flop pin 2S | Ground |
| CD4013 dual D flip-flop pin 2D | Ground |
| CD4013 dual D flip-flop pin 2R | Ground |
| CD4013 dual D flip-flop pin 2CP | Ground |
| CD4020 14-stage counter pin VSS | Ground |
| CD4020 14-stage counter pin CP | Ground |
| CD4020 14-stage counter pin MR | Ground |
| CD4040 12-stage counter pin VSS | Ground |
| CD4040 12-stage counter pin CP | Ground |
| CD4040 12-stage counter pin MR | Ground |
| CD4024 7-stage counter pin CP | Ground |
| CD4024 7-stage counter pin MR | Ground |
| CD4024 7-stage counter pin VSS | Ground |
| CD4060 counter with oscillator pin VDD | 5 V |
| CD4026 counter with 7-segment outputs pin VDD | 5 V |
| CD4543 7-segment LCD driver pin VDD | 5 V |
| 74HC4052 dual 4-channel mux pin VCC | 5 V |
| 74HC4053 triple 2-channel mux pin VCC | 5 V |
| CD4060 counter with oscillator pin VSS | Ground |
| CD4060 counter with oscillator pin PI | Ground |
| CD4060 counter with oscillator pin MR | Ground |
| CD4026 counter with 7-segment outputs pin CLK | Ground |
| CD4026 counter with 7-segment outputs pin INH | Ground |
| CD4026 counter with 7-segment outputs pin DEI | Ground |
| CD4026 counter with 7-segment outputs pin VSS | Ground |
| CD4026 counter with 7-segment outputs pin RST | Ground |
| CD4543 7-segment LCD driver pin LD | Ground |
| CD4543 7-segment LCD driver pin C | Ground |
| CD4543 7-segment LCD driver pin B | Ground |
| CD4543 7-segment LCD driver pin D | Ground |
| CD4543 7-segment LCD driver pin A | Ground |
| CD4543 7-segment LCD driver pin PH | Ground |
| CD4543 7-segment LCD driver pin BI | Ground |
| CD4543 7-segment LCD driver pin VSS | Ground |
| 74HC4052 dual 4-channel mux pin VEE | Ground |
| 74HC4052 dual 4-channel mux pin GND | Ground |
| 74HC4053 triple 2-channel mux pin VEE | Ground |
| 74HC4053 triple 2-channel mux pin GND | Ground |
| 74HC4066 quad analog switch pin VCC | 5 V |
17 more connections: open it in the simulator to see them all.
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.
// CD4000 counter, switch and one-shot drawer.
//
// Every chip is on a breadboard and powered, and every one of its inputs is
// tied low by a wire to a ground rail, so nothing floats. Nothing else is
// wired: pick a chip, move an input's wire to the + rail, put an LED with a
// resistor on an output, and see what it does. Each chip's help page has its
// pins and its truth table.
Troubleshooting
The usual mistakes with this circuit, and the fix for each.
- An output never changes This project
Most inputs are tied to ground. Move the wire of the input you want to test to the plus rail. - An LED stays dark or the chip behaves oddly This project
Put a resistor in series with the LED, and never leave an input unconnected. - The flip-flop ignores the clock, or stays set or reset. CD4027 dual JK flip-flop
Set and reset are active high on the CD4027, and they override the clock. Tie both to GND when not used. Do not leave them floating. - Outputs change at an unexpected time. CD4027 dual JK flip-flop
The clock acts on the rising edge only. Make sure J and K are stable before the edge. J high and K high makes it toggle, J and K low holds the state. - The flip-flop outputs are stuck or random. CD4013 dual D flip-flop
Tie unused SET and RESET inputs to ground, since they are active high. Never leave inputs floating on a CMOS part. Add a 100 nF cap close to VDD. - It does not clock properly. CD4013 dual D flip-flop
Data moves on the rising edge of the clock. Use a clean, debounced clock. For a toggle, connect Q-bar to D. The supply is 3 to 15 V. - The counter starts at a random value or never clears. CD4020 14-stage counter
The reset pin is active high. Tie it low to count and pulse it high to clear. A floating reset gives erratic counts. - The count is wrong or skips. CD4020 14-stage counter
The CD4020 counts on the falling edge of the clock. Use a clean clock. Not all outputs are present on the chip, as Q2 and Q3 are missing.
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.