# Charlieplexing different LEDs

I have four LEDS (Red,Green,Blue,Yellow) and want to use charlieplexing to light them up. I'll use an Attiny13V which needs 1.8 to 5.5V. I think one CR2032 with 3V will be suffice for the µC. The forward voltages and current of the LEDs are:

        Min   Typ   Max | Max (mA)
Red:    1.7   2.1   2.8 | 20
Green:  1.7   2.1   2.8 | 20
Yellow: 1.7   2.1   2.8 | 20
Blue:   2.9   3.3   3.6 | 10-20


Will I'm able to light the LEDs with the CR2032 and how can I find the right resistor values?

The 3V cell will suffice for the red, green and yellow leds, but not for the blue. Your supply voltage needs to be greater than the forward voltage of the diode.

Assuming you can use a larger supply voltage, I'd do: (taken from the image on http://en.wikipedia.org/wiki/Charlieplexing ) LED1 is the blue led and the others can be placed in any way.

R2 is the current limit resistor for LED1, so should be set to about 120 ohms, assuming a supply voltage of 5V and a forward current of 15mA.

R=(Vsupply-Vforward)/Iforward

The current limit resistors for LED2 is R1+R2 and for LED3,4 is R2+R3. As the LED forward voltages are nominally the same, set R1=R3 and choose R2+R3 to set the current. R2+R3=180 gives a forward current of 16mA at 5V. This means R1=R3=60 ohm.

With this circuit, if you set pin 1 low, pin 2 tri-state and pin 3 high, LED2 and LED4 will turn on dimly (again, if you're using a 5V supply). This may be desirable or something to avoid.