Introduction: 5x5 LED Cube (Arduino Uno)

Picture of 5x5 LED Cube (Arduino Uno)

This is a step by step explanation of how to build a 5x5 LED cube using an arduino. I did this project for my undergraduate electronics class and it took me about 2 weeks to complete.

Note: Apparently, some of the links for the supplies and code aren't working, if you need them send me an email at amh02010@mymail.pomona.edu.

You can find a video of the working LED cube on youtube here:
http://www.youtube.com/watch?v=KiE-WHqU5a8&feature=youtu.be


And here's another:
http://www.youtube.com/watch?v=6zRlhSzXP80&feature=youtu.be

Step 1: Supplies

I used www.mouser.com and www.amazon.com to order my materials for this project. The main parts needed are:
-125 LEDs
-30x 150 Ohm resistors
-5x 3-8 Line Decoders
-5 NPN Transistors

The manufacturer numbers and prices can be found in the attached document though the cost was about $40.

Additional required materials:
-Arduino uno
-Soldering iron
-Solder
-Sturdy wire (for structure of cube)
-Insulated wires
-Breadboard
-sockets (for decoders)

Step 2: Cube Construction

Picture of Cube Construction

Unfortunately, I have not perfected the construction of the cube.  I found this portion of the project both frustrating and painful (hot wires!). 

I began by assembling the 5 layers or planes of the cube.  This involved connecting all the cathodes of the LEDs together.  Id did this by poking 25 LEDs (about 1 inch apart) into a piece of styrofoam.  I bent all the anodes out of the way and soldered the LEDs in 5 columns and then two rows on the end (see picture). Be careful when soldering because the entire wire becomes hot and I accidently burned myself multiple times by touching the end of one of the wires.

The next step in cube construction is even trickier.  You need to connect the anodes of the LEDs in 25 vertical columns without letting any of them (or their connecting wire) touch the cathode planes.  The way I did this was leaving the top plane in the styrofoam and placing ~6 inch wires next to the anodes. I used needlenose pliers to curl the anodes into loops so that it was easier to solder. Alternate the directionality of the wires of the cathode planes for stability. See photos.

Step 3: Wiring and Breadboard

Picture of Wiring and Breadboard

See attached pdf for a circuit diagram. 3-8 decoders labeled A-E. But a brief overview...
1) Solder sockets into  board (w/o decoders in)

2) Wire in series with socket pins according to 3-8 decoders as follows (see http://www.alldatasheet.com/datasheet-pdf/pdf/15570/PHILIPS/74HC238N.html? for data sheet for further information)

Note: Error in circuit diagram. Z0 should actually be connected to the VCC wire.

"A"-"C" 3-8 decoders
-connect A0 together and to digital output 4 on arduino
-connect A1 together and to digital output 3 on arduino
-connect A2 together and to digital output 2 on arduino
-connect g to ground on arduino
-connect Vcc to 5V on arduino
-connect Y0-Y7 of "A" to COL1-COL8 (with 150 ohm resistor between)
-connect Y0-Y7 of "B" to COL9-COL16 (with 150 ohm resistor between)
-connect Y0-Y7 of "C" to COL17-COL24 (with 150 ohm resistor between)

"D" 3-8 decoder
-connect A0 to other AO and to digital output 4 on arduino
-connect A1 to other A1 and to digital output 3 on arduino
-connect A2 to other A2 and to digital output 2 on arduino
-connect g to ground on arduino
-connect Vcc to 5V on arduino
-connect Y0 to COL25 (with 150 ohm resistor between)

"E" 3-8 decoder
-connect A0 to digital output 6 on arduino
-connect A1 to digital output 5 on arduino
-connect A2 to ground on arduino
-connect g to ground on arduino
-connect Vcc to 5V on arduino
-connect Y0 to E3 of "A" decoder
-connect Y1 to E3 of "B" decoder
-connect Y2 to E3 of "C" decoder
-connect Y3 to E3 of "D" decoder
-connect pEN (E3) to digital output 12 on arduino

3) Solder 5 150 ohm resistors into board. Then solder base of 5  transistors in series with resistor. Ground the collectors. Solder wire leads to emitters of transistors to Z0-Z5 (planes of cube).

Step 4: Programming

CLARIFICATION:
The column numbering can be seen in the attached pdf. The first column is the back left corner, then the numbering increases left to right for each row.

With respect to the programming, the data sheet I attached on the previous step will be helpful (ESPECIALLY THE LOGIC TABLE). You code the arduinio to ouput a 5-digit binary number to the decoders and then to the 25 columns (via digital ouptuts 2-6, where setting a pin to high is a one and setting a pin to low is a 0). Then you also code the arduino to set a specific plane of the cube to high to determine which plane of a specific column you want to light up.  To light up multiple LEDs from the same decoder you have to flash between the "columns" at a delay rate less than the human eye can detect.  Please see my attached code to find out how to light up individual LEDs, columns, planes, spell letters, and create patterns. 

Attached is a sketch showing the labeling of LEDs, columns, and planes.
Note: My method of coding is very long because I don't remember much from my intro to computer science course. Could shorten code by using if statements, loops, etc.

EX.
To illuminate LED28 (in COL3, plane 2)
You want all the levels low, besides the second one so,
  digitalWrite(Z0, LOW);
  digitalWrite(Z1, HIGH);
  digitalWrite(Z2, LOW);
  digitalWrite(Z3, LOW);
  digitalWrite(Z4, LOW);
And then to call the correct column, look at the logic table in the datasheet., Begin by setting p3 and p4 to determine which decoder connected to the cube to direct to. Because we want COL3, we want the first decoder "A" which means setting
A0, A1, A2 to LOW (So Y0 goes high and enables the first decoder).  A2 is always low on the initial decoder "E" so set its other address inputs to low as well such that...
  digitalWrite(p3, LOW);
  digitalWrite(p4, LOW);
Then need to determine which output of decoder "A" you want. Since it's the third column you want the third output.  When A0, A1, A2 are LHL, Y2 goes high so,
  digitalWrite(p0, LOW);
  digitalWrite(p1, HIGH);
  digitalWrite(p2, LOW);

Comments

BadSeedd (author)2017-11-21

Anyone??? Hello?

BadSeedd (author)2017-11-18

If anyone has the final code could you please send it to dermotmcgowan113@gmail.com

KeshavaK1 (author)2017-11-08

Plz send program document code .klkeshava@gmail.com

KeshavaK1 (author)2017-11-08

How to download program document

KeshavaK1 (author)2017-11-08

How to

Mousepotato01 (author)2017-09-20

Did any of you get to download the final code???

AndroT1 (author)2017-05-19

can someone please email me the final code

my mail: zackyferdiansah@gmail.com

17donova (author)2017-04-06

Could someone email me the final code

my mail : Tonydonovan@yahoo.com

啟亮鄭 (author)2017-03-02

can someone please email me the final code

my mail : stressedordessert@gmail.com

PhúcL13 (author)2016-11-28

can someone please email me the final code

my mail : phucanhbk95@gmail.com

caolanohara (author)2016-11-17

can someone please email me the final code

caolan_o_hara@hotmail.com

bboden (author)2014-06-18

I followed your instructable and made the cube. It works beautifully, and I have been using other peoples code, but I would like t use yours. Can you email me the code docx pleas?
bboden5000@gmail.com

SaadH8 (author)bboden2016-10-08

can u please send me the final code email:scorpion3132774171@gmail.com

SaadH8 (author)2016-10-08

please can anyone send me the final code, email:scorpion3132774171@gmail.com

ShivaniB7 (author)2016-08-13

I am interested in making 5*5*5 led cube using arduino for my project.So please mail me all the required docs and links regarding this.it will b awful if u can send me a project report on this.I will b very thankful.

Toetsenbord (author)ShivaniB72016-09-06

You can just download the docs attached to this instructables, they should give you all the information to build this!

I wish you succes!

Toetsenbord (author)Toetsenbord2016-09-06

btw do you really think it will be awful? ;-)

lol

Toetsenbord (author)2016-09-06

okay, so I'm a bit struggling, I can't get it to work, because if I run the code, there sometimes flashes one led, or sometimes a collomn, but it doesn't really work. It's not because of the code, I think. I made it like the circuit diagram wich was attached to this instructable. Can someone help me out please?

Thanks!!!

btw great project, I love it!

Hope it will work soon :-)

Toetsenbord (author)2016-04-19

Can I use 2n2222 npn transistors? And will 74HC238D decoders work?

AswandV (author)2016-03-29

Can you plz send me the codes aswandvijayan@gmail.com

