Digital Dice: an Arduino Project.

12,207

14

23

Posted

Introduction: Digital Dice: an Arduino Project.

People like games "high tech". For example: in my country there is a game called "Monopoly". In that game one must collect "streets" by buying them with money.
That game recently released a version where one doesn't pay with paper but with a credit card.

I was starting to think about what else i couldd modernise...
OMG... I thought while throwing the dice.
10 minutes and a game I won later I started learning Wiring.
when I could do that I bought an Arduino.



Why this Instructable is in the efficiency contest:
The battery's used in the Arduino are rechargables, these can be charged over 1000 times! No throwing away battery's!!

Step 1: Materials and Tools.

  • Arduino
  • Power for Arduino.
  • 7 LED's.
  • Suitable box.
  • Wire.
  • Switch

Tools:
  • Soldering Iron.
  • Hot glue.
  • Dremel.
  • Some items like a ruler, I won't actually tell when to use them but it should come in handy.

Step 2: Soldering.

Solder a wire to all of the LED's (...)
Now bundle up the - wires so you can connect it to the arduino.

Solder wires to your switch

NOTE:
If you don't have jumper wire ( the stuff you can put into the female header) you can use paperclips.
Just solder a paperclip to the points that will connect to the Arduino.

Step 3: Glueing and Cutting.

First off I recommend using a rotary tool and not a knife.

Measure where the arduino power plug will be and mark it with a pencil. Then drill a small hole in the center.
Keep making the hole bigger until the plug (which is connected to the battery) will fit through.

Now imagine a cross in the top half of your box.
LED positions:
LED 0- Wil be in the middle of the cross and wil be connected to pin 7
LED 1- The upper right corner, pin 13
LED 2- Middle right, pin 12
LED 3- Down right, pin 11
LED 4- Down left, pin 10
LED 5- Middle left, pin 9
LED 6- Upper left, pin 8
Switch- Pick location, pin 5

NOTE: These locations are when the lid is closed!

Step 4: Upload Code.

Download the code and upload it to your Arduino environment.
The code doesn't generate a random nuber but cycles through the number so fast you can't manipulate it. If you are a beginner I recommend actually looking at it and seeing if you understand how it works.

the first code is the digitaldice with numbers that dissappear after a few seconds. the digitaldice_with_press will need you to press the button again when the numbers are being displayed. it's still in beta though!

Share

    Recommendations

    • Science of Cooking

      Science of Cooking
    • Microcontroller Contest

      Microcontroller Contest
    • Spotless Contest

      Spotless Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    23 Comments

    Another question, how did you upload the program to the freeduino?
    I tried using the arduino program but I keep getting an error. plz answer ASAP

    I used the arduino software! :D What error are you getting?

    on the LED's one end has a wire connected to a digital port and the other gets bundled up together with the others and connect to GND. What ends of the LED's are connected to those parts? Positive with digital? negative with digital? you should of put that in the instructions....

    what sort of push button did you use?

    I used a switch i harvested somewhere, bit it's just your average tact switch. In fact, you can use any normally open kind of push button.

    So how exactly does the dice work? do you press the button then it shows a different number?? Keen to make similar project

    press button-> value is displayed for five seconds -> need to press button again for new value

    Thanks, also how do you connect the wires to arduino??

    Well, there are three options, you either:
    1) solder to the board directly
    2) make a cheapy header with paperclips (what I did in this instructable)
    3) buy headers to solder to (what I do now with all my projects)

    Your choice!

    Awesome, I tried this and it worked perfectly! One change I would like to make is to have the lights flash randomly before settling on a number (simulating the 'rolling' of a die) - could you help me out?