Introduction: Digital Dice: an Arduino Project.

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

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

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

Picture of 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!

Comments

Manuel2134 (author)2013-05-29

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

dunnos (author)Manuel21342013-05-29

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

Manuel2134 (author)2013-05-17

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

Manuel2134 (author)2013-04-26

what sort of push button did you use?

dunnos (author)Manuel21342013-04-26

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.

anand-patel (author)2011-05-18

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

dunnos (author)anand-patel2011-05-19

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

anand-patel (author)dunnos2011-05-22

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

dunnos (author)anand-patel2011-05-22

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!

anand-patel (author)dunnos2011-08-03

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?

dholroyd (author)2011-05-26

I could download this code??

thehtd (author)2010-08-20

http://thehtd.blogspot.com/ thanks for the informations..

PoisonMondo (author)2010-06-22

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

coolrobot (author)2009-08-21

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

dunnos (author)coolrobot2009-08-22

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

coolrobot (author)dunnos2009-08-22

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

dunnos (author)coolrobot2009-08-22

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?

coolrobot (author)dunnos2009-08-22

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

dunnos (author)2009-05-02

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

dunnos (author)2009-04-28

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

dunnos (author)2009-04-27

yes, monopoly is the most succesful board game in my country, in fact, it is the only board game i actually like. kidding about what? where did the last bit come from? reding reading...

TXTCLA55 (author)2009-04-27

Hmmm; some diagrams of how to wire all the LED's to the arduino would be nice....but over all a great ible! 5 starts!

dunnos (author)TXTCLA552009-04-27

Will do, first thing in the morning! thanks!

About This Instructable

12,109views

14favorites

License:

More by dunnos:Cheap obstacle sensor - with Arduino!Digital Dice: an Arduino project.How to clean a keyboard
Add instructable to: