3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Charlieplexed row of LED lights, for the Arduino

Charlieplexed row of LED lights, for the Arduino
 This is my instructable on charlieplexing a LED row/string with the arduino. I noticed that there weren't many instructables on charlieplexing using an arduino, so i made this. I tried to keep the project simple, but that didn't work very well. The soldering is complex, I wouldn't recommend this as a first time soldering project.

Here's some background on charlieplexing: en.wikipedia.org/wiki/Charlieplexing

I took about 80 pictures & not all of them made it into the main steps, but you can find them in step 9: Extra Pictures

If you have any comments, questions &/or suggestions please ask them!


 
 
Remove these adsRemove these ads by Signing Up
 

Step 1Parts List:

Parts List:
«
  • 100_4033.JPG
  • Circuit Diagram.png
Parts:
- 12 LED's; I'm using some 3 mm Red LED's
- 4, 270 Ohm resistors; You can use other values as well
- Perfboard/Veroboard; I used a piece 27 holes x 5 holes
- Wire; I used some 26 gauge, solid core wire
- Header pins (optional)
- Arduino

Tools:
- Soldering Iron
- Hot glue gun (optional)
- Helping hand (optional)
« Previous StepDownload PDFView All StepsNext Step »
28 comments
Jul 6, 2010. 8:14 AMsarath12445 says:
i am not able to download the code... it is downloading as .tmp format and not as .pde
May 18, 2012. 4:05 AMRich1953 says:
Mine did the same thing. Just re-name .tmp to .pde
Jan 26, 2012. 2:12 AMphenoptix says:
Found this to be a very useful instructable, although I found the diagram a little hard to follow. I had a crack at a version myself and came up with the following. I've colour coded the pin outs which has helped me with visualising
Charlieplexing.
My plan is to have play with the code to see if I can improve the bounce of the larson, and perhaps port it to an ATTiny rather than monopolising an Arduino!
Great instructable by the way. Having a look at your new ones now!
Apr 2, 2012. 8:13 AMpglasspoole says:
Your schematic is backward from the instructable. You have pin 1 going to LED1, LED2, LED3 and the instructable has pin 4 going to LED1, LED2, LED3. Pin 2, pin 3 and pin 4 of the Arduino are also flipped (i.e. 1 to 4, 2 to 3, 3 to 2, and 4 to 1).

Additionally, you both use pin 1, 2, 3, 4 in your schematic and then use 0, 1, 2, 3 in the code.

Lastly, neither of these schematic allow the program to work in all three modes.

Am I missing something or was this just a very poor example of charlieplexing. It is complicated enough without getting contradicting info.
Apr 2, 2012. 12:52 PMphenoptix says:
The schematic you've commented on and the instructable have different authors, hence the differences. I went away to try to get my head around charlieplexing and that's what I came up with independently and as it helped me understand the concept, so I thought I'd share it. It was my first attempt and I've improved it since. With the new one below. The pins are labelled ABCD in this version...

