5x5x5 LED cube on a 40x2

klauze

New Member
Hello Everyone,

I have just finished building my first PICAXE project and I'm elated to report that it's working !
I did some research (no too much) before endeavoring to build an LED cube , and I found that on most builds people used LED drivers IC's connected through I2C. Not knowing that much about I2C protocol and addressing, I've then decide to build my cube using little more than transistors.
I've done the wiring diagram in ExpressPCB, which is free and very easy to use. I've then printed and transferred the circuit onto a board and started my adventure.
The cube revolves around the PICAXE 40x2, due to the fact that it has the most outputs, as 30 outputs are required to build a 5^3 cube with no i2c multiplexing.
Each layer is powered through a BD135 (NPN) transistor and all the 25 LED's on a layer are then sunk to ground via 3 Darlington arrays (ULN 2830) + one BV547 -so it adds up to 25. The load is also divided through 25 resistors (100Ohms).
The PIC itself has a voltage regulator (LM7805 + 4 capacitors) , just to make sure I don't fry it :D
As this is entirely designed by me, I'm sure it has plenty of bugs , therefore any comments on the whole thing are welcomed.

This is the wiring diagram:
click to view
This is the ExpressPCB file: click to download

The simplest way to build an LED cube is to construct a rig to hold it all in place. I've used a 5 millimeters drill bit and a plank that I had.
I've drawn the matrix using a ruler and a pencil and got "old sparky" (my boring machine) out of the closet.
click to view

I've then soldered the anods of the LED in a matrix. After that I've added a touch of molted plastic between the leads to prevent short circuits and to fix it in place.
click to view

At the end of the day that's how the cube looked. I know it's not very pretty, but it does the trick.
click to view

Now to build the PCB board.
I've printed the diagram on a laser printer (must be laser) using glossy photo paper.
If you want to to this, I advise not to buy the cheapest paper, as it is really hard to clean afterwards.
click to view

I've then cut the printed part using a new cutter. You must be careful not to touch the paper as grease from your hands might prevent the ink from transferring.
Once I got the paper cut, I've then used a small saw (or whatever that is called in her's Majesty Language :) ) and cut out the pcb.
click to view

Once you got that sorted. You need to clean the copper side using dish washing detergent and the abrasive side of a sponge.
If will look quite scratched, but that's good as it offers the ink a good surface to stick to.
With all that done, I've placed the paper over the copper side and ironed it really well (just like ironing a shirt).
Be careful as the surfaces gets very hot. With that sorted, I've then rinsed the whole thing in warm water, peeled of the paper and scrubbed the now printed copper with a tooth brush. Dipped it in worm feric cloride for 4 minutes and ...voila ! the PCB board.
click to view

The next step I did ,was to drill the 0.7 mm holes for the IC sockets and so on. Well, all except the voltage regulator (LM7805) and the BD transistors , as they required 1mm holes. So does the jack socket.
click to view

With that sorted, I've then added all the parts to the board , starting with the jumper wires, then the IC sockets and so on.
click to view

I kept the diagram on the computer's monitor to cross-reference where things go. I also checked various connection points on the board using the multimeter to ensure that parts got properly soldered.

Then comes the tricky part. I've enlisted the help of a friend and even so it took us about 45-50 minutes to mount the cube.
Getting the LED cube cathodes in the PCB board , it's not an easy task , as they warp and you run the risk of breaking them.
Oh ! Just before fitting the cube to the board I ran 5 small wires from each level down to where all the cathodes were. In that way I could connect them easily to the board afterwards with a small set of tweezers.
click to view

With everything in the right place, I've quickly plugged the wire to the computer's serial port and did a quick program.
P.S. The way I wired the jack socket is specific to me . It has nothing to do with the PICAXE cable ! Just using the same socket - not the same pinout
I turned the power on ... and IT WORKED.
click to view
Even my cat seems to be enjoying it :)

This is a video, of a test run. The software is not all done .. but , it does very neat stuff

Thanks for reading my lengthy post. Feel free to comment.
Cheers,
Claudiu
 

westaust55

Moderator
@klauze/Claudiu,
Welcome to the PICAXE forum.

Well done with your 5x5x5 LED cube.
If you were to include your schematic diagram and program code listing that would likely be very helpful to others who wish to follow in your footsteps.

Should you wish, this can be moved to the Finished Projects section (maybe the audio/Visual section)
 

KD5UND

New Member
really interested in code

Really interested in the code you developed. I have a similar but different project involving 24 tri-color LEDs and am having trouble getting off the ground with it
 

MPep

Senior Member
Really interested in the code you developed. I have a similar but different project involving 24 tri-color LEDs and am having trouble getting off the ground with it
So effectively you want to control 72 LEDs (3*24)?? Wow.... impressive feat for even considering this :).
 

westaust55

Moderator
Really interested in the code you developed. I have a similar but different project involving 24 tri-color LEDs and am having trouble getting off the ground with it
@KD5UND

Welcome to the PICAXE forum.

For the RGB LEDs, I did a project back in 2008 with an 8x8 matrix of RGB LEDs via i2c using two MCP23017 i2c IO Expander chips and simple multiplexing.
Have a read here: http://www.picaxeforum.co.uk/showthread.php?10836
The real project starts around post 21 on page 2.
 

klauze

New Member
Really interested in the code you developed. I have a similar but different project involving 24 tri-color LEDs and am having trouble getting off the ground with it
Hello there,
This is the link to the code I've done for the YT video.
http://reallyfatcat.com/picaxe/yt-code.bas

I'm very poor when it comes to commenting my code :D , but I'll be more than happy to answer any question about it.
The first thing I did was to assign symbols to my pinouts. I did that with the diagram in front of me.
Now instead of addressing c.4 or b.2 ETC , all I have to do is say ... LayerA or LayerB on or off ... and which LED... LED1, LED4,LED25.
Hope this sheds some light.


Kind regards, Claudiu
 

westaust55

Moderator
Thank you klauze/Claudiu.

Your present PICAXE code included here for all to quickly see.

Done in case anyone has internet restrictions from a School, etc to various sites and just in case (heaven forbid) the reallyfatcat website is disbanded or similar reasons the code is no longer available.



Code:
symbol LayerA= c.5
symbol LayerB= d.4
symbol LayerC= c.6
symbol LayerD= c.7
symbol LayerE= d.5
Symbol LED1= a.7
Symbol LED2= a.6
Symbol LED3= a.5
Symbol LED4= d.6
Symbol LED5= a.3
Symbol LED6= a.0
Symbol LED7= a.1
Symbol LED8= a.2
Symbol LED9= b.7
Symbol LED10=b.6
Symbol LED11=b.1
Symbol LED12=b.2
Symbol LED13=b.3
Symbol LED14=b.4
Symbol LED15=b.5
Symbol LED16=d.1
Symbol LED17=d.2
Symbol LED18=d.3
Symbol LED19=c.4
Symbol LED20=b.0
Symbol LED21=c.0
Symbol LED22=c.1
Symbol LED23=c.2
Symbol LED24=c.3
Symbol LED25=d.0
Test:

for b5=1 to 255
high layera
high led1,led2,led3,led4,led5,led6,led10,led11,led15,led16,led20,led21,led22,led23,led24,led25
pause 1

low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25
low layera


high layerb:high led1,led5,led21,led25:pause 5:low layerb
high layerc:pause 5:low layerc
high layerd:pause 5:low layerd
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25
high layere
high led1,led2,led3,led4,led5,led6,led10,led11,led15,led16,led20,led21,led22,led23,led24,led25
pause 1
next b5

High led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25

For b1= 255 to 10 step-10
High LayerA,LayerB,LayerC,LayerD,LayerE 
pause b1
Low LayerA,LayerB,LayerC,LayerD,LayerE  
pause b1
next b1

low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25
Low LayerA,LayerB,LayerC,LayerD,LayerE  

High LayerA,LayerB,LayerC,LayerD,LayerE 

