Quick Project – 20th Century Electronic Dice

In this tutorial we make electronic dice without using a microcontroller!

Updated 18/03/2013

After publishing an article which described the design of an electronic die (dice), one of my twitter followers said that they made them in the past just with a 555 timer IC and a 4017 logic IC. A fair point, as one does sometimes get carried away with microcontrollers sometimes. Just to show that I haven’t lost touch, here is a basic rendition of the die project again but without any of that fancy microcontroller jibber-jabber. I will just present the schematic and demonstration, however if you want to make one on some protoboard, doing so should be quite simple.

First off, here is the schematic. I really should learn to use Eagle or somesuch, but a pen and paper is so much quicker:

die1schemss

Now what is happening here? I’m glad you asked. On the left we have a 555 timer in astable mode. For more information about 555 ICs, please visit our part review. When the user presses SW1, power is applied to the 555 and it merrily sends out pulses from pin 3. To increase the speed of the pulses, decrease the values for R1 and R2.

The pulses are received into IC2, a “4017 five-stage Johnson decade counter”. [data sheet] This is still a very old yet useful IC. It has ten output pins, Q0~Q9. Every time the 4017 receives a pulse, starting from power-on or a reset, starting from Q0 it sets an output pin to high (pins default to low). We have sourced LEDs D1~D6 from the first six output pins on our 4017. So when it receives the fast pulses from the 555, it quickly blinks the LEDs in order. When the user releases SW1, the pulses stop arriving from the 555, and the 4017 stops counting – and leaves the current pin HIGH so we can read the value. And here it is in real life:

die1boardss

The parts list:

  • R1, R2 – 82k ohm resistors
  • R3 – 1.8k ohm resistor
  • C1, C3 – 100 nF polyester capacitors
  • C2 – 10nF polyester capacitor
  • D1~D6 – typical LEDs of your choice
  • IC1 – 555 timer IC
  • IC2 – 4017 CMOS counter IC
  • SW1 – normally-open button
  • 5 V power supply (use an LM7805 regulator if 5 V not available)

There are a few things to take note of if building this circuit. The 4017 IC is quite prone to static, so please take care. Furthermore, all unused output pins need to be connected to ground. (Yes, I missed that in the schematic for pin 9). And finally, you can only source 10mA per output pin, which explains the higher than usual value for R3.

Quick note: In the past we have discussed capacitors and their use for smoothing noise from DC current. The circuit above is a perfect example – the 4017 is quite susceptible to noise and will not count properly without C3 between 5V and GND.

Finally, in the spirit of this article, less is more. We could use another 555 in a monostable configuration to limit the running time of the astable 555 pulse-generating timer, but a human can do that with their digits. Furthermore, a reset button could be added onto the 4017, so that’s up to you. Finally, here it is in action:

So there. However you can now see the advantages of using a microcontroller. Each extra function or ‘trick’ created by a line or two of code with our new die could require an exponential amount of hardware, power consumption, board space and possibly a total redesign. However doing it ‘the old way’ is interesting and helps prototyping practice and troubleshooting.

But while we have all of these parts out, we’ll have a little more fun… let’s do it with an actual number being display, instead of a flurry of blinking LEDs. We still need the 555 timer to create our pulses, so that remains the same:

die2aschemss

and here is the rest of the circuit:

die2bschemss

So in this example, the 555 is sending out pulses on request via SW1. However this time, the 4518 BCD counter [data sheet] receives those pulses, counts them (from zero to nine then repeat) and converts the current value to binary-coded decimal. Next, the BCD value is sent over to the 4511 BCD to 7-segment driver IC [data sheet]. This IC converts reads the BCD and sets outputs that are suitable for driving 7-segment LED modules. These outputs are sent via 330 ohm resistors to protect the LED segments. Then finally, the digit zero to nine can be displayed on the LED unit.

With some trickery we could limit this display to the numbers 1~6, if you want to do that go for it. So in this case our ‘die’ has in fact 10 values. I’m sure there are some games that could make use of it. Anyhow, here it is in real life:

die2boardss

You may be wondering what happened to R3~R9. In this case I am using a DIP resistor array. This is just eight resistors in one package, which makes life easier.

The parts list:

  • R1, R2 – 82k ohm resistors
  • R3~R9 – 330 ohm resistors
  • C1, 100 nF polyester capacitor
  • C2 – 10nF polyester capacitor
  • D1 – common-cathode 7-segment LED display
  • IC1 - 555 timer IC
  • IC2 – 4518 CMOS counter IC
  • IC3 – 4511 BCD to 7-segment IC
  • SW1 – normally-open button
  • 5V power supply (use an LM7805 regulator if 5V not available)

And here it is in action:

You can now see why the Arduino and other microcontrollers have taken off in popularity. They really do lighten the load with regards to planning and hardware construction. However it is enjoyable to do things the old way sometimes, ergo this article. If you are interested in articles like this one that use digital electronics, please let me know via the Google Group and there will be more projects similar to this one, but in greater detail. One day I may even pull the finger out and make a TTL clock…

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The following two tabs change content below.

John Boxall

Founder, owner and managing editor of tronixstuff.com.

2 Responses to “Quick Project – 20th Century Electronic Dice”

  1. sid says:

    it tried it and it worked….thnx a lot..

Trackbacks/Pingbacks


Leave a Reply

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: