Making an electronic dice is very popular among hobbyists and there are already lots of ready-made projects on the internet about this topic. Tim at Hackaday.io designed an electronic dice project for “1KB Limit” competition. But why another dice project while the internet is already crowded with similar things?
Well, it’s not the subject of this project, but the concept, which makes it unique. This is the most miniaturized dice one can make. As Tim says:
It makes use of a very efficient multiplexing scheme to drive all the 7 LEDs of an electronic die with only two I/O pins.
Yes, you’ve read it right. Only two I/Os are used to control all 7 LEDs of a die. It became possible for a super-efficient multiplexing scheme – Charlie plex Plus. The main goal of this project is introducing you to Charlie plex Plus.
- 1 x ATtiny10
- 7 x SMD LED 0603
- 1 x SMD Capacitor 100n 0805
- PCB of the Circuit
Please Note: SMD components are used to miniaturize the circuit. You can easily go for through-hole components if size is not a concern.
- dice10.gif – A moving image of the circuit
- TinyTouch Library – Download the touch library from GitHub
- MagicDice_v1.2.brd – The board file of this project
- MagicDice_v1.2.sch – The schematic file of this project
Circuit and PCB:
As an entry for Hack a day 1Kb competition, one vital target of this project was to keep the code size below 1Kb. Using an ATtiny10 as an MCU automatically limits the code size to 1kb, so the requirement is automatically met.
The firmware uses a timer interrupt to multiplex all the 7 LEDs. The main routine calls the Tiny Touch Lib to poll the touch button. If a button press is detected, the value of the die is changed in a random manner. Though due to smaller physical size, the touch button is somewhat unreliable and often detects multiple touches. But there is no problem in using it as a random number generator.
Read More: DICE10 – A miniaturized electronic die based on ATtiny10