RavirajR1 (author)2016-03-27

can you please send me the code at ravirajrathor111@gmail.com thank you

haunted221 (author)2016-03-18

can you please send me the code at hauntedboy194@gmail.com thank you

kivmeister1 (author)2016-02-02

can you please send me the code at kivmeister@gmail.com thank you very much

kivmeister1 (author)2016-02-02

can you please send me the code at kivmeister@gmail.com thank you very much

CasperC2 (author)2016-01-30

Can you send me the code please ;-) Thanx.
200179cch@gmail.com

alkilm (author)2016-01-19

can you send me the code please

meridional321@outlook.fr

KanzuA (author)2016-01-06

can you send me the code please

kanzu.adli@gmail.com

KanzuA (author)2016-01-06

can you send me the code please

kanzu.adli@gmail.com

† JosephH (author)2015-12-23

can you send me the code please

joseph.89311@gmail.com

DewidS (author)2015-12-12

can you sen my the code?

dewids@mail.ru

PhúH2 (author)2015-11-02

can you send me the code !!

vanphu54ddt@gmail.com

AiC2 (author)2015-10-08

hi,can i have the code for it??Thank u very much!Email:angelina_caw@hotmail.com or aiwernchong@gmail.com

JanrossV (author)2015-09-07

can you send me the code pls sir . janrossvillanueva@gmail.com

JanrossV (author)2015-09-07

JanrossV (author)2015-09-07

Lance_Tronic (author)2015-05-17

Hi,

I am also atempting this project and need access to your code.

Can you send to my email - lancelot@y7mail.com

Thanks in advance.

Lance.

zainulislam (author)2015-05-09

hi i want to learn arduino and its programing so can you help me to learn it i search every thing on google but eventually i came here and found this site so please help me to learn arduino my gmail id is
zainulislam23@gmail.com
my skype id
zainulislam49
my phone no is
03149053597
thanks in advance .......

krashton1 (author)2013-12-10

I'm having troubles with this circuit. I have wired everything up exactly as you have said to do it but when I go to run the cube, all the outputs from all the decoders are high/ This gives me limited control but only over layers. All coloums are high but I can still control the transistors. I'm not sure where to go from here but I'm stuck. Any

krashton1 (author)krashton12013-12-10

never mind, I found out the problem to be that I just ordered any old 3 to 8 line decoders, but the ones I ordered work in reverse to these ones. They have 8 active high pins and using A0,A1,A2, you can set one of those pins to low. Make sure when buying parts, make sure you know exactly what it does.

To note, DO NOT BUY 74ALS138N 3-8 LINE DECODERS

So we used 74LS138N's, guess that's why we can't control individual pins. What one pin does, they all do and several columns will not light up at all. :/

Yeah you need to make sure the logic tables match up. Can you replace your decoders?

sifu111 (author)2015-05-03

Could You please send me the final code? Thanks in advance.

nesjav_2468@hotmail.com

АлексейМ2 made it! (author)2014-12-25

Hi! I have problems with programming, you could send an email with your code please. My email: lex0823@yandex.ru

"Privet!" from Russia :)

nice job. I am using this design for a college class project. Could you share your GREAT PCB DESIGN with us. (CAD files, did you use EagleCAD?)

janet.gordon.75839 (author)2015-04-19

Thanks so much for this instructable! Can you please send me the final code? janetgordon28@yahoo.com.

shashi.gupta.39108297 (author)2015-04-19

I built 5x5x5 led cube using arduino uno and decoders(74ch138).proper circuit and

cube model I built but when I write program and uploaded it on arduino many errors found .please send code to shashigupta323929@gmail.com.

because I am exciting to see my led cube glowing...pleae send the code

MinhD1 (author)2015-04-19

Could You please send me the final code? Thanks in advance.

My email: vuminhduc456@gmail.com

PritomH (author)2015-04-10

pritom.whoami@gmail.com......i need the code...by the way,your information on this project is very usefull.....5*5*5 audrino powered led

parths1 (author)2015-03-14

can you send me the code and parts list please

email--

parthsethi16.ps@gmail.com

thanks in advance

rochebox (author)2015-03-10

Awesome project! Trying to build -- can you please send the code? Thanks !

rochebox@gmail.com

About This Instructable

90,976views

125favorites

License:

More by icky_unicorn:5x5 LED Cube (Arduino Uno)
Add instructable to: