Counting display
A CD4026 counts clock pulses and drives a seven-segment display itself, 0 to 9 and round again. There is no microcontroller in it: the simulator solves the 4 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 15 minutes to build and run. Runs in your browser. Free, and no account needed.
The parts retail for about $6.25. On Mokxi they're free.
What you'll learn
- Counting clock pulses with a decade counter
- Decoding a count into seven-segment outputs
- Tying control pins high or low to enable a chip
- Limiting segment current with one common resistor
- Difficulty: Beginner
- Time: About 15 minutes
- Parts: 6
How it works
A clock sends pulses into the CLK pin of a CD4026. On every rising edge the chip adds one to its count, goes from 0 to 9, then starts again at 0.
The chip also decodes the count into segments. Its outputs a to g connect straight to the matching pins of the seven-segment display, so no microcontroller or extra logic is needed. A single 100 ohm resistor on the common pin limits the current for all the lit segments.
Three control pins are tied off. INH and RST go to ground so counting runs and never resets. DEI goes to 5 V so the display stays on.
Parts list
6 parts, plus the jumper wires. They retail for about $6.25; on Mokxi they're free.
- 1 × Full-size breadboard
- 1 × Power, 5 V
- 1 × ClockIn Logic Lab Kit.
- 1 × CD4026 counter with 7-segment outputs
- 1 × Seven segment display
- 1 × Resistor, 100 ΩIn Starter Kit, Claw Machine Kit, Halloween Prop 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 |
|---|---|
| CD4026 counter with 7-segment outputs pin DEI | 5 V |
| CD4026 counter with 7-segment outputs pin VDD | 5 V |
| CD4026 counter with 7-segment outputs pin INH | Ground |
| CD4026 counter with 7-segment outputs pin VSS | Ground |
| CD4026 counter with 7-segment outputs pin RST | Ground |
| Resistor, 100 Ω pin 2 | Ground |
| CD4026 counter with 7-segment outputs pin CLK | Clock pin OUT |
| Seven segment display pin F | CD4026 counter with 7-segment outputs pin f |
| Seven segment display pin G | CD4026 counter with 7-segment outputs pin g |
| Seven segment display pin D | CD4026 counter with 7-segment outputs pin d |
| Seven segment display pin A | CD4026 counter with 7-segment outputs pin a |
| Seven segment display pin E | CD4026 counter with 7-segment outputs pin e |
| Seven segment display pin B | CD4026 counter with 7-segment outputs pin b |
| Seven segment display pin C | CD4026 counter with 7-segment outputs pin c |
| Resistor, 100 Ω pin 1 | Seven segment display pin COM1 |
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 counter you can see: a CD4026 driving a 7-segment display.
//
// Every rising edge of the clock counts one, 0 to 9 and round again, and the
// chip lights the segments of the count itself. Its 6 and 9 have tails.
//
// The control pins tied off here:
// INH (pin 2) low - high freezes the count.
// DEI (pin 3) high - low turns the display off; the chip still counts.
// RST (pin 15) low - high sends the count back to 0.
//
// CO (pin 5) rises each time the count rolls over from 9 to 0. Wire it to a
// second CD4026's clock and that one counts the tens.
Troubleshooting
The usual mistakes with this circuit, and the fix for each.
- The display stays dark. This project
Check that DEI is tied to 5 V. Low turns the display off, though the chip still counts. - The count is stuck on one number. This project
INH must be tied to ground. High freezes the count. Also check the clock output reaches CLK. - The count keeps jumping back to 0. This project
RST must be tied to ground. If it is high, the count resets. - The circuit does not behave as expected at the set frequency. Clock
Pick a frequency slow enough to watch, such as 1 Hz, when learning. Fast clocks look like steady signals. Make sure the clock output and your circuit share a ground. - A counter or flip-flop skips steps. Clock
Check that the clock edge matches the chip, rising or falling. Slow, clean edges are best. Do not connect a mechanical switch as a clock without debouncing it. - The digit shows wrong segments or does not light at all. CD4026 counter with 7-segment outputs
The CD4026 drives a common-cathode display only. Connect the common pin to GND, add a resistor to each segment (about 330 ohms), and check that the display enable pin is high. - The count does not move, or jumps back to zero. CD4026 counter with 7-segment outputs
Keep reset (pin 15) low and clock inhibit (pin 2) low. Reset high clears the count, and inhibit high stops it. Do not leave either pin floating. The clock advances on the rising edge. - Segments stay dark, or light when they should be off. Seven segment display
Check whether the display is common cathode or common anode. Common cathode: common pin to GND, drive segments HIGH. Common anode: common pin to VCC, drive segments LOW.
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.