For b2= 1 to 255 step 10
High led1,led3,led5,led7,led9,led11,led13,led15,led17,led19,led21,led23,led25
Low led2,led4,led6,led8,led10,led12,led14,led16,led18,led20,led22,led24
pause b2
Low led1,led3,led5,led7,led9,led11,led13,led15,led17,led19,led21,led23,led25
High led2,led4,led6,led8,led10,led12,led14,led16,led18,led20,led22,led24
pause b2
next b2

low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25
Low LayerA,LayerB,LayerC,LayerD,LayerE  


High led5,led4,led3,led2,led1,led6,led11,led16,led21,led22,led23,led24,led25,led7,led8,led9,led10,led17,led18,led19,led20,led12 'C
High LayerA:pause 100
High LayerB:Low LayerA: Pause 100
High LayerC:Low LayerB: Pause 100
High LayerD:low LayerC:Pause 100
High LayerE:Low LayerD:pause 2000
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25,Layere

High led1,led2,led6,led7,led11,led12,led16,led17,led21,led22,led23,led24,led25,led18,led19,led20 ' L
High LayerA:pause 100
High LayerB:Low LayerA: Pause 100
High LayerC:Low LayerB: Pause 100
High LayerD:low LayerC:Pause 100
High LayerE:Low LayerD:pause 2000
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25,Layere

High led2,led3,led4,led6,led7,led8,led9,led10,led11,led12,led16,led17,led21,led22,led18,led14,led15,led19,led20,led24,led25 ' A
High LayerA:pause 100
High LayerB:Low LayerA: Pause 100
High LayerC:Low LayerB: Pause 100
High LayerD:low LayerC:Pause 100
High LayerE:Low LayerD:pause 2000
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25,Layere

High led1,led2,led4,led5,led6,led7,led9,led10,led11,led12,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25 ' U
High LayerA:pause 100
High LayerB:Low LayerA: Pause 100
High LayerC:Low LayerB: Pause 100
High LayerD:low LayerC:Pause 100
High LayerE:Low LayerD:pause 2000
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25,Layere

High led1,led2,led3,led6,led9,led11,led14,led16,led19,led21,led22,led23 'D
High LayerA:pause 100
High LayerB:Low LayerA: Pause 100
High LayerC:Low LayerB: Pause 100
High LayerD:low LayerC:Pause 100
High LayerE:Low LayerD:pause 2000
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25,Layere

High led3,led13,led18,led23 'i
High LayerA:pause 100
High LayerB:Low LayerA: Pause 100
High LayerC:Low LayerB: Pause 100
High LayerD:low LayerC:Pause 100
High LayerE:Low LayerD:pause 2000
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25,Layere


High led1,led2,led4,led5,led6,led7,led9,led10,led11,led12,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25 ' U
High LayerA:pause 100
High LayerB:Low LayerA: Pause 100
High LayerC:Low LayerB: Pause 100
High LayerD:low LayerC:Pause 100
High LayerE:Low LayerD:pause 2000
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25,Layere


'snake
High LayerA
High led1:Pause 30:High led2 : Pause 30 : High Led3 : Pause 30 : high led4 : Pause 30 : high led5 : Pause 30 : high led6 : Pause 30 : high led7 : Pause 30 : high led8 : Pause 30 : high led9 : Pause 30 : high led10 : Pause 30 : high led11 : Pause 30 : high led12 : Pause 30 : high led13 : Pause 30 : high led14 : Pause 30 : high led15 : Pause 30 : high led16 : Pause 30 : high led17 : Pause 30 : high led18 : Pause 30:high led19:Pause 30:high led20:Pause 30:high led21 :pause 30:high led22:Pause 30:high led23:Pause 30:high led24:Pause 30:high led25
high layerb
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25
High led1:Pause 30:High led2 : Pause 30 : High Led3 : Pause 30 : high led4 : Pause 30 : high led5 : Pause 30 : high led6 : Pause 30 : high led7 : Pause 30 : high led8 : Pause 30 : high led9 : Pause 30 : high led10 : Pause 30 : high led11 : Pause 30 : high led12 : Pause 30 : high led13 : Pause 30 : high led14 : Pause 30 : high led15 : Pause 30 : high led16 : Pause 30 : high led17 : Pause 30 : high led18 : Pause 30:high led19:Pause 30:high led20:Pause 30:high led21 :pause 30:high led22:Pause 30:high led23:Pause 30:high led24:Pause 30:high led25
high layerc
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25
High led1:Pause 30:High led2 : Pause 30 : High Led3 : Pause 30 : high led4 : Pause 30 : high led5 : Pause 30 : high led6 : Pause 30 : high led7 : Pause 30 : high led8 : Pause 30 : high led9 : Pause 30 : high led10 : Pause 30 : high led11 : Pause 30 : high led12 : Pause 30 : high led13 : Pause 30 : high led14 : Pause 30 : high led15 : Pause 30 : high led16 : Pause 30 : high led17 : Pause 30 : high led18 : Pause 30:high led19:Pause 30:high led20:Pause 30:high led21 :pause 30:high led22:Pause 30:high led23:Pause 30:high led24:Pause 30:high led25
high layerd
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25
High led1:Pause 30:High led2 : Pause 30 : High Led3 : Pause 30 : high led4 : Pause 30 : high led5 : Pause 30 : high led6 : Pause 30 : high led7 : Pause 30 : high led8 : Pause 30 : high led9 : Pause 30 : high led10 : Pause 30 : high led11 : Pause 30 : high led12 : Pause 30 : high led13 : Pause 30 : high led14 : Pause 30 : high led15 : Pause 30 : high led16 : Pause 30 : high led17 : Pause 30 : high led18 : Pause 30:high led19:Pause 30:high led20:Pause 30:high led21 :pause 30:high led22:Pause 30:high led23:Pause 30:high led24:Pause 30:high led25
high layere
low led1,led2,led3,led4,led5,led6,led7,led8,led9,led10,led11,led12,led13,led14,led15,led16,led17,led18,led19,led20,led21,led22,led23,led24,led25
High led1:Pause 30:High led2 : Pause 30 : High Led3 : Pause 30 : high led4 : Pause 30 : high led5 : Pause 30 : high led6 : Pause 30 : high led7 : Pause 30 : high led8 : Pause 30 : high led9 : Pause 30 : high led10 : Pause 30 : high led11 : Pause 30 : high led12 : Pause 30 : high led13 : Pause 30 : high led14 : Pause 30 : high led15 : Pause 30 : high led16 : Pause 30 : high led17 : Pause 30 : high led18 : Pause 30:high led19:Pause 30:high led20:Pause 30:high led21 :pause 30:high led22:Pause 30:high led23:Pause 30:high led24:Pause 30:high led25
pause 3000
low layerc
pause 1000
low layerb:low layerd:pause 1000

for b3=255 to 10 step-10
low layere
pause b3
high layere
next b3

pause 500
low layere:high layerd
pause 500
low layerd:high layerc
pause 500
low layerc: high layerb
pause 500 
low layerb
low led1:Pause 30:low led2 : Pause 30 : low Led3 : Pause 30 : low led4 : Pause 30 : low led5 : Pause 30 : low led6 : Pause 30 : low led7 : Pause 30 : low led8 : Pause 30 : low led9 : Pause 30 : low led10 : Pause 30 : low led11 : Pause 30 : low led12 : Pause 30 : low led13 : Pause 30 : low led14 : Pause 30 : low led15 : Pause 30 : low led16 : Pause 30 : low led17 : Pause 30 : low led18 : Pause 30:low led19:Pause 30:low led20:Pause 30:low led21 :pause 30:low led22:Pause 30:low led23:Pause 30:low led24:Pause 30:low led25



Goto test
 
Last edited:

klauze

New Member
Many thanks Westaust55,

That's very thoughtful of you. The site will be up as long as it pays it's own bill :D and lately that has not been the case :( . However, you are right . It will probably be banned from most school gateways as it's adult/humor orientated.

Regards, Claudiu
 

Paix

Senior Member
Many thanks Claudiu.

The rig is a jig and a very good way of ensuring an accurate matrix of LEDs. You can never have too many jigs for making repeatable structures.

The saw is a fret saw. A very neat and impressive project.
 
Top