Home      Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science

31 December 2009
Author: Giorgos Lazaridis
Electronic Dice

The circuit assembled on a breadboard during the tests

This circuit is mostly for exercising and fun. I do not think that someone could ever exchange ye old plastic cubes with a cold electronic dice to play backgammon... But still, this is an interesting circuit.

The Circuit

The circuit is a 4017 decimal counter. 6 outputs are used to drive the transistor LEDs. The LEDs are connected in three pairs and a single LED. The clock pulses comes from the 555 timer. All the time, the 555 is out of voltage. The clock input is then pulled up using the R3 resistor. When the button is pressed, the 555 is connected to power and delivers pulses to the 4017. The dice is then 'rolled' until the button is released and the 555 stops sending pulses.

This circuit can operate with any voltage from 5 to 15 volts. The only thing that needs to be changes is the limiting resistor of the LEDs, R4 through R10. The value must be calculated according ti the voltage. This circuit is designed for 5 volts. You can use the Dr.Calculus LED resistor calculator to find the resistor needed for your application.

The LED array

What you may have already notice, is that the LEDs are not driven directly each one. Instead, they come in pairs, except one LED. This is done in purpose to reduce the diodes and the transistors used to drive them. I will try to explain what is going on.

First of all, the CO (Carry Out) output. This output remains HIGH from number 0 to number 4. This output is used to light the bottom left and top-right LEDs. So, when the output 0 of the 4017 is HIGH, the only LEDs that lights are those two, because output 0 drives NO LED. So, number 2 is indicated.

Onto the next number now. Output 1 of the 4017 drives the middle LED. Along with the bottom-left and top-right LEDs (from the CO output), number 3 is indicated.

The next output #2 is HIGH. This output drives the top-left and bottom right LEDs. Along with the two LEDs form OE output, the number 4 is indicated.

Following is output #3. This will drive the middle LED, as well as the top-left and bottom-right LEDs. Along with the 2 LEDs from the OE, number 5 is indicated.

Then, number #4 output is HIGH. this output will turn on the top-left and bottom-right LED, as well as the middle-left and middle-right LEDs. Along with the two LEDs from OE, number 6 is indicated.

For the following numbers, the OE output is turned off. So the bottom left and top-right LEDs are turned off. The output #5 will turn on the middle LED, and thus the number 1 is indicated.

Until now, all numbers 1 through 6 are indicated. On the next clock pulse, the output #6 will become High. But this output controls the RESET of the 4017. So, the chip will immediately reset and the count will re-start from output number 0.

This is how you should place the LEDs according to their numbers:

Bill Of Materials
 Resistors R1 Resistor 470 Ohm 1/4 Watt 5% Carbon Film R2 Resistor 470 Ohm 1/4 Watt 5% Carbon Film R3 Resistor 22 KOhm 1/4 Watt 5% Carbon Film R4-10 Resistor 220 Ohm 1/4 Watt 5% Carbon Film R11-14 Resistor 4.7 KOhm 1/4 Watt 5% Carbon Film Capacitors C1 10uF 16V Electrolytic Capacitor Diodes D1-6 1N4148 Switching Diode LED1-7 LED 3mm red Transistors T1-4 BC547 Switching and Applications NPN Epitaxial Transistor ICs IC1 74HC4017 IC2 555 Timer

Relative pages
• 555 timer basic circuits
• Basic transistor circuits
• 4000 series IC pinouts
• Dr.Calculus: 555 Astable multivibrator calculator
• Dr.Calculus: Standard resistor values calculator
• Dr.Calculus: LED resistor calculator

 HOT in heaven!

 NEW in heaven! New Theory: AC electric motor working principle