The instructable is a really good example of charlieplexing and helped me a lot. It's not the only resource I used to understand the concept.
Apr 3, 2012. 7:19 AMpglasspoole says:
The schematic above is very well done. Congrats!
Aug 26, 2010. 12:28 PMRobot Lover says:
How could I do this with 22 LED's?
Sep 2, 2011. 8:03 PMTerivia says:
you would expand the circuit using charliplexing.
(a good explanation is here

http://uzimonkey.blogspot.com/2009/01/charlieplexing-on-arduino.html

to figure out how many pins you need, well the relationship for pins to leds is

y = x^2 - x
with y being leds, and pins being x.
Dec 17, 2011. 5:37 PMdiy_bloke says:
Got me back to my highschool days, several decades ago. For those having trouble calculating that:
{1+root(1+4y)}/2 or
{1-root(1+4y)}2
(and then take the positive number)

so for 22 LED's this would be 5.7 lines (=6) -> 22 is an ineffecient number of LED's with regard to the number of datalines

3 lines wld service 6 LED's
4 lines wld service 12 LED's
5 lines wld service 20 LED's
6 lines wld service 30 LED's
Aug 3, 2010. 8:25 AMVick Jr says:
Are the resistors there to protect the LEDs? If the arduino is using around 3 volts then can we skip them? I made a cylon eye scanner that works fine with no resistors. I'm using blueish white xmas light LEDs, so they might take higher voltage anyway.
Feb 6, 2011. 2:16 PMardor says:
I know this question is ancient by now but just in case some one else is looking at this tutorial I'll answer it.

The Arduino uses 5V not 3 so you do need the resisters.

Your christmas tree leds either have resistors in them somehow, are a higher voltage or... Shrug, you got luck somehow...
Aug 9, 2011. 9:09 AMfacilitator476 says:
Are the resistors that important to led's? ive been using mine for simple light-up projects with an arduino uno and havent hade any problems. Either way if it did start smoking i think i would stay it was part of the design.
Sep 7, 2010. 7:17 AMnoik says:
open it with notepad and copy it to your arduino program, should work
Aug 8, 2010. 11:33 PMidiotjohn says:
also on a different point, is it possible to change the pins used? I see that there is a place to define them, but even if i change them there, it does not change it.
Aug 8, 2010. 8:40 PMidiotjohn says:
I made it and got it all working without any modification of your code. I went through labeling each LED, using the turnon() function. When I ran turnon(12); it turned on the LED that I had previously labelled as 4. I figured my soldering or something must be wrong... BUT, when I ran the sequence, it ran correctly, all I had to do was place LED 12 in front of LED 1 and then it works. I am very very confused. John
Aug 3, 2010. 11:24 AMVick Jr says:
I wired everything together, all the leds can turn on, and the cylon scanner works, but when certain leds turn on, other random ones will glow dimly. Is this because I left out the resistors or does it mean there's a short somewhere? This is my first charlieplexing project and although it's not perfect, I'm still glad it partially works. thanks!
Jun 23, 2010. 11:16 AMtonysofla says:
It's easy to include some type of PWM dimming as Charlieplexing is already a type of duty mode. If counter is higher that fade value, just skip that LED this time.

I have 8bit level PWM here:
http://www.youtube.com/watch?v=8apRaZQbv5w
Feb 16, 2010. 7:04 AMnoik says:
 Yes, I managed to make it work.! Thank's al lot, for this great instructable, :)
Feb 16, 2010. 6:35 AMnoik says:
 Code doesn't work with my arduino, it gives a error. 
Nice instructable!

Oct 26, 2009. 7:11 AMnolte919 says:
I know it would be a pain to change at this point but your schematic is a bit confusing.  I think you call it "Circuit Diagram.png".  It appears the red wire coming from pin 3 through the resistor is going to BOTH the anode and cathode of the three pins it's attached to.  After a little thought it's clear you meant it to go only to the cathode but this might be more confusing to somebody else.

Great instructable.
Oct 21, 2009. 5:49 AMWyoJustin says:
Sweet!  Clever design. Great instructions.  Great photos.

Nice work.
Oct 21, 2009. 3:07 AMrichms says:
An easier way is to put half the resistance into each of the wires, and then you can swap the polarity of 2 neighbouring LEDs to get less of the looping around connections happening.
Oct 21, 2009. 2:47 AMbeardy says:
 Brilliant!  Thank you.

Seems to be a relatively 'simple' how-to.  I've been wanting to do this for a while but have been a bit bamboozled when it comes to actually wiring it.
Oct 7, 2009. 4:25 PMDarkStarPDX says:
Dude, I'm thinking that we need to replace those LEDs with some 12 volt relays and wire up some real lights onto the back of the car! :-)
Oct 7, 2009. 1:12 PMBongmaster says:
looks fun and complex O_o

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
42
Followers
15
Author:computergeek