Hey there everyone, this is my first post. I signed up for these forums because after hours of going about the internet, i was royally confused with this. Im pretty new to arduinos, or any type of electronics for that matter (mechanics were more my thing). I am building an LED knight rider scanner for the hood scoop of my truck, just for fun. Im going to have a number of LEDs inside it, to scan back and forth when the arduino receives power. If i was just going to use 13 or less LEDs, i would just have the negative all connected to the ground, and simply have one LED hooked up to each pin. i plan to use at least 18 LEDs though. After searching through google i started reading about charliplexing, and i think that is how i will be able to get this done! So far, not having too much luck though. The LEDs do cycle in order! But... other LEDs come on too :/ if anyone can help me solve this i will be very grateful!

I've considered this project for about 20 years now, my car has a fake hood scoop that would be perfect for it. For some reason, i've never actually done it, I even have some boards that already do the circuit, all i would have to do is hook it up to new LEDs, and power it. Maybe one day I will do it...

Charlieplexing is a great way to control a lot of LEDs, but using LEDs with built in resistors might be an issue, since you will be always using 2 resitors anytime you try to light an LED. If you can control the resistor size, you can calculate your resistor size, and then use 2 resistors that are 1/2 the correct value, to end up with the right value when charlieplexed.

The code for turning on an LED will always be one high, and one low. both high, or both low should not light anything, and reversing polarity will change which LED is lit.

You can also run 18 LEDs off the arduino, but you would need to run them at 10ma, instead of 20, which would be a bit dimmer. There are other options too, but it gets more complicated.

If properly wired, you should be able to control 20 LEDs from 5 pins with charlieplexing. You could also multiplex 25 with 10 pins easily enough.

Charlieplexing is a great way to control a lot of LEDs, but using LEDs with built in resistors might be an issue, since you will be always using 2 resitors anytime you try to light an LED.

Not if the resistors are in parallel - which they <i>will</i> be if they're "built in".

Thats curious, why would you build a resistor in parallel with the LED?

If you use the TLC chip, you will only be able to run 16 per chip, and you will also need some other parts (a couple resistors and a cap per chip). If you want to run 18 LEDs, then you will need 2 TLCs, 4 resistors, and 2 or maybe 4 caps. You will also probably want to use some kind of circuit board to hold all these parts.

its a lot of extra stuff to learn and build, but you get the benefit of PWM, so thats kinda cool, if you want that feature.

another way to do it is to serialize each LED with its own chip. It uses a lot of parts, but its easy to expand/contract the number of LEDS.

Multiplexing uses no extra parts, but it is more complex wiring, its sort of a trade off.