LED Cube 4x4x4

Amazing 3 dimensional LED display.

64 LEDs makes up this 4 by 4 by 4 cube, controlled by an Atmel Atmega16 microcontroller.
Each LED can be addressed individually in software, enabling it to display amazing 3d animations!

8x8x8 LED cube now available, by popular demand:

Remove these adsRemove these ads by Signing Up

Step 1: What you need

First of all, you need quite a bit of time to solder together 64 leds ;)

Knowledge list:
  • Basic electronics and soldering skills
  • Know how to program an AVR microcontroller - I will not cover that in this instructable.

Component list:
  • Protoboard. The type with copper circles.
  • Atmel AVR Atmega16 microcontroller
  • Programmer to program the Atmega16
  • 64 Leds
  • 2 status leds. I used red and green. (optional)
  • Max232 rs-232 chip, or equivalent.
  • 16 resistors for leds. (100-400ohms) will get back to this.
  • 2x resistor 470 ohm. for status leds
  • 1x resistor 10k
  • 4x resistor 2.2k
  • 4x NPN transistor BC338 (or other transistor capable of switching 250-ish mA)
  • 1x 10uF capacitor
  • 1x 1000uF capacitor
  • 6x 0.1uF ceramic capacitor
  • 2x 22pF ceramic capacitor
  • 1x crystal 14.7456 MHz
  • 2x tactile button
  • optional pwr switch
  • connector for 12v power
  • optional connector for 5v power

egange4 months ago
I recently made the cube. but i only have arduino to control it. Does anyone converted chr animation code to arduino? please helpp...
Steve25 egange3 months ago
I gues not, but why don't you buy an usbasp from ebay? It will cost you only 3 euro!
Sir can we use atmega 16 A instead of given above as I am only gettin A one on ebay so.... Please rply sir
egange Steve253 months ago
i already have asbasp programmer but i don't have Atmega32-16PU 40 pins. only atmega328 w/ 28 pins. im quite new in programming micro-controllers. i need to traslate chr code to be used in atmega328 or arduino. please helpp. :D
kchauhan9 days ago

Sir What is the total cost of whole project in INR ?

kchauhan9 days ago

Sir What is the total cost of whole project in INR ?

waka20073 months ago
I want to make this for my first real project. I was wondering how important are the transistors and the capacitors. I have seen cubes that run with just LEDs and resistors so why the extra stuff?

The short answer is because he built his development board from scratch. If you look at an Arduino, all those components are placed on the board when it is manufactured (and then you have the input/output pins to use).

temi26 days ago

can any one post me the 4x4x4' 'compiled' hex.? i cannot compile it withStudio6.0, talk less of programming it with my TL866A.

alexcavazos672 months ago

I just published a 3D-printable template for this project. I hope it is helpful to anyone out there.

photo 1.JPG
Hi guys
I built the circuit without the rs232-interface and programmed the (above attached) hex-file to the chip with a separate programmer. The status-leds are working, but none of the led's are lighting up. I measured the outputs (at cathode out from transistors and anode) and was surprised when my multimeter gave me a negative voltage.
Has anyone experienced the same problem ever?
I build it to without the rs232 interface and did not have that experience. Did you connect you're transistors right? My transistor had an TO-92 package (CEO). I nearly connected them wrong.
Hi Steve, You were right. I connected the transistors wrong. Now some Leds are lighting up but they only go on for about 10 secs and off again. Did you program the chip in circuit as in this instructable or on a separate programmer?
Yes i followed all steps in this guide. When i uploaded the program, 4 rows didn't light up. But after setting the fusebits it worked perfect.
If you also followed all the steps there might be an problem in you're wiring.

Hi Steve
It's running now! I indeed set the fuses wrong. thanks for your help! all the best
Great to hear! I'm happy that you got it working.
I build it to without the rs232 interface and did not have that experience. Did you connect you're transistors right? My transistor had an TO-92 package (CEO). I nearly connected them wrong.
erdiegange4 months ago
Can i use 16Mhz Crystal instead of 14.7456?
I just cant wait if ill buy the exact 16Mhz that i need. xD
manoulis4 months ago
Hey dude, nice work there, I'm trying really hard to make one myself, I have entered the atmel site but I see two different types of Atmel AVR Atmega16 microcontroller in PDIP.

Here is the link of the site too:

Can you please tell me which one should I order ??? Thank you in advance
Steve25 manoulis4 months ago
I bought the atmega16-16PU. But you can use the atmega16-8PU aswell so the choice is yours
Steve254 months ago
male connector 2x5 rm 2,54mm? Bought it at conrad
thanks really appreciate.

