Do you suffer from polyhedral dice elbow from playing too much Dungeons & Dragons or other tabletop role-playing games? (I’m talking about the dice with lots of different shapes. A player might strain a ligament throwing those dice so often!) Or maybe you just want the convenience of generating your die rolls electronically? Either way, this dice roller is the solution, and then some.
’ll show you how to customize this to any two-digit variety. However, this is no ordinary dice roller: built-in cheats set it apart. I’ll show you how to trigger a high roll or a low roll without any of your hapless gaming friends ever knowing, using nothing but magnets, sensors, and some sleight of hand.
- Arduino Uno (Adafruit P/N 50 or SparkFun P/N 11021)
- USB A-B cable (Adafruit P/N 62)
- Two 8 × 8 LED matrices with I 2C backpacks (Adafruit P/N 872)
- Two reed switches (SparkFun P/N 8642)
- Large push button (for example, SparkFun P/N 9336)
- Double-throw switch (Adafruit P/N 805)
- Wall wart or 9 V battery clip (Adafruit P/N 63 or Adafruit P/N 80)
- Piezo buzzer (Adafruit P/N 1739)
- 10 kΩ resistors (SparkFun P/N 10969 is a good multipack)
- Magnet, powerful enough to trigger the sensor reliably (for example, Adafruit P/N 9) (Optional)
- Breadboard (SparkFun P/N 12002
- Laser cutter or saw (such as a jigsaw or band saw)
- Soldering iron
- Wire snips and pliers
- Wire Hot glue gun
- Wood glue
- Spray paint
INTRODUCING THE LED MATRIX
We’re using 8 × 8 LED matrices to display the results of the dice throws. Every pixel of an LED matrix is independent, and you selectively trigger them, lighting up or dimming each LED to make a pattern. The simplest way to do this is to store the status of each pixel in an array. For instance, an array of LEDs selectively lit to make a smiley face.
Next, you’ll need a box of some sort that will enclose your project. You can approach this step in a few different ways.
Laser-Cut Your Own Enclosure
My first suggestion for anything usually involves designing and creating it yourself. My design resembles a small castle, and this not only gets you in the mood for swordplay and magic spells, but also helps disguise the way you trigger the reed switches to swing the game your way. (More on that last bit after this section.) Here I’ll show you how I went about building my castle enclosure.
Simply power the dice roller by plugging your wall wart or 9 V power adapter into the power jack, and press the button every time you want to roll a die, using the magnet on either reed switch depending on your diabolical goals.
When you complete the hardware and software portion of this project, it should look something like, or a variation thereof with your own imaginative design. Hopefully, you’re also wrestling with the morals of hoodwinking your gaming associates. Good luck with this project