Digital Dice With Arduino

Have you ever tried to play a game only to find out you don’t have any dice? That’s not a problem anymore! Now you can create your very own digital dice using LEDs and your Arduino board. This is a beginner-level project. This project will allow you to push a button and randomly generate a number between 1 and 6, shown with the number of LED lights.

Digital Dice With Arduino

Credits to:

EvdS. (n.d.). Led dice. Arduino Project Hub. Retrieved May 14, 2022, from https://create.arduino.cc/projecthub/EvdS/led-dice-885cf1?ref=tag&ref_id=led&offset=8

Supplies

6 LEDs

6 220 ohm resistors

1 push button

1 k-ohm resistor

1 Arduino Uno

1 breadboard

jumper wires

Step 1: Set Up the LEDs and Button

Set Up the LEDs and Button
  1. Place the 6 LEDs in the breadboard as shown. They should go in rail E with two spaces in between each LED. You should place the Anode end (long end) of the LED in the first of the two spaces and the Cathode end (short end) in the second space. Place your LED Anode ends in rows 3, 7, 11, 15, 19, and 23.
  2. Place your button in the breadboard as shown. The left side should go in rail E, space 59 and 61, and the right side should go in rail F, space 59 and 61.

Step 2: Attach the Resistors

Attach the Resistors
  1. Place a 220 ohm resistor in the row with the Cathode end of the LED. It should reach from rail D to the ground rail (-, blue) in each of the LEDs (rows 4, 8, 12, 16, 20, and 24).
  2. Place a 1 k-ohm resistor near your button. It should go from the bottom left of the button (row 61) to row 64.

Step 3: Wire the LEDs

Wire the LEDs
  1. Take one jumper wire and attach it from the Anode end of the first LED (row 3) and attach it to the digital output on the Arduino at space 2.
  2. Take the next jumper wire and attach it from the Anode end of the second LED (row 7) and attach it to the digital output on the Arduino at 3.
  3. Take the next jumper wire and attach it from the Anode end of the third LED (row 11) and attach it to the digital output on the Arduino at space 4.
  4. Take the next jumper wire and attach it from the Anode end of the fourth LED (row 15) and attach it to the digital output on the Arduino at space 5.
  5. Take the next jumper wire and attach it from the Anode end of the fifth LED (row 19) and attach it to the digital output on the Arduino at space 6.
  6. Take the next jumper wire and attach it from the Anode end of the sixth LED (row 23) and attach it to the digital output on the Arduino at space 7.

Step 4: Wire the Button

Wire the Button
  1. Take one jumper wire and attach it on the bottom right (row 61, rail G) by the button. Attach the other end of the wire to the digital output on the Arduino at space 12.
  2. Take another jumper wire and attach it next to the resistor in the space at row 64, rail C. Attach the other end to the ground rail (-, blue).
  3. Take another jumper wire and attach it to the top left side of the button (row 59, rail D). Attach the other end to the positive rail.

Step 5: Attach the Ground and 5V Wire

Attach the Ground and 5V Wire
  1. Take a jumper wire and attach it to the Ground port on the Arduino. Attach the other end to the ground rail on the breadboard.
  2. Take another jumper wire and attach it to the 5V port on the Arduino. Attach the other end to the positive rail.

Source: Digital Dice With Arduino

 


About The Author

Muhammad Bilal

I am a highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top