Miguel3105c5 months ago
hi guys as am new in electronic i would like to know from where do you get the socket for the AVR PROG coz i really cant find one and the name plz thanks
Miguel3105c5 months ago
hi guys as am new in electronic i would like to know from where do you get the socket for the AVR PROG coz i really cant find one and the name plz thanks
sadomukas5 months ago
Thank all for answers. Now I have othe trouble, not all of leds is working and some always lithing very brightly.
Steve25 sadomukas5 months ago
Hi sadomukas. I can't tell what's causing this problem i only can give you suggestions. First check out you're connections again. If that's all good then check you're resistor value's. If the value's are good as well then check you're leds. There is a possibility that you're leds are damaged. To check this out, take out you're volt meter and put it on bleep ore diode. You're Leds should light up when you touch them. If they do not then they are broken and should be replaced.
If this is all good then the last thing i can think of is that you broke you're chip again.

Hope this will help you out good luck again!
sadomukas5 months ago
Hi everyone. Please help for me. I have done this cube, but when i try to programme it LM 7805 makes verry hot ant computer cant connect to atmega16 im using programmer:

I have destroyed 4 atmegas16 and i spended a lot of money. please help for me
Steve25 sadomukas5 months ago
An another suggestion if you use you're usbasp with windows you should install a driver for it. This can be the reason why you can't connect you're computer to you're atmega16! This driver can be found at This driver is called

Good luck and hopefully you can get it working!
Steve25 sadomukas5 months ago
Hi sadomukas. The firsting you should check are you're connections? Is everything connected right to you're ATMEGA16?
If you are programming don't connect you're 12v power supply! You're programmer already giving 5v! If you do you can cause alot of damage to you're chip and circuit!
Did you change the programmer in you're program to usbasp instead of usbtiny?
And at last did you use the right resistors?

Hope this suggestions will help you out! Goodluck
Steve256 months ago
Hey chr i got a couple of questions. I want to build this cube but why did you put in jumper 3? Its not standing on you're components list so can i leave it out? And why do you have connected a connector to the 323max ic? Well hope to get a respond so i can start building!
mrdrako6 months ago
I made a scrolling font that works on this 4x4x4 cube. By making the font 4 wide by 5 tall, and scrolling vertically, it becomes recognizable. It required a new file, font.c, and some changes/additions to draw.c, and you have to add an #include line in main.c. If you are interested, it can be found on github here:
aneamţu7 months ago
Thanks a lot for this instructable. I built one too and it's running your code.

mrdrako7 months ago
Awesome job. I just finished building mine. I have one issue, hoping someone can make a recommendation on. The column that connects to pin 29 of the chip does not work. There is continuity from the pin to the column, so it's not a break in the circuit. I am not sure how to troubleshoot. Any ideas? Other than that column, it works beautifully.
mrdrako mrdrako7 months ago
Disregard. For some reason the pin was not making contact in the socket. Removed and reseated the chip and it works!

Now I can start playing around!
tboultwood17 months ago
For the metal bracing, what sort of wire did you use? Not sure on what to buy for that :S Great guide!
Cubytus8 months ago
Would it be possible to power a 5x5 cube using the same AVR, but using different code? How would that be possible? regards
Cubytus8 months ago

I want to start constructing this 4x4x4 monochrome LED cube since I have a ton of big yellow LEDs I can't find any use for. I just noticed that I still have a plenty of LEDs, so would I be able to drive a 5x5 cube with slighty changing the code of the Atmel AVR, without any other change? Or does it need a bigger power supply?

xsandman.328 months ago
Hey, just wanted to say thanks for this incredible instructable! I finished my cube a couple weeks ago (nearly) flawlessly by following these directions. Next up: an 8x8x8, and learning to etch the pcb in an attempt to make the circuit footprint smaller.
Hi there , I just built this version of a rgb 4x4x4 cube
Since it uses Ardunio the code is quite different ... Is there a way to Translate your animations , so that they would work with the cube I built?
viveksridhar9 months ago
Can you let me know if I'm calculating the resistor values for the transistors correctly?

Since there are 16 LEDs connected to each transistor, the current limiting resistor for those LEDs would be 40 ohms.

If I'm using a 2N2222 transistor (Hfe = 100), with the base voltage at 5v, wouldn't the base resistor be 312 ohms?

Sorry if this is a stupid question, but I'm just trying to understand how you get the resistor values and how they relate to the transistor and everything.

Get More Out of Instructables

Already have an Account?


PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!