Rolling in Miniature: A Compact Electronic Die
Introducing a tiny, minimalist electronic die project that packs a punch! With just 7 LEDs, an ATtiny25V, a CR1616 coin cell battery, and some passive components, this device is incredibly compact, measuring only 18mm x 18mm in size, 4.9mm in thickness, and weighing a mere 2.1 grams.
This tiny electronic die features a single button, the roll button, which triggers the die to cycle through numbers 1 to 6 when held down. When the button is released, the scrolling slows down until the final change, at which point it switches to a randomly generated number using the XORShift random number generator algorithm. The XORShift algorithm is lightning-fast, compact in code, and maintains excellent randomness, making it a perfect fit for this project. The final value flashes several times before the die powers off after a few seconds.
Battery Life
The dice is powered by a CR1616 coin cell with a capacity of around 50-60mAh.
Current draw:
State | Current @ 3V |
---|---|
Off | <0.1uA |
Active | 2.4mA (average) |
Some battery life calculations:
Number of rolls | 24,000 @ 3 seconds per roll (a quick press of the roll button) |
Total duration | 20 hours |
Rolling the dice 20 times…