Digital Dice: an Arduino Project.




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

  • 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

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!



    • Creative Misuse Contest

      Creative Misuse Contest
    • Metalworking Contest

      Metalworking Contest
    • Tiny Home Contest

      Tiny Home Contest

    23 Discussions

    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

    1 reply

    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....

    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

    4 replies

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

    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?

    I could download this code?? thanks for the informations..

    what part of the code sets how long the lights stay on for before switching off

    very good Instructable!

    I got a question tough

    do the numbers on the digital dice just change very fast (ex:every millisecond)?

    also,the circuit thing is nice but it would be MUCH easier if you had a prototyping shield on so you could just snap the LED's in there and run some jumper wires to the digital pins

    also,if anybody knows a project (similar to this) in which you press a button and the LED's display a number and keeps it on unless you press the button one more time,which will display another number...please respond

    4 replies

    thanks! glad to hear you like it! for your question: i think you mean how the numbers are generated? well, the arduino cycles through all 6 numbers every (insert time here). this goes so fast you cant be able to manipulate it being 6 all the time. I am currently looking for a protoshield :P ik would've used one if i had it but i still wouldve put it in this box afterward. i uploaded a second code called DigitalDice_with_press. i didn't test it so you will have to do that for me. so please tell me the results! Greetings from holland, Dennis

    another thing...I an new to the arduino which I got a week ago and the second code (DigitalDice_with_press),its the same soldering and things except that you connect a push button (or switch) to it instead of the ON/OFF switch,right? i am waiting for a response...this is a really cool project and I intend to make it I will test it out after I can get the answer to my questions thanks

    arduino rules huh?
    uhm... i don't know how you got the idea of an on off swith but in both the programs there is a pushbutton =/

    in any case, the first program resets after 5 seconds or so and the second program resets when you push the switch for the 2nd time
    so the 2nd is like: push-look at number-push again to reset-repeat.

    if there is a problem with the 2nd sketch i need to know exactly what it is ok?

    here's the thing...i have tried like 4 arduino projects and for some reason (me) none of them worked even if i connected everything well and double chacked. i also tried this one and it doesnt work for me...if it works for anyone...then maybe its my stupid protoshield kit that was missing 3 female headers that should be pluged in the icsp pins and then on the protoshield maybe it doesnt work,maybe its me but i will check out the first one to see if it works for me... sorry...

    so you just thought "that is a nice 'ible, let's spam about reading!

    o-kay? may i ask where i even sayd reading then?