loading
Christmas time is a great time to obtain large numbers of LEDs very cheaply. This instructable uses 80 LEDs from an LED christmas tree light string to make the venerable 3D LED cube. In this case a 5x4x4 cube.

The only other components are a 7805 5V voltage regulator, 2x100nF decoupling capacitor, 16 resistors, an IR receiver and a single PIC 16F88 microcontroller. Many other LED cube projects use all sorts of shift register chips etc to perform their addressing of the LED matrix.

To save on component and wiring effort it makes use of the charlieplexing addressing technique previously described in instructables:
https://www.instructables.com/id/Charlieplexing-LEDs--The-theory/
and
https://www.instructables.com/id/How-to-drive-a-lot-of-LEDs-from-a-few-microcontrol/
previous projects using this are:
https://www.instructables.com/id/Microdot---wrist-watch-LED-pattern-timepiece/
and
https://www.instructables.com/id/Minidot-2---The-holoclock/

I'd recommend reading at least the first two before continuing to read this instructable.

Step 1: Strip the LEDS From a String

This is pretty boring actually. Get a string of Christmas lights. Preferably ones with a concave lens, ie they look like someone has countersunk the top of the LED.

Strip and unsolder all the leds in the string.
<p>I don't see the beauty in this design. I would suggest a circular arrangement with the LEDs facing downward. The wires can be left alone and slip the wires into a plastic holder of some kind which can be cut with x-acto knife and then glued back together with superglue. Alternatively, I got an idea from another project, to find some kind of small bottles that one can cut the base off and use the neck. I seem to recall there are small candies that come in the right size tiny bottles. Put those into a disk with holes facing downward...</p>
<p>good</p>
good
lol, my local store has 4 leds for 5 bucks, i went to ebay and got 90 for 5 bucks (im in canada and i ordered them from the states, that 5 bucks shipping and everything.) its amazing what the internet can do.
This seems to be a very costly way of buying leds. Ebay can be amazing. i was able to get 9000 total for just: 2000 WHITE $24.39 5000 BLUE $34.78 2000 WHITE $28.89 $86.06 (that is less than a penny each)
i took 140 leds for $5 i'm screwed :(
well that is not too bad, for such a small number. most of the time you cna't spare $100 for just some LEDS.
Yes it is true that you can probably get them cheaper, however, due to the fact that there are so many colors of leds being called a single color, you do know for a fact that the ones you buy in the store will be the ones you need.
those leds i got came in sealed reals. Every LED was exactly the same. it was not any "Loose leds" even when i have bought loose ones they were all exactly the same.
thats not a cube. it's a rectangular prism!
mmmm you're right....how about a cubic lattice, or given my construction was a little wonky and it bends a little.... a rhombic prism !
*brain hurt*
Check out <a rel="nofollow" href="http://electronicdesign.com/Articles/ArticleID/15512/15512.html">this article</a> to see a way to group the anodes and cathodes with resistors in series with, say, that cathodes that will if only a single CPU pin is driven high at a time allow multiple LEDs to be controlled at a time without ghosting.<br/>I'm not sure how much it will complicate the layout.<br/>
Hi,<br/>I saw this article and you're right, you can drive multiple LEDs at a time.<br/><br/>Funnily enough we've been through this issue several months ago. Check out my other instructable:<br/><br/><a href="https://www.instructables.com/id/Charlieplexing-LEDs--The-theory/">https://www.instructables.com/id/Charlieplexing-LEDs--The-theory/</a><br/><br/>where there was a lively discussion and some results on multi-LED charlieplexing in the comment section.<br/><br/>Phil<br/>
Do you mind if I upload the video to YouTube and post it here?
Excuse me for not reading, but what microcontroller did you use? I would love to see the code.
I used a 16F88 for this project...the code is not available as noted.
AWESOME! I saw the vid. How did you create the code for that? Does it just use variables and pseudo-random number generation to light different LED's?? Also, I know this cannot light an LED individually, but it looks like that's not so, according to the video... Or is it only diagonal rows, or something?I saw something very similar to this in a MAKEZine podcast. I'd love to do this with an AVR; I'm getting an Arduino for Christmas; maybe I'll try something similar...Great job!
Actually, yes it <em>can</em> light each LED individually - read some of the links the man provided...<br/><br/>The trick is that the output of the microcontroller isn't just &quot;High&quot; versus &quot;Low&quot; (0V) - you can actually pick one of <em>three</em> states: High / Low / Open. That means that, with some clever wiring, you can actually control a lot more LEDs than with just a binary output.<br/>
And this is all done without a separate driver IC?? Won't that use up too much I/O??
See this <a rel="nofollow" href="https://www.instructables.com/id/Charlieplexing-LEDs--The-theory/">Charlieplexing instructable</a>. It's a simple way of demultiplexing binary. <br/><br/>There's an inherent limitation: like any demultiplexer, it 'breaks out' the binary to individual lines. You can only switch on <em>one</em> light on each 'charlieplexed' matrix at a time....<br/>
You can use each signal more than once, so with 8 i/o lines it is possible to have 7 high signals, and one low signal, and light 7 LED's that way. or 7 lows and one high for 7 different led's. Or if you have 4 high signals and 4 low signals, you have 16 LED's lit.... if every slot in your charlieplex is full. That does not mean you can pick any set of arbitrary led's to light at the same time... For example if you have an LED that requires i/o pin 1 to be high, and i/o pin 2 to be low, while another LED needs pin 1 to be low and pin 2 to be high, then those two LED's cannot ever be lit at the same time. So for any two I/O lines you can only light one of the two possible LED's that are driven by the pair of i/o lines. Gmoon is right that there is a limitation, you can't light two led's that require different states on the same i/o line, and in charlieplexing each position in the array has a complimentary position that must be off for the first to be on. However you /can/ light more than one LED at a time. Of course you can "appear" to light a complimentary pair of LEDs at a time by changing states quicker than the eye can detect the flicker. In a charlieplexed array of 7 segment LED's with multiple digits, you typically light the entire numeral in one digit position at the same time. You don't have to do it this way, but it takes simpler code to do it this way.
looks hard
very very cOOL jajaj thats hot
rad... i'm looking forward to digging into this!
Really nice job! You should add "charlieplexing" to your keyword list so more geeks can find your article easily. :)
Very pretty! Quite complicated looking, though!
Nice! I like the randomness -- its a great idea, much easier than figuring out where everything goes ;-)<br/>Also, with the 14 I/Os to 80 LEDs, I assume it makes it much much easier -- as you're much closer to standard multiplexing. Is it even <em>possible</em> to charlieplex a cube of that size? (Neatly, of course)<br/>
Using a sparse charlieplex matrix does make the wiring easier. It would be possible to go for a bigger matrix, 14x13=182 LEDs.....though I doubt there would be enough brightness in the LEDs to be practical, as each LED would only get 182th the total current possible.<br/><br/>Personally for a bigger cube, I'd electrically split it into two or more charlieplex grids...and use more IO pins in a bigger microcontroller, say an 18F4550. Also a bigger micro can run faster with a crystal, although the 16F88 can be run by a crystal (see the microdot/minidot projects), and that would enable effects like dimming between patterns.<br/><br/>Phil<br/>
Hi Guys, Thanks for the comments. Patrik was right, with charlieplexing individual LEDs can be lit up, just check the theory instructable. This is also implemented in the Minidot/Microdot projects. The key is to use the tri-state function of micros. You could use the same code with some slight modifications (increasing the number of charlie nodes, dropping the RTC code) to do some experiments. As for the chip in the video, it's a 16F88 with 16IO pins, one is used for the IR receiver (to change patterns) and 14 are used to drive the charlieplex array (one is unused). However currently I'm using a program I designed a while back called RGBSPCHIP5 (details at www.rgbsunset.com)., previously designed for RGB LED displays....Sorry I won't be releasing source to it, I put a considerable amount of effort into getting the capability to do 15 (5x3RGB) PWM channels going without any extra support chips. PWM differs from a proper charliplex driver in that the tri-state function isn't used....so individual LEDs aren't lit. Instead one or two go bright, and several others depending on their position in the array go a little dim, because they share current. However in the new year I will be changing the web site so people can get the .hex file and program their own 16F88, also dropping the price as I'll just email them the .hex file instead of sending a physical chip, saving shipping costs....so if you're keen watch for it then, or msg me and I'll contact you when it's ready. Using PWM on a charlieplex array gave an unexpectedly good result for random 'computer thinking' sort of patterns...though it doesn't work well for defined patterns like a clock or 3D life displays. Like I said, will be updating this in the new year with proper charlieplex code....just too close to the silly season to spend time on it now. Phil
Very very cool. looks pretty hard though..

About This Instructable

87,310views

118favorites

Bio: update later
More by rgbphil:3D LED Charlieplex Cube from Chrismas Tree Lights Charlieplexing LEDs- The theory Minidot 2 - The holoclock 
Add instructable to: