Home
LogicRoo / Combinational Gates / Digital Dice Circuit Using 555 Timer & 4017 IC — Electronic Dice | Logicroo

Digital Dice Circuit Using 555 Timer & 4017 IC — Electronic Dice | Logicroo

A simple digital dice circuit using a 555 timer and 4017 IC walkthrough — components, circuit connections, working principle, counting sequence, wiring steps, and an interactive digital dice you can explore in the browser.

Logic electronics · 555 + 4017

Too fast to cheat,
so it lands random.

Nothing in this circuit generates a random number. A counter just runs through six states a few thousand times a second — and your thumb decides, with no real precision, where it stops.

7LED pips
6Counter states
12Matrix diodes
9VTypical supply
Tap the die or the button to roll it →
SCH-05 · 555_4017_DICE face —
R1 10k R2 47k C1 .01µ SW1 roll 4 R7 100k 555 U1 7 6 2 3 ~4 kHz 4017 U2 14 15 Q0 Q0 Q1 Q2 Q3 Q4 Q5 D1–D12 matrix R3–R6 220Ω 7 pips · 4 groups 9V +

Tap the die or SW1 to roll

Status: idle — waiting for a roll


Parts bin

What you need

Two chips, seven LEDs and a small pile of diodes. The diodes are what turn six counter states into six recognisable dice faces.

×1 IC 555 Timer — fast astable clock U1
×1 CD4017 Decade Counter U2
×7 LEDs, one colour — the dice pips LED1–7
×4 220 Ω Resistors — one per pip group R3–R6
×1 10 kΩ Resistor — charge path R1
×1 47 kΩ Resistor — sets the clock rate R2
×1 100 kΩ Resistor — button pull-down R7
×1 0.01 µF Ceramic Capacitor C1
×12 1N4148 Diodes — the face matrix D1–D12
×1 Push Button, momentary — roll SW1
×1 Breadboard BASE
×— Jumper Wires BASE
×1 9V Supply (battery or bench supply) PWR

Operating principle

Where the randomness actually comes from

The circuit is entirely predictable. The person pressing the button is not.

The 555 runs at a few kilohertz and the 4017 advances one step per pulse, so the counter cycles through all six states thousands of times a second. Nobody can hold a button for a controlled number of microseconds — so the state it stops on is, in practice, unguessable. That's the whole trick.

Tying Q6 to the reset pin is what makes it a die rather than a ten-sided oddity. The instant the counter reaches Q6 it clears itself back to Q0, so only Q0 through Q5 ever stay lit long enough to matter — six equally likely states.

Seven LEDs can show all six faces because dice patterns are symmetrical. The pips are never driven individually; they're wired as four groups, and every face is just some combination of those groups turned on.

Four groups, six faces

Centre — one LED, lit on the odd faces: 1, 3 and 5.

First diagonal — two corners, lit on everything except 1.

Second diagonal — the other two corners, lit on 4, 5 and 6.

Middle pair — the two side LEDs, lit only on 6.

Count the connections and you get twelve — one diode each, which is exactly the size of the matrix.


Assembly

Building it on a breadboard

Five steps — confirm the counter is stopping at six before you wire a single diode, or you'll be debugging two problems at once.

Build the 555 clock — fast this time

Wire the 555 as an astable: pin 8 to +9V, pin 1 to ground, R1 from +9V to pin 7, R2 from pin 7 to pin 6, pins 6 and 2 bridged, C1 from that junction to ground. With a 0.01 µF capacitor it runs at a few kilohertz — far too fast to watch, which is exactly the point.

Put the roll button on pin 4

Run SW1 from +9V to pin 4, and R7 from pin 4 to ground as a pull-down. Held down, the reset pin sits high and the clock runs. Released, it drops low and the 555 stops dead — so the counter freezes on whatever step it reached.

Add the counter and cut it to six

Seat the 4017: pin 16 to +9V, pins 8 and 13 to ground, and the 555's pin 3 to the clock on pin 14. Then wire Q6 straight back to reset on pin 15. The counter now only ever holds Q0 through Q5 — six states for six faces.

Lay out the seven pips

Arrange the LEDs as a die face: one centre, four corners, two middles. Wire them as four groups — the centre alone, each corner diagonal as a pair, and the two middle LEDs as a pair. Each group gets its own 220 Ω resistor down to ground.

Wire the diode matrix and roll it

Feed each group from the counter outputs that should light it, one diode per connection, cathodes toward the LEDs. Power up, hold SW1 — the pips should blur — and let go. A face should land and hold until the next roll.


If it misbehaves

Seven faces, repeat numbers, or wrong pips

Check the reset wire first, then the clock speed, then the matrix. In that order.