3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Arduino: Electronic Dice (using random numbers)

Arduino: Electronic Dice (using random numbers)
«
  • show.jpg
  • show1.JPG
  • show2.JPG
  • show3.JPG
This instructable will show you how to make an electronic dice with minimal experience using 7 LEDs, resistors, jumper wires, and of course the arduino (or arduino clone). I wrote this instructable for anyone to easily follow along and learn more about the arduino. Questions are welcome and will be answered as soon as possible. For less experienced users the code for the arduino is in "longhand" and several comments are included for better understanding of the code being uploaded into the arduino.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Parts list

Parts list
«
  • Protoboard.JPG
  • jumpers.JPG
  • DSC05074.JPG
  • DSC05075.JPG
  • switches.JPG
Arduino or a clone ( I'm using a protoshield but a breadboard will work the same way)
11 Jumper Wires (or stripped wires in order to make connections on a breadboard)
7 Resistors (I used 330ohms) (ORANGE)(ORANGE)(BROWN)(GOLD)
7 LEDs ( I used green)
1 tactile switch or motions sensor (I used a motion sensor)
« Previous StepDownload PDFView All StepsNext Step »
12 comments
Jan 7, 2012. 10:54 PMNoldoaran says:
You forgot to set the pinMode to OUTPUT for middleLeft and middleRight.

Great instructable! I love how neat your wiring is. I made LED dice before reading this instructable, but mine looks like a mess.
Aug 3, 2011. 5:17 PManand-patel says:
Hi, i made a arduino dice following http://www.instructables.com/id/Digital-Dice-an-Arduino-project/ - would you know how to make the lights flash randomly before settling on a number (i.e to simulate the 'rolling' of a die)? Cheers
Feb 15, 2011. 2:26 PMdpoulson says:
Nice. An electronic die is exactly what I did as my first from scratch arduino project. :)

On the random front, as stated, seeding from an analog port seems to work well.

Also, in the interest of reducing the code, and a possible further exercise for anyone doing this instructable, you can reduce the number of i/o pins down to 4 for a standard d6.

Nice instructable. You beat me to doing the same one! :)
Feb 15, 2011. 2:27 PMdpoulson says:
Heh, just realised how old this instructable was! It has just been posted on electronics-lab.com blog! :)
Jan 16, 2010. 6:08 PMPaul Smith says:
How do you overcome the fact the the random function in the arduino always uses the same sequence of random numbers, thus making it predictable?
Jan 17, 2010. 8:56 PMPaul Smith says:
Well I was trying to make a random number generator to simulate dice. I used the serial.print command to log the sequence random(1,6) and it was always the same! Someone suggested using randomSeed(analogRead(0)) so Ill have to give it a try...
Oct 9, 2009. 10:01 AMTanners says:
it looked like some of the risistors were backwards or does it matter?

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
0
Followers
1
Author:redryno1221