Rolling the Dice: My Arduino Adventure
This week in class, the assignment was to build a rolling dice circuit in Arduino, and boy, it was challenging. Honestly, this pushed my patience, creativity, and problem-solving skills to new limits, but it was worth it—one of the most satisfying circuits I’ve ever created.
The wires and LEDs required for the rolling dice circuit were so numerous that the breadboard looked like a chaotic maze. Wiring everything correctly was no easy task. The real tedium came from double-checking every wire, especially when the circuit initially didn’t work. One particularly tricky part was the push button. I learned the hard way that it needs to be firmly seated on the board, or the entire circuit might fail. This small detail required some fiddling but turned out to be an important lesson on how precision can make all the difference in electronics. While the physical setup wasn’t overwhelmingly complex, it did demand patience to ensure everything was wired correctly.
Once the hardware was completed, the next obstacle was coding. Truth be told, I had no idea where to begin. It was quite complicated to imagine coding that mimics the rolling of a die. Initially, every time the button was pressed, the LEDs simply hopped to a random number. While it worked, something was lacking. What I was trying to do is create the effect of rolling dice, where the LEDs spin and then stop at the final value. Fortunately, I was not alone in this undertaking, my husband came and helped in the brainstorming as well as the coding. Together, we focused on designing a roll of the dice where the numbers were cycled through before resting on the last one. This was an interesting feature and realistic to the circuit since it was more than just a random jump to the final number.
The final code is a blend of hardware logic and creative coding. Each time the button is pressed, the LEDs cycle randomly, mimicking the motion of a rolling dice, before settling on a final number. Each time the code is uploaded to the arduino board, the LEDs are played over and over again in a different manner. For example, I lowered the number of cycles and the delay. It was satisfying to press the button and see how wonderfully the LEDs shone in different patterns before the final number was announced.
![]() |
| My setup is a tad bit differently from the diagram shown, however this is where I started my setup. |
This project has been one such project that has taken me back to my childhood very much for the reason that I remember the dices used in the game Monopoly. The rolling provides and is intended to maintain the same suspense one would feel when rolling actual dice in their hands. It also led me to think of modern day applications like number generators used in games or applications which of course I have never given much attention to until now!
Though it has its hardships, this project was a great experience to push myself out of my comfort zone and learn more about coding as well as circuit-building. Each circuit project has a lot of elements of the previous one and I can build on it.The rolling dice effect not only made the project feel more polished but also taught me a lot about how timing and randomness work in programming.







Comments
Post a Comment