Beginner Question Charlieplexing 30 RGB leds...?

hi,

i'm intending to charlieplex 30 rgb led lights, common cathode. i am very new to this all and only bought an arduino (sunfounder clone of uno r3) about 1 month ago. i taught myself how to charlieplex regular led lights, and after pouring over schematics i found online, it seems to me that charlieplexing rgbs is confusing, but maybe not so much as i thought.

however, schematic drawings are still difficult for me to understand, as i am thinking in terms of wiring them up.

i have a written plan for how to wire my leds using 6 pins. here's a sample of the wiring for the first 12. Negative is cathode, and rgbs is to their respective pins:

(led) (-) ( r,g, b)
L1 1 2 ,3, 4
L2 2 3, 4, 5
L3 3 4, 5, 6
L4 4 5, 6, 1
L5 5 6, 1, 2
L6 6 1, 2, 3

L7 1 3, 4, 5
L8 2 4, 5, 6
L9 3 5, 6, 1
L10 4 1, 2, 3
L11 5 2, 3, 4
L12 6 3, 4, 5

I hope this makes sense.
my question is for Leds like L3 and L8, will there be any problem with turning them on separately? i've gotten myself a bit confused, and also dont have the parts to test it out so i wanted to ask before i start planning my build. i'm thinking since the cathode on any "matching" sets of rgb pins will be different, when i set that to input low, only the light i want will turn on.
for L3, would this work for example for turning on red light? with pins set as int, GO1, 2 etc.

pinMode( GO1, INPUT);
digitalWrite( GO1, LOW);
pinMode( GO2, INPUT);
digitalWrite( GO2, LOW);
pinMode( GO3, OUTPUT);
digitalWrite( GO3,HIGH);
pinMode( GO4, OUTPUT);
digitalWrite( GO4, LOW);
pinMode( GO5,OUTPUT);
digitalWrite( GO5, LOW);
pinMode( GO6,OUTPUT);
digitalWrite( GO6, LOW);

as you can see, this is already long and sort of messy. i am new to code as well so i am trying to understand what i will need to learn in order to simplify my code. i'm not sure the terminology, but i would like to set a state of led's being on (or at least delayed since it's charlieplexed) and then make patterns based off that set info.

also, how do i combat the problem of colormixing rgb's with charlieplexing?

the project i'm making is like a panel of led lights spaced apart (5 rows of 6) that will be inside a box under frosted plaskolite.
i basically want to create some light patterns using various colors. i think to make it less confusing to myself, if i just have all the leds cycle through the rainbow or a few colors back to white, it will be easier than trying to make them do different individual patterns the only difference will be the times each led turns on/off.

if anyone can direct me to tutorials or posts dealing with this directly (charliplexing rgb leds and/or cycling colors on rgb leds) or help me here, i'd greatly appreciate it.

also, anyone have advice for following schematics for wiring other than color-coding the lines?

apologies for the newbieness of my post. not sure if i should've posted in another section. i know i am probably taking on a lot as a beginner, however, i really want to make something i like, and i think this project will teach me a lot.

(as an aside, is it possible to wire 30 leds other than charlieplexing using only 1 uno r3 board? i've read a little about shift registers, but need to read more. ideally i would like to have all leds on as white from the onset, then have a pattern of various leds fading through colors at different times against the other still white leds.)

thanks for the help everyone.

Hi Petalpure,

30 rgb leds is actually 90 leds. To charlieplex you will need 10 lines, not 6.

Colour mixing is very difficult with charlieplexing, requiring an advanced sketch with fast and precise multiplexing, but it could be done.

A much easier option for a newbie might be to use 6 tlc5940 chips. These are a kind of shift register but designed for use with LEDs. They can be daisy-chained and driven by an Uno (preferably with the SPI outputs). Each chip has 16 outputs each with over 4,000 output levels, and built-in current limiting, so no external current limiting resistors are needed. Unfortunately, these chips will only work with common anode leds, not common cathode. Most RGB LEDs are available in both varieties.

Paul

Thanks for the reply and advice PaulRB.

A MAX7219 can be used to drive common-cathode RGB LEDs as two by eight, so you would need two (in a daisy chain) to drive 32 LEDs.

You do not get individual intensity control, just 7 basic combinations. If you want individual intensity control, you are better to use the LED chains with individual WS2801 control chips. About $1 per LED, ready-wired.

Thanks Paul__B for your post.

Anyone have any direct answers to my questions about charlieplexing? I want to explore shift registers maybe, but only after I've understood what I will or won't be able to do with charlieplexing.

OK, I'll have another go.

With either Charlieplexing or ordinary shift registers, you will be able to drive your RGB LEDs, But you will get only 7 colours: red, green, blue, yellow, magenta, cyan and white. You won't be able to mix other shades. It is possible to get other shades with these techniques, but the sketch will be too complex for a beginner to write. It requires high very speed multiplexing and use of a technique I can't remember the name of just now, where the time of each multiplex period within a group varies by factors of 2.

To avoid this, use the 6 tlc5940 chips. No multiplexing, transistors, shift registers, current limiting resistors or complex sketch needed.

As a half-way house, it is possible to use a single tlc5940 and a shift register and some transistors so you can do a more simple multiplexing technique. There was a recent post about this...

Paul