Introduction: Advanced Charlicube and Modifications
Ive written a couple instructables about the Charliecube, like this one about building the Charliecube:
and this one about hacking the cube, to make a common anode version here:
Ive learned a lot of things along the way, and Ive figured out ways to modify the original design, in different ways. This instructable is geared toward more advanced uses, and basic understanding of the charliecube is required, or this may not make much sense, so please check out my other instructables and come back here when you understand what this thing is.
The charliecube is the ultimate in reduced parts electronics project, It can be made with a single board microcontroller, 64 RGB LEDs, and wire. You can have a circuit board, and even connectors, you can also add resistors, or even add other features like a button, or other hardware.
In this instructable, I will go over each of the components, and discuss some of the various options.
I will also discuss various build options, non-cube projects, tips, and techniques.
My hope is that people will build more of these things, and modify them in fun and interesting ways with open software, and hardware designs.
Step 1: Microcontroller
Microcontrollers are pretty common these days it seems, Ive only used one kind of microcontroller with it, but you could probably do this with any microcontroller that has 16 pins. You might be able to make a better cube, if you use a microcontroller that has 16 PWM pins. I've used the nano, it has a atmel 328 chip (tiny quad smt), and that chip is on many other microcontrollers, so those should work also.
The software never lights more than one voxel (3 LEDs) at one time, so it shouldnt ever use much more than 60 ma. That means that you dont need much of a voltage regulator, and if you also dont need USB, then you could get by with a arduino mini, and it would be interesting to try this with a 3.3v version of the mini. You could also build one with a teensy, those things have plenty of pins, and I think many do PWM, and capacitive touch, for more interesting features.
It would be interesting to take just the parts that you need, and build a cube with just those parts, and maybe make it without a circuit board.
Another interesting idea is to port this to an non-arduino microcontroller, and try it from that. The minimum requirements would be 16 tri-state microcontoller pins, 60 or so mA current.
Another option with the nano, is you can solder the cube directly to it, or you can solder sip headers on it, and either solder that to a circuit board, or solder connectors to the circuit board and plug the nano in to it.
Step 2: Circuit Boards and Connectors
The original cube was built on a prototyping board, which is a great way to do it, but not the only way to do it, especially if you have no plans on making a cube!
The photo above explores how you can use circuit boards in different ways, and can use, or not use connectors.
Using a connector is often a good idea if soldering is difficult, or if you may be replacing parts. If you dont need to change parts, then sometimes soldering the part right onto the circuit board is a better option. The benefits are not using materials that you dont need, not buying parts you dont need, and visually less parts is often nicer looking.
The charliecube is not much more than the LEDs, and building it without the circuit board reduces the part count by one part, but it makes the circuitry part of the visual design, and makes a huge impact on the visual appeal.
The size of the cube can be limited by the size of the circuit board. The third image shows how to reduce the spacing between the LEDs, based on the spacing on the circuit board. If you dont do this, you may end up with something more rectangular, than cubular.
You can also put the spires on connectors, like shown in the first image, and the last image. The first image is a nice way to test LED spires before you put them in a cube. The last image shows how used the spires in a completely non-cube way. The connector consists of 3 3 cell sip sockets glued together in a 3x3 grid. You really only use the 4 corner pins, but it works nicely for plugging a single spire in. You can stick the spire through cloth or paper, and connect it on the other side. I used it to make a groovy hat.
Step 3: Wires
I use a lot of wires many different kinds of wires too.
There are wires that are good for the cube structure, and wires that are good for the circuit board, and wires that are good for the hat, and wires that are good for replacing a circuit board.
Lets start with the wires that you use to make the spire. I have tried several types of wires for this. Buswire, or some kind of bailing wire are often used for LED cubes, but Ive found that hardened steel wires are the best, and they are a lot better than bailing wire.
Bailing wire requires straitening, there are ways to do it, but its always effort, and if you arent too careful, you can easily bend the wires. Bent wires really uglyify a cube up quick, cubes like nice straight lines and square corners. If you are patient, and careful, you can make a cube with bailing wire, I think the galvanized stuff is the easiset to solder, but ultimately, it is the least appealing most of the time. The third picture shows the charliehat, it has 22 gauge galvanized steel wires holding the spires together.
Hardened steel wires start straight, and are difficult to bend hard enough to kink. they are flexible, and bounce back to their original shape when flexed. They take solder just fine, but depending on where you get your wire, may need pre-tinning. Ive found that the music wire in the hobby shops works good, but can be oxidised, you may want to test yours before building the cube, or just tin them in 4 tiny spots, if you have any doubt.
No matter what wire you use, a good stiff wire is going to work best, and sometimes that means a thicker wire. Ive found that 19-22 gauge is about right for most LED cubes, if you are using bailing wire, If you are using music wire, or other hardened steel wires, 0.20mm seems to be about right. 0.25 works, but is a little thick, 0.15 works, but is a little thin, and very delicate. I found some test pins that are just about the right size, and they have nice rounded edges, they are by far the nicest looking wires ive seen. The second picture shows 0.25mm music wire, This is what it looks like after you take 8 rods, and cut them into 8 sections. I used a diamond saw wheel on a dremel to cut them. The new wires are so much nicer, but this will work. The middle image shows tinning the music wire. The wires in the picture are the 015 music wire.
There are also wires used to build the circuitry between the spires, and the circuitry between the arduino and the cube. There are also additional wires if you do something different.
If I build a cube on a printed circuit board you can do some of the wiring on the circuit board using bare wire, but other times you may want insulated wire to assure you wont short. The wires that connect the microcontroller you probably want insulated too. indeed you could do all insulated, but often less insulation is better to look at. Sometimes a nice rainbow of color is nice, like the first picture above.
I like building the cubes without a circuit board at all, I just solder stiff solid core wires. The first 2 sets of the 4 wiring schematics will hold the spires into a single cube object. Those 8 wires make a matrix that gives the cube its structural stability, and thin ones are delicate, but work, and look good. Thicker ones are more sturdy though, so its kind of a trade off. I like to make a loop in the wire at each soldering point, its difficult to get the spacing even, but with some practice you can make nice even loops at nice even increments.
I like to use a thinner wire for the last 2 wiring schematics, they are more complex (they cross at times, and have a lot of bends. In the last picture, you can see the top cube has no PCB, it uses eight 19 gauge wires to hold the cube together, and another 8 thinner 24 gauge copper wires for the other circuitry. The next to last picture shows a 19 gauge wire to make loops right on some LEDs for another unfinished charliecube project. That 19 gauge wires was one of the early attempts at bending nice even loops, yet it was still useful later on.
Step 4: LEDs and LED Spires
There are a lot of LEDs what kind of LEDs but not all of them will work for the charliecube. You need RGB LEDs, that do not have a built in LED driver. These LEDs typicaly have 4 leads, and come in common anode, or common cathode. There are also RGB LEDs that have 6 leads, and but they can be modified to be common anode, or common cathode, so they too can work The last picture shows a 5050 LED that has 6 leads, but its a working common anode LED charliecube spire.
There are many sizes of LEDs, but the 5mm throughhole bullet style are the ones that most people recognize, You can get them bigger, or smaller, you can get them in diffused or clear casing, you can get them in surface mount packages too. Which one is best depends on what you want, the clear ones shine bright light on the ceiling and walls, but can be hard on the eyes. The diffused ones only light a small area, but its even, and glowy. Surface mount ones often dont have diffusers, but are very low profile, and they can be covered with some kind of diffusing material like paper or plastic.
The first picture shows several spires made several ways, some ways use no extra wires, some have connectors, one is surface mount LEDs. all of these were early attempts before I found the music wire.
I typically like to make very light solder joints, they are concave, not convex. When building these cubes, I find that a little extra solder helps prevent them from breaking so easily.
Step 5: Optional LED Matrix Board
This makes it easy to get all the spires lined up in a nice matrix. You can make the cube without it, but it makes it easier to do a good job. It also makes it possible to make a cube without a circuit board. Make the board was pretty easy, all you need is the right size drill. if your not sure, you can always drill a hole, and see how the LED fits until you find the right one. Being 5mm LEDs, thats a good place to start, if you have metric drills.
To get the matrix lined up right, you can draw it out with a ruler and square, or you can draw one on the computer like I did, print it out, glue it to the board, and drill it out the holes. To make the holes square you can use a couple small peices of scrap wood to form a corner, set that where you drill, and cradle the drill in the corner to keep it perpendicular. You dont have to drill all the way through the board, half an inch is plenty. Harder wood is better than softer wood.
Ive included a printable PDF file of a 5x5 grid, you can print it on your printer, then use your it to make your own board. You can
If you use my grid for making your board, you need to make your LED spacing 1" when you are making your spire, or you will end up with a strange bloom'n onion looking cube. The LED spacing need to be the same in the X, Y and Z axis, or you end up with a pseudo-cube thing, that is kinda cool, but probably not what you want. If you must use a matrix that is smaller than 1" squares (like if you make it on a circuit board that is a little small), you need to make your board matrix the same size.
Step 6: The Charliehat
The Charliehat is a charliecube that has been modified to fit on a conical floppy hat. THe last several photos show the hat, but its very difficult to take a good picture of it. It has the center 4 spires on the top, then alternating outter spires on the next two levels of the hat. It doesnt resemble a cube at all.
To make the hat, I had to make some extra stuff. I wanted connectors to plug the spires in, but the only thing I had was some sip connectors, so I use them, a lot of them! and made a 3 by 3 matrix, where the 4 corner sockets fit the spire. I used some sip pins to hold the bunches of 3 sockets together while the super glue dried This held everything nicely aligned.
I needs wires to go from the connector, to the circuit board. this board held the microcontroller, a power connector, and needed 64 wires to hook up the connectors. I needed flexible wires so that they could move around freely in the hat as it flops. I needed a lot of them, and It helps if there is a color scheme to help make wiring sane. I found all that in an old IDE hard disk cable. They are very thin wires, but thats ok, infact a little resistance probably helps prevent overcurrent. I soldered 16 sets of 4 wires to the circut board, then wired the other ends to connectors. I found that the hand made connectors had some rough egdes, so I did some sanding and slipped some heat shrink tubing over the connections to create some strain relief. I clipped the corner on the heat shrink, and used that as a registration mark, to get the spires on the right way. but if you get one wrong, you can find it and fix it with some testing.
Its kind of hard to tell, but even in the daytime, the charliecube hat is bright. its too bright for some places, and I change the programs to do different patterns and glowy or blinky, dim or bright, fast, slow. It depends on where Im wearing it.
Step 7: Unfinished Projects... the Charlieclock
These are some LEDs that I started working on to build a charliecube on a suit. I have a suit for working outdoors in the cold, I thought it would be fun to have blinky LEDs on it, then I thought it would be awesome to make a radial style clock with 60 RGB LEDs in a circle. This gives me 4 extra to add as 3,6,9,12 reference spots. The second hand can cycle around, while the minute, and hour LEDs light a specific color or pattern.
I havnt finished the bending of the leads and soldering loops (hours of work), and I dont have any conductive thread.
I could stitch them on with regular thread, and use regular wire if I really wanted. What is probably really holding me back is that the LEDs will be uncomfortable when lying on my back, and I wont get to see them. The arduino sucks as a clock, so you need additional module to make a good clock.
I also experimented with diffusing LEDs. Its nearly impossible. I tried solvents and glues, but the only thing that really worked was taking a file to them. If you want diffused LEDs, buy diffused LEDs, its not worth the effort making clear ones diffused!
Step 8: Software
This cube has an library of software that comes with it, you can use this library to program the LEDs, it basically makes it easy to turn on and off LEDs. The source code is available, and you can modify it and make it do different things. You can use the library that comes with it, or make your own library. You can make your own programs to use your library, or the existing ones.
There are 2 files that can be modified to do different things. The library is built into the cubeplex.h file, and the programs are in the charliecube.ino file (the one that loads up in the arduino IDE program).
I've also created a custom cubeplex.h file, that has 8 flushbuffer maps to compensate for common wiring problems and to accommodate using common anode LEDs.
If you want to learn how the cube works, then you should read the cubeplex.h file, it contains the library of code, and reading that code (particularly the drawLed function), will show you how this cube lights upto 3 LEDs on one voxel at a time. You can also add your own functions here, then call them from the charliecube.ino file.
If you want to change the programs that run on the cube, or make your own programs, then you should take a look at the charliecube.ino file. You might start by commenting out different programs, and uploading sketches to see how that effects it. You might also change some variables to speed things up and slow things down.
One of the things that I did was to copy one of the programs, and modify it to sequence through each LED one at a time. I used this program to find the wiring changes to reprogram the cube to work with common anode LEDs.
I have found one person that has made new programs for the charliecube, here is a link to the code:
I have messed with some of the programs too, they are real fun.
My cubeplex.h is attached
Step 9: Preparing Your Parts for Soldering.
Really really take your time making sure the parts are prepared properly. When you prep the LEDs hold the LED like shown in the first image, and press the leads against a hard flat surface (like the work bench), this will help flatten out the leads, then they need a little adjusting to make them all 90 degrees apart, with nice crisp 90 degree bends, and straight leads. It pays to take the time in the first few steps for 2 reasons, the first is that the later steps are much easier and quicker, but also because defects amplify in processes, a little bend now, ends up looking much much worse in the end because each step in between had to adjust for it.
You may want to test solder one part, if you have trouble, then you may have oxides or contamination that is going to make soldering very difficult. Pre-tinning those parts will save you a lot of grief later on, and you will end up with nicer looking product. That often isnt a big deal, but this is a display piece, and everything is on display, make it look good by doing things the easy way.
Double check your common lead mark, its important that its the same on each part, it doesnt actually have to be the common, it could be the red, or the blue, or the green, as long as you use the same one on every LED, that and that every LED has the leads bent the same way. If you dont do those 2 things exactly the same on every LED, you will end up having to fix it later, and thats always harder than double checking your work.
Step 10: Soldering
Hoo-boy there are a lot of things that people do wrong in soldering, I will try to keep it simple, direct, and to the point.
Pre-tinning parts will rarely hurt anything, and can really make soldering easier. Its worth taking a minute to test your parts to see if any are going to be difficult, If you find some (like the music wire, it can be a little difficult), tin those before putting together a spire.
I like to use a lot of flux, its like magic sauce that makes happy solder joints. As far as soldering is concerned you can never use too much, as far as making a mess is concerned, the more you use, the more you have to clean later. I try to put a little more than I will need, but sometimes I have to add a little more, and reflow the solder. The flux is there to keep oxides from contaminating the joint, so make sure you cover both parts with a thin coating of flux. I like to use paste flux, or let the rosin flux thicken up by leaving it to dry up a bit. thicker means Im able to put a little more flux on there, and that means its still working when I remove the iron.
You may need to get tricky holding the part with one hand, while applying heat with the other. You can see how Im using 2 fingers to hold the wires in just the right place before terminating that connection with a small amount of solder. The technique I use here is to load the iron with just enough solder for the joint, then touching the iron until the metal flows across the whole joint. Using the holding the solder with one hand, and the iron with the other hand doenst really work for this kind of soldering. That works ok for doing through hole/pcb stuff, but this requires different soldering technique.
Keep your tip clean. wipe your tip before loading the tip with solder on every single joint. This helps keep the dirty oxides out of your solder, makes the iron conduct heat better, and easier to see what you are doing. When you solder a lot, it become second nature to wipe the tip when you pick up the iron. You also get accustom to tinning your iron whenever you are not using it for more than a few minutes.
Step 11: Cleaning
After you build your spires, set them in a jar of rubbing alcohol, and cover it (I use a small jelly jar), you can reuse the alcohol many times. Put the spires in the jar, cover it, and shake or agitate regularly for best results. If you can leave them in the jar overnight, that seems to work best. You may want to rinse them with fresh alcohol after the main cleaning just to get any sticky residue off.
I use an acid brush for most other cleaning. I just dip it in the alcohol, and scrub the flux until its thin, then rinse it off with a couple brushes loaded with alcohol. This often leaves condensation, but that will dry.
The flux is corrosive, and it can tarnish or rust the metals, its also sticky, and dust and other things will stick to it, potentially causing shorts, try to do a good job getting all the flux off.
Step 12: LEDs, and Resistors
Normally LEDs require current limiting resistors, its a little complicated, but LEDs have a property called forward voltage, if you use more voltage than it likes, it ends up increasing the current, and high current will wear, or destroy the LED device. Red LEDs have a low forward voltage (typically around 2v), Blue and Green LEDs have a higher forward voltage (typically around 3v). The microcontroller send 5v, which is much higher than 2 or 3 volts, which means the LEDs and the microcontroller should be running very high current for those tiny devices. I have run these cubes for well over a year non-stop, and can not find any signs of wear or damage. If you want to assure that your LEDs are not ever going to get over current, then need to add resistors. Adding a resistor on each LED isnt really going to work, but you can add a resistor to each microcontroller pin (or where each one connects to the cube, electrically its the same thing.). 75 ohms should be about right, but even then its complicated, Ill try to explain.
The red LED need 150 ohm resistor, at 5v, and the blue and green ones require 100 ohms, this keeps the LEDs under 20mA each. The microcontroller pins have a 40 mA limit, which isnt a problem except when you light more than one LED at a time, which the cube does. It shares the common lead on one pin, and up to 3 more leads on the non-common leads for the LED. That means 20mA on the color leads, but it also means 60mA on the common lead. Thats a little too high, but its only when you do white. and you dont really do white all that much.
Technically this design should burn up the LEDs and or microcontroller, Im not exactly sure why it doesnt ,but my guess is that the duration is very short, and the LED and microcontrollers are a little more tolerant than the specifications say, in cases of very short duration. Either way, you will get hours of enjoyment, but technically adding some resistors may or may not increase the cubes lifespan.
Because the red,blue, and green have different forward voltages, you can see the red LEDs light a little bit when other LEDs are lit. I have considered putting a tiny SMT resistor between the red LED lead, and stiff wire. This should help reduce the red ghosting.
Step 13: Take a Lot of Breaks!
This project isnt going to be built in one day, it will take several long hard days to get one of these completed, if you know what you are doing. If you are not a LeadSlinger(tm) total professional soldering person, its going to take you even longer to build one of these things, and if you are lead-slinger-pro, its still going to take a considerable amount of concentration to do it. Take a lot of breaks, they dont have to be very long, 5 or 10 minutes is often enough. Its real easy to get overwhelmed with the amount of work, and try to rush things, but that always makes things worse.
When you get better at soldering, you will naturally get faster at it, but you have to focus on what you are doing to get better at it, and if you wear yourself out, you forget to think about what you are doing, and are prone to make mistakes.
This is going to sound counter productive, but to get fast at something, you need to go very very slow. This gives you a chance to fine tune each movement to remove all waste. Doing this requires a lot of focus on the details, you have to be able to focus your attention, which is why you need to take breaks periodically, or you lose focus.
With practice you will get better, and faster, your first spire may take hours, but your last spire will take minutes.
Here is a recent time lapse video of me making a spire, in under a minute (I wish I could really make them this fast!)
Here is a playlist of 3 videos from a couple years ago:
We have a be nice policy.
Please be positive and constructive.