Electronic Dice
Overview
In autumn of 2014, I wanted to develop a small electronic product to use as a christmas gift. I decided on an electronic dice with LEDs as the dots. With the push of a button, the LEDs play an animation to emulate the roll of a dice, before displaying a random number.
Images
Details
Because I wanted black PCBs for a low price, I ordered them from dirtypcbs.com. This limited the size to 5 x 5 cm. Because there wasn’t enough space for a button cell, I decided to use a AAA battery and a boost converter to bring the voltage to 3 V.
To animate the LEDs and generate random numbers I used an ATtiny45. The seven LEDs can be controlled with only four pins because the radially opposite dots will always be used in pairs. I used the Entropy library to generate the result of the dice throw. This is a relatvely slow process, so for the animation I used the random() function of the Arduino framework, which is less random but much faster.