# LED Cube 3x3x3 with ATMEGA8

An interesting project and already much discussed in the forums and also in videos.
Although it appears complex,it is a simple idea and fun very purpose.

Mounting material:

- 27 LEDs matte
- Microprocessor ATmega8
- Electrolytic capacitor 47UF 16V
- Veroboard
- Small wood board at the minimum 10x10cm
- 50 cm wire tinned

(excuse me, I'm portuguese and my english is not very famous :p)
Remove these ads by Signing Up

## Step 1: Theory of operation of the array of LEDs

The array of LEDs is comprised of 3x9, where three levels are horizontal, and 9 are the vertical rows.
Each LED is turned on a level with a common cathode and each vertical line is connected with a common anode.
So if we want to illuminate a particular LED, just put the level of the 0V line and gave a positive voltage.

To be able to generate an effect of several LEDs on, they have to be powered by multiplexing, a relatively high speed does not seem to be blinking and have a softer light.

As the ATmega8 supports connection of LEDs directly to its pins with a good current, there is no need to put limitation resistors or  transistors driver.

## Step 2: Creating horizontal levels of the LEDs (negative)

Here becomes more complicated as the presentation of the outcome depends on the linearity on which the LEDs are soldered.
To make it to nine holes with a diameter of 5mm, a board 2cm intervals, where the LEDs can be confident, to be soldiers and bend the terminals in a specific way.

Cathode (negative):
After the LEDs are fixed on board, can be double the cathodes in order to get all nine together, taking care not to bend the center. As the terminals of the LEDs are not sufficient to make the 12 connections, you can use one wire tinned in order to be more esthetic final result.

Anode (positive):
In relation to the anode, must all be folded the same way, so that when you turn the LEDs below it easier to make its welding. Then each anode of the LED, is bent out of its center, and then bent upward at the end of this limit.

These processes are performed for the three horizontal levels in the same way, removing the cathode from the center that will connect directly to Veroboard, creating the negative phase of this level.

## Step 3: Creating the vertical rows of LEDs (positive)

Now the three horizontal levels must be attached from the vertical rows, which are the anodes.

In this case the level of the top is attached to the board where they made the holes.
Weld in the center of the cathode terminal, an enameled wire so that it is long to reach Veroboard.

The following relates to grasp the 2nd level which is fixed to the board, solder to all the anodes of the LEDs that were upright, overlapping about 10mm between these two levels.

After being welded, as can also weld the central cathode in order to reach the Veroboard.

With the lower level, the process is similar to the 2nd level

## Step 4: Preparing Veroboard

This card is pre-drilled very practical to do this kind of setups.
Has 5.5 cm x 5.5 cm and in the attached picture you can see the location of the holes, which aids in welding wire your circuit on the tin.

Given the orientation of the atmega 8 and the condenser, it is advisable to place a support for this microprocessor. This microprocessor has an ISP interface, which allows its programming via 5-wire circuit, without the need of a crystal oscillator.

After the entire circuit to be soldered, it is advisable to have mount the microprocessor, because when you take the cube of LEDs on top, it becomes complicated apply it.

## Step 5: Assembling the cube of LEDs on Veroboard

Following the photo attached, plug the hub is not complicated, taking into account the connection of the cathode of each level to the hole.

For this, they were numbered to facilitate their identification in this phase.

After welding the anodes of each vertical row over the condenser, the cube of LEDs is ready to be programmed.

Power can range from 4.5V to 5V, advising not to keep the LEDs lit a lot of time in your schedule, the microprocessor delivers 40mA for each output line of doors, which would burn the LED for this might be a resistance soldier temporarily 330R between the outputs of the microprocessor and the cathodes, which are 3.

## Step 6: Programming

Finally completed this setup, it is now one of the programming process; there is much documentation to program this type of microprocessor on the Internet.

This is the map of addresses for access to ports, is formatted in AVR, and a corresponding LED to light up, just pick a position matrix of the "PtC" and the same position of "PtD":

PtC:
.db 0b00000101, 0b00000101, 0b00000101, 0b00010101, 0b00001101, 0b00000101, 0b00000101, 0b00000101, 0b00000101, 0b00000110
.db 0b00000110, 0b00000110, 0b00010110, 0b00001110, 0b00000110, 0b00000110, 0b00000110, 0b00000110, 0b00000011, 0b00000011
.db 0b00000011, 0b00010011, 0b00001011, 0b00000011, 0b00000011, 0b00000011, 0b00000011, 0

PtD:
.db 0b00001000, 0b00000010, 0b00000100, 0b00000000, 0b00000000, 0b00010000, 0b00100000, 0b01000000, 0b10000000, 0b00001000
.db 0b00000010, 0b00000100, 0b00000000, 0b00000000, 0b00010000, 0b00100000, 0b01000000, 0b10000000, 0b00001000, 0b00000010
.db 0b00000100, 0b00000000, 0b00000000, 0b00010000, 0b00100000, 0b01000000, 0b10000000, 0

Knowing that this is the concept of the multiplex circuit, it is a matter of time if you can master this technique and create stunning visual effects.

You can see a demonstration of some effects built with this cube of LEDs in this site:

Have fun with this project :)

