22 November 2012

How to Build a Simple LED Cube 4x4x4 - Part 1



Project Features
  • Easy to build
  • Only two active components (apart from the LEDs, of course)
  • Includes detailed build instructions, schematics and software

Introduction
When I posted my charlieplexed 4x4x4 LED cube I did so in order to show an alternative implementation for such a cube. Its unique feature is that it only uses 9 controller ports. For some reason it gets a lot of interest from lots of people. And I had quite a few requests for schematics because people wanted to build it.

The problem with it is that it is only simple in terms of hardware requirements. But it is relatively complicated to understand its structure. So I thought I should try my hands on a really simple, easy to build LED cube and write a post including build instructions for people with basic skills in electronics.



Required skills and knowledge
Unfortunately I cannot cover every last detail about how to build electronic circuits. So this is what you should be able to do:
  • Soldering wires and components
  • Programming the flash memory of an AVR ATMega8L
  • Reading simple schematics

Components you need

LEDs:
Obviously you will need 64 LEDs. I am using ultra-bright red 5mm LEDs for this project. They have a special shape called "straw hat" which give you a wide viewing angle.

Some LEDs have a very narrow viewing angle, like 15° for example. This means that most of the light goes straight up. But we want to look on the cube sideways. This is the reason why I chose the wide angle.

Choose what shape, size or colour you want. But if you use any other colour, this might mean that you need a higher operating voltage. My LEDs have a forward voltage (Uf) of around 2 Volts and the whole circuit will run off two AA batteries (3 Volts). It is also possible to run the cube with three AA cells to get brighter light. In that case the pulse current per LED will be around 50 mA which is fine.

My set of 100 pieces cost me under 3€. Value for money...

The only problem that I had with my LEDs was that their leads where relatively short. I simply didn't notice that, when I ordered them. But what it means is, that the cube got a bit smaller than intended. This is because I only use the leads to connect the LEDs to each other.

In general it is probably a good idea to get the gaps between the LEDs as wide as possible. Otherwise you have problems seeing all LEDs at the same time. But I didn't want to wait for another batch to arrive, so I went ahead anyway.

Controller:
Not much to say there. It is an ATMega8L in a DIP28 package. The "L" is important, because it means that the microcontroller can run at voltages down to 2.7 Volts. The version without the "L" needs at least 4.5 Volts. The Mega8 has got more than plenty of memory for generating a variety of effects or patterns - if you know how to generate them efficiently.

Prices vary depending on where you buy (2 € or more)

Driver:
The microcontroller's ports cannot drive more than one LED, so they need the help of drivers. I am using an ULN2803, which contains 8 separate drivers. It is available for under 0.50€.

Optional / Misc Components:
You will need some wire and quite likely a piece of perfboard. It might be a good idea to use sockets for the ICs. Depending on your power source you might need a battery holder. And finally, if you want to be able to change the firmware of the controller, a ISP connector will be useful.

The whole set of components can be bought for under 10€. Not too bad, I think.

How it Works
Basically, the cube is wired like a standard multiplexed LED matrix in a 8x8 configuration.

Most people seem to base their design on a 16x4 matrix. This has the advantage that the LEDs are multiplexed with a 1:4 duty cycle, whereas my design has a 1:8 duty cycle. So my design is less bright. But I found that even my charlieplexed LED cube with a duty cycle of only 1:9 is very bright - because I use ultrabright LEDs.

Another advantage of the 16x4 matrix is, that you only need to drive 4 groups of LEDs, for which many people use discrete transistor stages. There are 8 groups in my design. So I need 8 drivers. But since the IC that I chose has got 8 drivers, that is no real disadvantage.

One advantage which my 8x8 structure has, is that I need only 8+8=16 controller ports, whereas the 16x4 design needs 16+4=20 ports. This means less connections (i.e. less soldering, less wiring) and it leaves you with some ports for further extensions (e.g. switches, a serial connection, etc.)

Also,  I think, that my version is a little easier to build. This is because it really isn't a 4x4x4 cube, but instead consists of two independent 2x4x4 "half-cubes". In my opinion, these are much easier to assemble. Find the details about that in the next paragraph.

Building the Cube Structure
This is the hardest part. Building the 3D structure will take about 3 - 4 hours, depending on your soldering skills and patience. There are several steps in this build. Keep testing it! Once the cube is assembled, it is next to impossible to repair anything. So keep testing! I know why I say this, believe me...

TIP: A simple way to test LEDs is with a multimeter set to "diode test". The multimeter will drive a small current through the LED, so it will light up dimly. Try all possible combinations of connecting columns and levels of your cube with your test leads. Do this after every step. 

But first:

Step 1: Prepare the LEDs
The LEDs need some preforming of theirs anodes. We start with a standard LED.


Use pliers to hold the longer wire (the anode).



Make a 90° bend.


 And finally bend it the other way.


This is the result.


And here is the reason why we have to do this. The LEDs will be stacked later. In each column of the cube, the anodes of the LEDs will be used for this. And without the preforming, it would be difficult to reach the anode below. Here is a photo just to demonstrate that point. Note that we don't stack yet.



So keep repeating this until all of your 64 LEDs are prepared for step 2.

104 comments:

  1. how can you connect the ic to the computer, what do i need to buy.

    ReplyDelete
    Replies
    1. You need a so-called In-System-Programmer (ISP) for Atmel AVR chips. There are lots of tutorials on the net. -> Google!

      Delete
    2. thanks, I found something on ebay but i am not sure it will work, would you please check it for me,
      thanks again
      http://www.ebay.co.uk/itm/USB-ISP-Programmer-Download-Adapter-for-ATMEL-AVR-ATMega-51-ATMEGA48-for-Dell-/330817118286?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item4d063ca04e

      Delete
    3. The description fits the purpose.

      Obviously I know nothing about the dealer's reliability or the quality of this particular product.

      You find lots of (even cheaper) alternatives searching ebay for "usb isp avr" with the box "worldwide" ticked.

      I personally prefer the lcsoft version, sie my post about ISP programmers.

      Delete
    4. Thank you, but could you tell me how to connect the controller to the programmer

      Delete
    5. That is a bit difficult without knowing what programmer you actually use. But there is a quasi standard, derived from the pinout of Atmel's programmer:

      http://lmgtfy.com/?q=avr+isp+header+pinout

      This is a very good page:
      http://www.evilmadscientist.com/2007/using-avr-microcontrollers-minimalist-target-boards/

      Match the pinout with your Atmel controller's pinout (see data sheet: http://www.atmel.com/dyn/products/datasheets.asp?family_id=607)

      Done.

      Delete
    6. Do you connect all of the ground pins onto one pin on the controller? Thanks

      Delete
    7. Be careful there!

      You are probably asking about the header of the ISP programmer? Check the actual output of your programmer.

      I say this because e.g. the USBasp project (http://www.fischl.de/usbasp/) uses two of the ground pins as a serial interface. So my advice is to only use pin 10 of the header for ground connection.

      Delete
    8. Hey can you please tell me where to buy the controller (ATMega8L , DIP28) also are they available in India if they are please can you send me its link because I coudnt find it...

      Delete
    9. You could try Aliexpress or Ebay. But I can't say who would or would not ship to India.

      Delete
  2. But doesn't the ATmega8 have 24pins but the ISP 10?

    ReplyDelete
    Replies
    1. Actually, the ATMega8 comes in a DIP28 package (i.e. 28 pins). The ISP connector on the other hand uses 6 pins: +Vcc / Gnd / Reset / MISO / MOSI / SCK.

      The ISP interface is a serial interface, apart from power supply and reset, there are serial in / serial out and a clock.

      No other pins are needed for programming.

      Check out the controller's data sheet and application notes for details (www.atmel.com).

      Delete
  3. Can this project be done using solid core wire

    ReplyDelete
    Replies
    1. Not sure I understand the question.

      I see no reason why you couldn't use solid core wire.

      Delete
    2. Thank you because I was only thinking if it would be different and would affect the way you put together the top and bottom layer

      Delete
  4. How many volts did it use

    ReplyDelete
    Replies
    1. That was two AA cells for development and three AA cells for full brightness.

      But I used red LEDs. For blue LEDs I would use four cells.

      Delete
    2. I would like to use white LEDs, how many AA batteries would you suggest?

      Delete
    3. i would suggest to use 4 cells. White LEDs normally are just like blue LEDs.

      You could start with three cells and see if the brightness is sufficient for your purpose. And you can try to measure the current. Just create a pattern with only one LED activated.

      Remember that the LEDs are controlled with a duty cycle of 1:8, so the actual current of the LED can be much higher than its rated value. Also, the controller will not be able to drive enough current to destroy the LEDs.

      Delete
    4. Oh, and I have used 4 cells in the charlieplexed cube with no problem.

      Delete
  5. what type of PIC did you use?

    ReplyDelete
    Replies
    1. I didn't use a PIC, but an Atmel AVR ATMega8L - see section "Components" above.

      Delete
  6. Hello there! I was pleasantly surprised when I loaded this web page of your domain. What was the biggest motivation the moment when you followed the intention to make your first domain?

    ReplyDelete
  7. I want to make a 5x10 led matrix using this single chip method. Is that possible? I could really use some advice as it is my first project. Feel free to email me:

    Munderbob@gmail.com
    Or a comment is fine.

    ReplyDelete
  8. Hi Bob, that is possible. Actually, the cube is really a 8x8 LED matrix, shaped into a 3D form.

    You would have to modify te software somewhat, though.

    ReplyDelete
  9. hello, what if i don't have that ATmel ATtiny13v as a micro controller, what other micro controller would you suggest me to use? thanks!

    ReplyDelete
    Replies
    1. Actually, this design is using an AVR ATMega8L. This is a widely available chip. It is e.g. available via the bay. I am sure, other controllers work just as well, but I only use AVR chips, so I can't advise you.

      Delete
  10. Hi Tom

    Great instruction, I am building one myself hope it will soon lighten up my day :-)

    Thanks for your gread efford - Thumbs Up

    Best regards
    Peter - Denmark

    ReplyDelete
    Replies
    1. Hi Peter,

      special greetings to the Vikings from "south of the border". ;-)

      I hope you succeed. Have fun!

      Tom

      Delete
  11. abdullah hi tom turkey ham radio istayonu I run a very nice project, and I want to do it that would be great you submit drawings of ISIS and ARES

    abdullah_epik@hotmail.com

    ReplyDelete
  12. Thanks I am using proteus 7:10

    ReplyDelete
  13. Hi Abdullah,

    I am really sorry, but I don't have schematics in electronic form. All I have are the drawings in part 3. Did you see those?

    ReplyDelete
  14. Congratulations on your wonderful blog yes man. my english is bad sorry for that. inceliyorum schemes. If you assign a place to hang out tekarar meal. turkey love ...

    ReplyDelete
    Replies
    1. Thanks. Yes, well, your English is still much better than my Turkish. :-)

      Although, my wife has recently started to study your language, because we plan to go on holiday to Turkey this summer.

      So if you have any more questions I am sure we will find some form of communication.

      teşekkür ederim ;-)

      Delete
  15. Hi tom,

    Can you blease help about the programatic part, of the cube, it is done by circuits or this is some kind of processor ?

    Thank you

    ReplyDelete
    Replies
    1. Hi there,

      the project uses a microprocessor ATMega8L. See description in the post.

      Delete
  16. Hi tom,

    Do you have a schematic of this project?

    ReplyDelete
    Replies
    1. Never mind, didn't realise you only used two components

      Delete
    2. The schematic is in part 3.

      Delete
  17. Hi Tom,

    Is it possible to use Lineaire IC ST Microelectronics ULN 2803 A as the driver? Im not sure if the A makes a big differance.

    ReplyDelete
    Replies
    1. That is exactly the driver I am using.

      Delete
  18. Hi Tom,

    Last question! I found this type: ATMEGA8-16PU. Any idea what 16PU means? Ore doesn't it matter?

    ReplyDelete
  19. I wan't to use a ATMEGA8, but it uses 4,5V instead of 2,7V. So i will put in resistors at every output to reduce the voltage for the leds. Is this possible?

    ReplyDelete
    Replies
    1. Yes, that is possible. You should add the resistors only to the blue lines (see schematic in part 3 of this blog).

      The additional voltage drop is 4.5 - 2.7 = 1.8 volts. With an assumed current of 30 mA, the resistors should be 60 ohms. I would recommend 47 ohms, as that is a readily available value.

      Delete
  20. 30 mA per led i gues? So every output will control 8 leds right? So you get: 8x30 = 240mA at every output who is controlling one row of 8 leds? The leds im using uses 2V. The voltage drop is 4,5V-2V = 2,5V. So 10 ohms will do?

    (If its not please tell me were i wen't wrong)

    ReplyDelete
    Replies
    1. Actually, it is just the other way round.You are correct that each output controls 8 LEDs. But this cube is structured like a multiplexing matrix.

      And (again referring to the schematic in part 3) each of the GREEN lines provides GND for 8 LEDs at the same time. The BLUE lines control only one LED at a time. This is why the green lines need high power drivers.

      So it is better to insert the resistors in the blue lines, where you will never have more than 1 x 30 mA.

      The calculation that you made is valid for inserting the resistors in the green lines. But this would have a disadvantage. Depending on how many LEDs were actually active, the current and therefore the voltage drop would vary. So the brightness of the LEDs would also depend on the number of LEDs that were active.

      Regarding the resistor calculation, there is one additional aspect, that you have to take into acount. The controller output drivers are actually close to their limits when they are driving 30 mA. This leads to an additional voltage drop. So you won't get the full Vcc on the blue outputs. Look at the data sheet for details. There are diagrams showing the effect.

      This effect is why I get away without resistors in my design. Including the voltage drop over the GND driver, you can subtract another 0.7 - 1 V.

      Delete
  21. Thanks! I can start building now

    ReplyDelete
  22. Im am using 20mA leds, so the voltage drop won't be high?

    ReplyDelete
    Replies
    1. Many LEDs are rated at 20 mA. The ones I used are, too.

      Your LEDs will probably run at a higher current. So there will be an equilibrium between voltage drop and current.

      Don't worry, if the LEDs run at something between 20 and 40 mA. The LEDs will survive that, because they are only active for 1/8th of the time - due to multiplexing. So there is no real danger of overheating.

      If you have branded LEDs then the data sheet might even show how high you can go with the current, depending on pulse length and duty cycle.

      Delete
  23. Thanks for the help! Im a beginner so it was a bit difficult to understand because i use the ATMEGA8 without L. Thanks very much!

    ReplyDelete
  24. Thanks for sharing the information of LED driver. Your post will be helpful for beginner. Keep writing about LED driver, LED light and constant current driver.

    ReplyDelete
    Replies
    1. Thanks for the encouragement! I will continue, if I can find the time.

      Delete
  25. I am using AVrdude to program the chip, but my problem is--- it is giving the error that "Target doesnot answer 1 ; check ur connection" .............i have done lots of things to get over this problem but i failed...I am using usbasp 2.0 V programmer to program that chip........the progrmer is set to low sck and giving a supply of 4.84 volts to the pins..........when i am keeping the multimeteron the VCC and GND of the chip(Atmega8L) the voltage reading is
    0.6volts. . In the data sheet it is written that these type of chips need minimum of 2.7 volts to run , is it the voltage that is creating the problem??...the programmer is suppling 4.84 volts but when i connect the chip and measure the voltage again at the chip's vcc & gnd it is coming around 0.6volts..these things i have noted till now......rest all fine....please help me to make my new chip work....Do u have any idea about this problem.......Please let me know any thing that might help me sir......
    Regards,
    Rushikesh
    08600794003

    ReplyDelete
    Replies
    1. Rushikesh, there is definitely something wrong with your wiring. If the programmer supplies the 4.84V then there should be 4.84V on the controller. Since there are only 0.6V, there is either some broken wire or you got the pin-outs wrong. Perhaps a misunderstanding concerning the ISP connector? Also, I heard of people, who got cables with their programmers, that had a wrong pin-out. So please double check your wiring.

      If your multimeter has a continuity tester function, test between the pins on the programmer and the pins of the controller. This way, you include all the wiring.

      Delete
  26. Hey Tom.Great Schematic..Made it crystal clear!I was wondering if we can use a H-Bridge(L293D) instead of the ULN2803?

    ReplyDelete
    Replies
    1. Pradyumna, yes, that is possible. Bear in mind though, that the L293 is a non-inverting driver, whereas the ULN2803 is an inverting driver. So the software has to be adapted accordingly.

      Alternatively, you could also use a row of eight NPN small signal transistors with a 1kOhm resistor on each base. If you have a look at the ULN data sheet, this might help you to understand what I mean.

      Delete
    2. Pradyumna, just for the benefit of other readers I want to add, that the L293D contains 4 "halfbridges", so you would need two of those ICs to drive the cube's cathodes.

      Delete
  27. Nice blog. This is a useful blog for making LED products. Thanks for sharing this.

    ReplyDelete
  28. hello sir nice to meet you
    great cube, sir
    i want to bulid to
    but the microcontroller IC ATMega8
    may the ic can replace with ATMega8535
    or ATtiny2313?

    because in my room just have that

    Thanks for sharing

    @FB : Naufal Masyayikh

    ReplyDelete
    Replies
    1. Sorry, but you can't simply replace one controller by another. They use the same instructions (mostly), but their peripherals (ports, timers, etc.) are different. So you would have to at least change the code. But especially the ATTiny2313 is borderline, it has only 2k program memory.

      The ATMega8 is a very cheap and easily available controller. My recommendation is to order a few from your favourite auction web site.

      Delete
  29. Great project tom
    I like it so much, so i wanna try this one
    what about if i use the atmega8 without "L"?
    thanks so much

    ReplyDelete
    Replies
    1. Go for it Jaga!

      The L version is specified to work from 2.7 - 5.5 Volts, the "normal" Version from 4.5 - 5.5 Volts.

      I wouldn't worry too much, though. This data has to be regarded in combination with ambient temperature and component tolerances. The manufacturer guarantees that all given data is valid for all these variations.

      So if you have got the normal version already or cannot get hold of the L version, just use the normal version.

      I would say that in 99% of all cases it will work.

      Aternatively, us blue or green LEDs, which need a higher operating voltage anyway.

      Alternatively, ues three AA cells (3.3 - 4.5 Volts) instead of two (2.2 - 3 Volts). Still out of range, but closer...

      Delete
    2. I got it. Thanks sir
      I have finished my 4x4x4 LED CUBE base on your tutorial.
      It look nice, but it just show random pattern.i don't know why. Not on all part. just some of them.
      I use looping set_LED(i) from 1 to 64 to switch on the LEDs in sequence. Was I true?
      because the LED light up with randomly and some of them light up together.
      I have several question about microcontroller programming, it was my first time work with microcontroller.
      1. I don't understand how to set the PORT, so the PORT can light up the LED

      2. What mean of this number 0xFF, 0b00001100 ? And how to read it?

      3. In your tutorial, why don't use resistor to the LEDs?

      here my cube sir, i put your link on it
      http://www.youtube.com/watch?v=OmF4RfVU4wc

      thanks so much

      Delete
    3. Dear Jaga sir,
      I have also done this project , its a great project to do, Only because of the expertise explanation of Tom sir.If i can help u then ,According to me-

      1) It is simple , u have to provide voltage for the respective pin on which u decided to plug ur led it is done as -
      int main(void)
      {
      DDRB = 0b00001100;
      PORTB = 0b00001100;
      }
      This program is explained below-

      2)I think 0xFF means we are declaring the port as output.....we do it so as to give it voltage(to light up led) But m not sure about this (00xff is used for input or output ---m bit confused about that ), but tom sir will definately help u .
      - 0b00001100 it is written to make the ports of the microcontroller's to set to +5volts or 0 volts....m sure about this-
      For example-If this is the code

      DDRB = 0b00001100;
      PORTB = 0b00001100;

      In this we are using Atmega8 or any 28pin microcontroller. Here we are firstly choosing (DDRB = 0b00000001) -here we are selecting only the 5th and 6th pin in the B slot. And now after that PORTB = 0b00001100 - This means we are activating the ports where there is a true value(1) for input or output( for output in this example).
      In total we write
      DDRB = 0b00001100;
      PORTB = 0b00001100;
      this finally means that we are firstly chossing only the 5th and 6th ports and declaring them as output ports in the microcontroller which are coming under B slot then we are setting the 5th and 6th pin so as to provide +5 volts (Which means the 5th and 6th pins of B slot will provide output voltage for the led's )

      Note:- The output voltage will depend upon the input supply voltage-----in my case it's 5 volts

      3)According to me, we have to use the resistances with the led's , as i have tried to neglect them , due to which 28 led's of mine were shot, hence i strongly suggest u to use resistances..........I personally used 5mm bule led's with 48 Ohm resistances.

      I strongly recommend u to view this link , this will definately help u a lot.......and all the above questions of ur's will definately be answered in this link-

      http://www.newbiehack.com/MicrocontrollerWritingthefirstprogramandtransfer.aspx

      Hope i was able to help u some how-

      Tom sir please correct me if i am wrong someware.........
      Thanku

      Delete
    4. Thanks a lot rushikesh.
      It's very helpful.
      I use 5mm blue LED too, and no resistor.
      but, until now there is no problem.
      The power source are from USB.
      What
      in 0b00001100 what mean "0b"?
      I still confused, It looks like I need to learn more.

      Delete
    5. 0b is actually a command......where b stands for port b..........i suppose......the link i have provided is nice......the whole programming is explained from the basic.....check out all the videos in that link........and when i used power from usb the results were fantastic......but when i used AAAx3 pencil batteries(in toltal 4.5 volts power supply) 28-30 led's were shot......hence dont take risk.... led's are more costlier than resistances..........u can calculate the resistance required.....here's the link-http://led.linear1.org/1led.wiz

      Delete
  30. This comment has been removed by the author.

    ReplyDelete
  31. This comment has been removed by the author.

    ReplyDelete
  32. Hello Tom, I am Argentine, I like you project, what projects you recommend me for begin?
    Thanks in advance
    Best regards
    Juan Pablo.

    ReplyDelete
    Replies
    1. Hello Juan Pablo,

      this is hard to answer. I don't really know what skills you have yet. But in general, I would start with a project that has no microcontroller. Microcontrollers have to be programmed, which adds an additional level of complexity.

      Perhaps you can start with simple projects, like torch lights. This would help you to learn soldering. Another step could be to buy some kind of beginner's kit like a blinking LED. Try to get comfortable with soldering ICs as well.

      Then you can try to build a small breakout board, eg. for a ATtiny13 controller. Buy a cheap programmer (see my post on USBasp programmers) and see if you are able to access the controller.

      If you are successful, maybe you can try a larson scanner. Try to modify the software and write your own.

      Good luck!

      Delete
  33. Hi , do you have somthing more interesting projects about LED, i need something, or some idee for my license at college

    ReplyDelete
  34. The code for the cube is with all those functions that appear in video :) ?

    ReplyDelete
    Replies
    1. Yes, you can find it in the download section.

      Delete
  35. Really your blog helps me to build LED cube. Thanks for sharing this useful post.

    ReplyDelete
  36. visit my blog about simple hobby electronics projects all detail available about any circuit try this this very useful about uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
    www.electronicsirfan.blogspot.com

    ReplyDelete
  37. I look forward to attempting making this but I am also a little stuck on the controller. I was wondering if you could be kind enough to check this item for me and see if this is ideal. Thank you.

    http://www.ebay.co.uk/itm/USBASP-USBISP-AVR-Programmer-USB-ATMEGA8-ATMEGA128-ATMEL-AVR-ATmege-AT90-ATtiny-/200988357532?pt=UK_Computing_Other_Computing_Networking&hash=item2ecbd6f39c

    ReplyDelete
  38. what size should the perf board be

    ReplyDelete
  39. Replies
    1. Thank you so much.

      Delete
    2. Well, my PCBwas 5x10 centimetres. I made a square part for the cube and used the rest for the electronics.

      But the size of the PCB depends on the size of cube you are soldering.

      Delete
  40. i apologize my bad language

    hello sir.... i prepard all thngs for progrmmng... includng avr studio also.... bt i dont knw hw to program atmega8l and ur source code files.... pls help me hw to do these things

    ReplyDelete
  41. Do you need any resistors for this? If so which ones?

    ReplyDelete
    Replies
    1. No resistors are needed if:
      * You use red LEDs and
      * use 2 AA cells for power
      In that case the ontroller won't be able to supply enough power to destroy the LEDs. In other words, the controller is the current limiting element in this circuit.

      Delete
  42. How can i progrram with tl866?

    ReplyDelete
  43. hi my name is Nicola and I want to know if I can use a PIC 18F4520 to realize charlieplexed 4x4x4 LED cube or do I only use ATMEGA8L and if I can be programmed with the programmer PIC K150 thanks a lot

    ReplyDelete
    Replies
    1. Generally, I do not use PICs, so I can't advise you. But every type of controller uses a different set of instructions, so you can't use a PIC with my code. You would have to completely rewrite it.

      Delete
  44. hellow tom

    what is reason of multiple led`s lighting in the cube. ie: in the test pattern instead of single led lighting led1 and led in the last row lights and it continues... ive tried changing 3 atmega8 and 2803 also and even checked the cube also but the same problem...
    what could be the reason how could i solve it

    ReplyDelete
    Replies
    1. Sorry, somehow I missed your question. I hope all works now? The only thing I can think of is a problem in the cube structure. Make sure that all leds have the right polarity. Test LEDs by disconnecting the ATMega and Driver. Use a ohmmeter to get a single LED glowing by holding one lead to a column and one lead to a level connector.

      Delete
  45. Hi Tom,

    I hope you're still monitoring the comments on this blog. I've built this cube, and apart from having to swap the common cathode wires on one cube half to get the leds firing in the correct sequence, it started first time. I have noticed though, that my leds flicker strongly and the sequences are much slower and jerkier than those in your video. I have substituted pink leds for the red in my project, and I understand that they have a higher forward V than red ones, so perhaps that it the cause. Do you have any suggestions as how to eliminate the flicker, or am I stuck with using only red leds in this circuit?

    Thanks.

    ReplyDelete
    Replies
    1. Hey beachcomber, i made this project 2years ago, see the flicker is because of the voltage drop probably think, u can google the threshold voltage of red,blue,green leds and adjust the resistances as per the requirement. There is no problem as long as U r using same color led's through out.(all 64 led pink in ur case). Just find the forwards voltage difference between red and pink, and adjust the resistances between micro controller and led's

      Delete
    2. Thanks for the suggestion. Yes, I already knew about the different values for forward V, I just didn't know if that was what was causing the trouble.

      Thankfully, Tom came back with the correct solution, so it was just a problem with fuse hex values in the Atmel programming, not forward V or resistance values (as there are no resistors in this circuit).

      Delete
  46. Sorry forgot to add a video example of the problem - https://youtu.be/_0rvEyz5qIw

    ReplyDelete
    Replies
    1. As I wrote on YouTube, I think it is the fuses that you didn't set. On default, the CPU runs at 1 MHz, with the fuse setting changed, it runs at 4 MHz and the flicker should go away.

      An indication for that would be that the animations are much slower on your cube compared to mine in the video. My video is real-time and not accelerated in any way.

      The colour of the LEDs has no impact on flicker, as you already suspect.

      Delete
    2. You sir, are a diamond!

      I was using the command line avrdude, and didn't give a thought to fuse settings (mainly because I couldn't find the option to set them), but from your other page about ASP programmers, I found avrdudess. Plugged in the high and low hex values for 4Mhz from their help page, and bingo! All working just like yours.

      I'm taking mine a step further by building it into a display case with a LiPo and an Adafruit charger p.c.b.

      Once again, a big 'thank you' for the advice, and keep on keeping on - you are an inspiration!

      Delete
    3. Thanks Bob, glad it worked for you. I am quite interested in your further improvements on the project. Do send me a link when it's done!

      Delete
  47. It's all down to your instructions, my friend. I wouldn't have attempted it without your inspiration.

    Here's a quick video of the finished project:-

    https://youtu.be/6b6CFsEnbmA

    What you don't see in the video is the red and green charging lights that I extended off the p.c.b., and replaced with 2mm lighthouse l.e.d.s drilled into the back, next to the usb port.

    I know it suffers a bit from the clear lenses passing light up through the columns, and if I attempted it again, I would try to source self coloured, diffuse l.e.d.s, which I know exist but were only available from U.S. suppliers and way beyond my budget for this project. Postal charges from across the pond have become ridiculous of late.

    ReplyDelete
  48. This comment has been removed by a blog administrator.

    ReplyDelete