Introduction: LED Die With Arduino

This project is a die that you will do with 7 LEDs, 8 resistors and a small switch.  Once you construct the die, you will connect it to an Arduino hardware to download the program and you can utilize the die by manipulating a small switch.

Or you can use a Protoshield Kit for Arduino and assemble your LED die on it.

Copy and Paste the next websites to see the Video: http://www.youtube.com/watch?v=KTyM7S_y1ls
http://www.youtube.com/watch?v=37zNUG0LZi8


 

Step 1: Bill of Materials

1 Breadboard
7 LEDs
7 resistors of 200Ω
1 resistor of 1KΩ
1 Mini switch

Or

Use a Protoshield Kit for Arduino and the clear LEDs and the resistors you need to build your LED die.

Step 2: Install the LEDs and Resistors

Install the LEDs and resistors of 200Ω on the protoboard by observing the polarities of the LEDs.   Remember that short terminal in a LED is the negative terminal that you will have to connect to the resistors of 200Ω by leaving free the other terminals to connect to your Arduino: Li to D7, L2 to D8, L3 to D9, L4 to D10, L5 to D11, L6 to D12 and L7 to D13.  And the other terminals of the resistors connect to GND (blue line). 

Step 3: Diagram of Project


Step 4: Continue With the Project

Connect the rest of the components on the protoboard.  That is, the preparation of the connections will use to connect to your Arduino later.

Step 5: Connect the Mini Switch

Connect the mini switch and do the necessary connections on your protoboard to wait only by your Arduino.

Step 6: Connect Your Arduino

In this step,you will oonnect the arduino hardware to the protoboard and will install the program for this project that you will see in the following step the detailed program for managing the project.

Step 7: Program of the Project

With the following program, you will have concluded your project once you download it by utilizing Arduino environment and click on load; you will have running the program to utilize your project.

Program for the LED Die Circuit
//Arduino Code

/*LED DIE*/
//Select your led pins
int ledPins[7] = {7, 8, 9, 10, 11, 12, 13};
int dicePatterns[7][7] = {
{0, 0, 0, 0, 0, 0, 1}, // 1
{0, 0, 1, 1, 0, 0, 0}, // 2
{0, 0, 1, 1, 0, 0, 1}, // 3
{1, 0, 1, 1, 0, 1, 0}, // 4
{1, 0, 1, 1, 0, 1, 1}, // 5
{1, 1, 1, 1, 1, 1, 0}, // 6
{0, 0, 0, 0, 0, 0, 0} // BLANK
};
int switchPin = 5;
int blank = 6;
void setup()
{
for (int i = 0; i < 7; i++)
{
pinMode(ledPins[i], OUTPUT);
digitalWrite(ledPins[i], LOW);
}
randomSeed(analogRead(0));
}
void loop()
{
if (digitalRead(switchPin))
{
rollTheDice();
}
delay(100);
}
void rollTheDice()
{
int result = 0;
int lengthOfRoll = random(15, 25);
for (int i = 0; i < lengthOfRoll; i++)
{
result = random(0, 6); // result will be 0 to 5 not 1 to 6
show(result);
delay(50 + i * 10);
}
for (int j = 0; j < 3; j++)
{
show(blank);
delay(500);
show(result);
delay(500);
}
}
void show(int result)
{
for (int i = 0; i < 7; i++)
{
digitalWrite(ledPins[i], dicePatterns[result][i]);
}
}

Comments

author
braulio777 (author)2016-12-09

This project can be seen in Amazon webpage at:

https://www.amazon.com/s/ref=sr_pg_1?rh=i%3Aaps%2Ck%3Aled+die+with+arduino&keywords=led+die+with+arduino&ie=UTF8&qid=1481316354

author
braulio777 (author)2016-12-09

This project can also be seen in Jameco Electronics at:

http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&productId=2188334&catalogId=10001&CID=CLO

author
braulio777 (author)2016-12-08

LEATHERWORKING classes are now free in this site.

author
braulio777 (author)2016-12-08

BREAD classes are now free in this site.

author
braulio777 (author)2016-12-08

PHOTOGRAPHY classes are now free in this site.

author
braulio777 (author)2016-12-08

CANNING PRESERVING classes are now free in this site.

author
braulio777 (author)2016-12-07

WOODWORKING classes are now free in this site.

author
braulio777 (author)2016-12-07

CONCRETE classes are now free in this site.

author
braulio777 (author)2016-12-07

GLUE classes are now free in this site.

author
braulio777 (author)2016-12-07

MEAT classes are now free in this site.

author
braulio777 (author)2016-12-06

WEARABLE ELECTRONICS classes are now free in this site.

author
braulio777 (author)2016-12-06

RASPBERRY PI classes are now free in this site.

author
braulio777 (author)2016-12-06

LASER CUTTING classes are now free in this site.

author
braulio777 (author)2016-12-06

LAMPS classes are now free in this site.

author
braulio777 (author)2016-12-06

CNC classes are now free in this site.

author
braulio777 (author)2016-12-06

3D PRINTING classes are now free in this site.

author
braulio777 (author)2016-12-06

Robots classes are now free in this site.

author
braulio777 (author)2016-12-06

Electronic classes are now free in this site.

author
braulio777 (author)2016-12-06

LEDS & LIGHTING classes are now free in this site.

author
braulio777 (author)2016-12-06

Arduino classes are now free in this site.

author
braulio777 (author)2016-12-04

The classical die is always a true challenge.

author
braulio777 (author)2016-11-30

Random numbers with Arduino was a true challenge.

author
braulio777 (author)2016-11-28

This project is for you.

author
braulio777 (author)2016-11-28

Thank you for viewing this project.

author
braulio777 (author)2016-11-28

I enjoyed developing this project.

author
MoonDocker (author)2014-01-11

Nice work, I was looking around and found several versions of this. Yours is the first I found using an array. It was easy to set up except for the push button but I was able to figure it out. Thanks for sharing.

author
braulio777 (author)MoonDocker2016-11-27

Thank you!

author
braulio777 (author)2013-05-24

I edited this webpage, and so I'm adding the following websites so that you can see a few videos: http://www.youtube.com/watch?v=KTyM7S_y1ls
http://www.youtube.com/watch?v=37zNUG0LZi8
:

author
nox1468 (author)2013-04-30

nice work, but i was wondering, could i make the arduino's outputs each lead to six LEDs so i could make a six-sided die that shows the resulting number on all six sides?

author
braulio777 (author)nox14682013-04-30

Congratulation nox1468, I will be submitting more arduino projects later.

author
braulio777 (author)2013-04-27

This project is to all people who want to begin to work with Arduino's programs and they want to do their second project. Enjoy it!!

About This Instructable

2,629views

9favorites

License:

More by braulio777:RGB Electronic DieElectronic DieArduino Nano Multiplication/Division Signs
Add instructable to: