4x4x4 led cube

Hello there,

I made an 4x4x4 led cube with 4 layer connecting to the A0 A1 A2 A3 pin of the arduino uno and then the 16 columns connecting to the A4 A5 1 2 3 4 5 6 7 8 9 10 11 12 13 pins. I havent use any resistors. I have a little question if i turn all leds on through the arduino the ampèrage is way to high so i want to put in some transistors but i am new to this so a little help could come in handy. I've read a great deal about it but still i want some help of people who have experience and an answer to my question soo. What can i put a transistor before every layer pin? So 4 in total? What kind of transistors do i need and how do i connect them to the cube and arduino? Btw i use 5mm blue led they need to have aboit 2.7v to shine bright. I hope to find some answers. Thanks in advance.

Ps. If you need to know anything else i am will give the information you need.

If you have arranged your LED’s this way round and your Arduino is running on 5v…

Diagram:

Yours,
TonyWilk

led_drive.png

So you are saying i need an 220 ohm resistor before every pin? And a 1k ohm resistor between the resistor and transistor?

The pins 1 2 3 4 5 6 7 8 9 10 11 13 A4 A5 are the cathodes and the pins A0 A1 A2 A3 are the anodes

I have soldered it like this yt-clip https://youtu.be/2BlVUKW5hL0

Gio008: I have soldered it like this yt-clip https://youtu.be/2BlVUKW5hL0

I lost patience after the ad and minutes of demo. Few people here have the time to sit through TV shows to find out a wiring scheme. Please post a schematic. Something like reply #1, showing how it's connected.

Gio008:
So you are saying i need an 220 ohm resistor before every pin?
And a 1k ohm resistor between the resistor and transistor?

Yes.
220ohm limits the LED current to around 12mA, a total 16x12= 192mA for all LEDs which is just within the absolute maximum for the Arduino’s pins.
The 1k limits the base current for the transistor.

The pins 1 2 3 4 5 6 7 8 9 10 11 13 A4 A5 are the cathodes and the pins A0 A1 A2 A3 are the anodes

Ah. unlucky.

Diagram:

Yours,
TonyWilk

P.S. vid: Nice LED cube.

Thanks for the advice tony wilk,

So you are saying i need 2 transistors in every layer 1 1k and 1 10k resistors for each transistor and for each column an 220 ohm resistor

And will it the code be different due to the transistor? Because one is an pnp and te other an npn?
Sorry for the many question the +5v where can i get this from
I have an 9v battery can i use that

Gio008: So you are saying i need 2 transistors in every layer 1 1k and 1 10k resistors for each transistor and for each column an 220 ohm resistor

Yes. You need 4 sets of the 2 transistors + 3 resistors for the layer drives. and 16 x 220ohm resistors, one for each column drive pin.

will it the code be different due to the transistor? Because one is an pnp and te other an npn?

The code will be the same, that's why I left the NPN transistor in there. (i.e. a high on the pin turns on the NPN which turns on the PNP which lights the LEDs)

the +5v where can i get this from

What are you running the Arduino from? A 5V USB supply will be Ok for this.

You cannot use 9V directly, it may blow up the arduino pins used for the column drives.

Yours, TonyWilk

I have an modified usb so i can put 5v in the 5v pin in the arduino (red wire) and the other black wire in the ground pin in the arduino. Will this be sufficient or do i need to power the transistor direclty with 5v? And if so how can i manege to do this with one usb cable?

Yet again sorry for the many question

Connect your 5V (red wire) to the Arduino 5V and to the transistor circuits The ground (0V, black wire) connects to the Arduino GND and to the transistor circuits.

Yours, TonyWilk

So i need 5 red wire cables for the arduino and the 4 layers same for the black wire how can i manage that from 1 modified usb cable witch only contains 1 red wire and 1 black wire. So in short how can i manage to power all the 5 circuits with one usb cable. Or do i need to hace 5 different usb cabbles?

I have powered everything like you said i have soldered everything like the schematic but now 6 columns wont light up. What can i do?

Gio008: ... but now 6 columns wont light up. What can i do?

So 10 columns light up ok in all 4 layers ?

Send some pictures, must be just bad connections or something.

Yours, TonyWilk

Yess in the other 10 columns al 4 layers will lit perfeclty amd i have measured the voltage and ampèrage and this is 26.5 V an 20 mA constantly but only in the other 6 the voltage is to low to let the led be lit.

I will solder all the 6 columns again but here are some pictures i liked to share them bcuz is looking amazing

Update: i have checked everything and the resistors are not working so if i replace them everything will be alright. I’m going to do this tomorow in class and i will make a vid about the process and result i will post the yt link in this forum thread so you can watch it thanks for the help it was a big deal for me.

LEDs.pdf (390 KB)