Introduction: Arduino Charliplexed Heart, Just in Time for Valentines Day.

About: My name is Jimmie Rodgers, and I like to dabble with hobby electronics for fun. Visit my project blog for more things I've done: [http://blog.jimmieprodgers.com blog.jimmieprodgers.com]
Here is an Arduino controlled Charliplexed LED heart just in time for Valentine's Day. It uses a total of 6 wires to controll the 27 LEDs. A PIC or AVR could easily be used for this, but I have Arduinos lying around and they are easy to program. Plus I want to be able to have input options later when I have time to write them.

Go here for a great explination of Charliplexing.

Update 5/20/08:
I've actually made a kit for this, and I'm now taking pre-orders on my website. I also created a flash-based animation programmer. Check them out and let me know what you think. The programmer generates the newest version of the code, so it will still be a useful tool if you make your own heart. You will just need to change out the LED array with one that maps to your own.

Update 2/12/08:
I've updated the software to v 1.3. I found a function called PROGMEM in the avr/pgmspace.h library (included with Arduino software) that allows you to write directly to the Flash ROM. That now gives about 500+ frames of animation, and is an extremely easy thing to implement. You can check out the new software here.

Two of my friends are currently working on getting a bitmath version that should increase this even further (to around 4,500 frames), but while working, it is not very easy to work with in creating animations. I'll release that once I have my Processing program up and generating the animation codes.

Update 2/11/08:
I've put the schematic on step 1. There is a direct link to it on my flickr as well.

First Animation


Second Animation

Step 1: Required Materials

- 27 LEDs I would suggest red, but these would be cool too.
- 6 resistors to match your LEDs I used 100R, but go here to figure it out yourself.
- 6+ wire cable, I used Cat5 because I had it lying around
- soldering setup
- some type of prototype PCB, I used this one from Radioshack and it fits the heart perfectly.

Update 2/11/08:
Here is the schematic as viewed from the top. You will want to review that before, during, and after building. Once it is built, you will need to test thoroughly. Each 2 wire combination to a battery should light up one, and only one, LED. If 2 light up, then something is wrong. There will be 3 combinations that won't light anything up, so don't worry, and just make a note. If more than 3 combinations fail to light up, then you probably have a short, or a fried LED.

Step 2: First Layer

Now we begin the soldering. For this step, most of the instructions are in the picture.

Basically, you are going to create 4 sets of two pairs. They will all be aligned in the same way. Then you will connect the middle sections of both the top and bottom.

Step 3: Start the Layering.

Now you will continue to solder and start layering the connections. This is where it starts to get complicated. At least you are going to just mirror your connections so far. Whatever you do on the right, you do the opposite on the left. Just be careful not to create any shorts, and give the bent wires enough room that they won't short if moved a little.

1. Top right + lead bends over left to the top right - lead.
2. Top right set's bottom - lead bends to the right to make contact with the + lead.
3. Do the same for the bottom set.
4. Bend the top set's top left - lead down to the bottom set's top left - pin.
5. Bend the lower right + lead of the top set down to the lower right + lead of the bottom set.
6. Do the opposite on the other side.


It may look bad, but you are going to end up with something that looks like two C's facing each other on each side. The top middle sections will be joined, as well as the bottom middle sections.

You then add the two center LEDs in opposite alignment of each other. You want the top one to be in the same alignment of all the others so far, and the bottom one to be the opposite. Then you connect the - of the bottom one to the + of the top one, and then to the top center connection. Then you do the opposite for the other two, and connect them to the bottom center connection.

It will be a total of 2 separate connections on each side, with the 2 in the middle. The start of the 6 total connections. Now we just need to fill in the other possible combinations (a total of 30).

Step 4: Final Layers

Here we start the final layers.

The two side pairs are going to be installed the same way as the middle pair was. But now you connect them to the C shaped connections closest to them. One to the outer, and the other to the inner of their side.

Then you install the next lower middle pair of two in the same fashion of opposite alignment, and connect them to the two middle C connections. However, I wouldn't advise you to connect the bottom most LED into it's set yet, as you are about to bend a lead under that connection.

The next two I installed aligned in the same direction on opposite sides of the bottom middle LED. I bent the + lead of the right one between the bottom center LED and it's mate. Connecting to the - lead of the bottom left LED, and the outer left C shape. You then take the bottom left LED's + lead, and bend it to the bottom right LED's - lead, and then to the opposite outer C shape.

The final LED I bent the + lead to the bottom middle's + lead, and the - lead over to the outer left C shape. You should now clip any stray leads, and make sure there aren't any shorts.

You will end up with the pairs covering all but 3 of the possible combinations that 6 solid connections will give you. So poke around with a 3v + and - wire and watch the different LEDs light up one by one.

Step 5: Connecting and Programming

Now all that's left to do it to wire it up, and connect it to an Arduino. Since I'm using Cat5, I'm going to go with that color scheme. Here is as best I can describe it from the view of the first picture.

Orange - top middle
Orange w - bottom middle
Blue - inner left C shape
Blue w - outer left C shape
Green - inner right C shape
Green - outer right C shape

You are going to want to test the connections from the other side of the cable. This makes it easy to touch random combinations to the 3v batteries.

Here is a spreadsheet I created to track the connections. If yours are different for some reason then make notes, as changes will have to be made when you load the software.

When I started out, I used a number scheme based on the columns. There were a total of 5, with the outer ones having 6 each (65556). Ignore that for programming, go with the 1-27 one, as it is much easier to address in the program. However, it is still useful while testing, as trying to remember which one is 16 can be crazy, but finding the 3rd one in column 4 (43) is easy. Both are there for you.

Here is the source code that I used for the two animations in the videos. Remember to put a resistor between your Arduino pins and your wires!!

Unfortunately there is a limitation on the Arduino's array size. I'm not sure what it is, which is why I made an array of bytes to save space. Basically you can have any two of the animations, but not all of them. If the Arduino doesn't respond, comment out some lines of the animation, and then send that over.

This is only the first version. I've already written something in process that I can use to plan the animations, and once I've got it generating code to work with my program, then I'll release that too. I'm also working on a second version of the software with multiple animations and interactive controls. I'll make sure to update once I've got some of that working. Subscribe to my blog for any updates.