heyyy can you send me the schematics , the hex file and the board diagram in my email because i have to make a project Email-kanishk.kanishk.gupta@gmail.com

thank you very much

valexa1 year ago

I woud like to have the hex file for 3x3x3 cube led with atmega8.How much does it cost?What is the method of payment for the acquisition of the hex file?

Thank you!

G7Electronica.NET (author)  valexa5 months ago

sorry the delay..

you can buy the atmega with the code here:

http://www.g7electronica.net/pt/firmwares/113-atmega8-firmware-cubo-de-leds-3x3x3.html

syamsul.oenich8 months ago

thank you for your share. i will try to make led cube based you shared.

matur suwun kang mas.

valexa1 year ago

I have 10 years old and please send the program hex.Thank you!

himansh1 year ago

can you give me hex for this only?

Is here any program for ATmega8 like showed here: http://www.instructables.com/id/3x3x3-LED-Cube/?ALLSTEPS

JenangKa2 years ago
cool, but with more IO ports, this project become awesome, thanks for the tutorial
BIGDOG19712 years ago
Very nice.. cool!
Great Job.

azharz2 years ago
Very nice project I loved it
.
can u plz send the code fo the program?
domdomgin4 years ago
please can you send me a hex file and schematics as i have a project..my email id is domdomgin@yahoo.com..thanks/..
G7Electronica.NET (author)  domdomgin4 years ago
Sorry, but we can not provide the HEX file because it is a prototype, the final version is only available for sale.
A lot of work to develop this project and we can only "give" this micro programmed, if you're interested.
4 years ago
ok how do i purchase
4 years ago
dont bother buying it theres other instructables giving out the code
4 years ago
where do i buy the programmed ic from
4 years ago
http://www.g7electronica.net/atmega8/113-atmega8-firmware-cubo-de-leds-3x3x3.html
spata4 years ago
this project is very hard. please give another preoject without programming or giving any thing.
Hi! G7Electronica.NET
How you programm ground for layers?
Thanks!
domdomgin4 years ago
cllzzrd4 years ago
How large are the holes that you drilled in the board? I know they are LED sized, but how wide is that? I would like to know so my LED's dont slide around in the hole when i am trying to solder them.
G7Electronica.NET (author)  cllzzrd4 years ago
I usually make the holes for component leads to 0.8mm in diameter, despite being a Veroboard this assembly, the default is always the same and 0.6mm might be too small.
Spydamonky4 years ago
You should combine this with this: http://www.instructables.com/id/DIY-3D-Controller/.

and play O's and X's with 2 color led's!! would be very nice
G7Electronica.NET (author) 4 years ago
I spent several weeks making a visual basic program to simulate the effects before sending to the firmware, the code was all done in pure AVR and has 800 lines.
Indippy4 years ago
Very nice!!! Well done!!!!! ;-))
G7Electronica.NET (author)  Indippy4 years ago
forte19944 years ago
You know i already did an instructable on a 4x4x4 cube already in this contest.
not fair...
G7Electronica.NET (author)  forte19944 years ago
And I did a 3x3x3 cube with 50 effects...
Sorry if you think it is unfair!..Where is your fairplay?!.. ?:/
Dropes4 years ago
Good description of the manufacture.
I've been watching the video and is amazing, never seen so many effects together in a cube of leds and with so few components

Good job, 5 stars
G7Electronica.NET (author) 4 years ago
At a level where the cathode of the LEDs have to be all together, bend these terminals to connect to an LED near, as there are only 9 LEDs per level, you can not make connections so that it is uniform. In the 1st photo you can see there are 12 horizontal links, not all are the terminals of the LEDs, but wires.
cllzzrd4 years ago
Wow! I really want to make one of these!

Can you explain what you meant when you said this?
"As the terminals of the LEDs are not sufficient to make the 12 connections, you can use one wire tinned in order to be more esthetic final result."
Hugu4 years ago
Very cool project! One of the best Led cube 3x3x3 I've seen out there!

Your video is magnificent and the effects are many and beautiful! :)