Electronic Dice with ATtiny13 This electronic dice is powered from a CR2032 3V battery and an ATtiny13A microcontroller is controlling the LEDs. No button and no switch is needed to operate it. A piezo buzzer is used as a preassure sensor. I took it out from an old telephone. As the dice is dropped from at least 1 cm height to the table the dice shuffles through the numbers and after a few seconds it shows the rolled number. Working principle of the dice If you drop the dice, the piezo buzzer creates a voltage spike. This spike is trimmed by the 1N4148 diode so the microcontroller doesn't get damaged. This trimmed spike creates a pin change interrupt and resets a timer. In that moment another, always running timer is devided by 6 and the remainder of this division gives a number which is always between 0 and 5. 0 means 1 on the dice, 1 means 2 on the dice and so on. 5 means 6. So this number is the starting position of the dice. This number could be any number from 0 t...
Posts
Showing posts from February, 2022