Question about RGB LED circuit...

Started by Govmnt_Lacky, August 11, 2013, 04:43:03 PM

Previous topic - Next topic

Govmnt_Lacky

I would like to wire up an RGB LED circuit so that it will do the following:

- Run from a single RGB LED
- Run on 5VDC, single V+ feed if possible
- Be able to change colors by switching grounds via a rotary switch
- Be able to switch between 4 colors

Im looking to incorporate this into a current design. I need it as a power on indicator and I need 4 different color/indications. I know it will involve a circuit IC of some type however, I am not very experienced in LED circuitry.

Im hoping someone could point me to a simple circuit/setup to accomplish this.

Thanks  ;D
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

stallik

I did this a while ago as a stand alone to demonstrate colour mixing. It was not part of an audio circuit so you may have to take this with a pinch of salt. I used a 4 leg RGB led with a common cathode and separate anode for red, green and blue.  I used a rotary switch and 3 little  2 pole relays. Basically, position 1,2,3 switched primary red green & blue,  positions 4,5,6 switch in the relays which in turn switch the combinations of the primaries. I had to use the relays as it was the only way I knew how to mix the sections of the led without shorting them for the primaries. I'm sure that an ic would have done the job better but that was beyond me
R+G = yellow, G+B= cyan, R+B= magenta, All 3 = white.  The purity of these colours is down to the design of the led but it was OK for my purposes.
Of course when you switch on 2 of the colours, the brightness increases so I chose to add a resistor for each pole of the relay and by choosing different values I was able to tune the colour to correct the hue.
I'd examine the circuit and let you know the values I ended up but while the circuit worked really well, it turned out to be an awful teaching tool. Separate switches were much better..... So I changed it.
Insanity: doing the same thing over and over again and expecting different results. Albert Einstein

Govmnt_Lacky

Thanks for the reply Kevin!

I am hoping to incorporate some type of IC switching or perhaps a discrete semi that is suited for this. I have been searching the web but, since I am not familiar with this... I am coming up with very little results  :-\
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

stallik

Like this?
http://www.best-microcontroller-projects.com/rgb-led.html
Everything I found when I was researching this used pic controllers and I've never got into all that. Perhap I should.
I'd be interested in your final solution if you don't mind sharing
Insanity: doing the same thing over and over again and expecting different results. Albert Einstein

Govmnt_Lacky

Quote from: stallik on August 11, 2013, 06:03:41 PM
Like this?
http://www.best-microcontroller-projects.com/rgb-led.html
Everything I found when I was researching this used pic controllers and I've never got into all that. Perhap I should.
I'd be interested in your final solution if you don't mind sharing

It looks like the circuit in that link is used for automated and/or coded purposes. I want to be able to change the colors manually.

I was thinking it would work like this:

-5VDC going to Discrete IC which also goes to RGB LED.
-Ground--> Rotary Switch-->Discrete IC--> RGB LED.

The 5VDC would power the IC and the RGB LED. Then, the ground would be chosen via the rotary to the IC and it would determine which pins on the LED would be grounded and therefore which colors would light up.

Also, it could be the other way around. Using the 5VDC to select which colors would light up.

Am I way off on this?  ???
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

mth5044

Using an PICAXE would make it incredibly uncomplicated. I was trying to think of ways to do it with a 4066 or something, but can't seem to think of anything for the part where you need to combine colors. If you'd like me to code one for you or help you develope a code I'd be more than happy.

Govmnt_Lacky

Quote from: mth5044 on August 11, 2013, 06:59:25 PM
Using an PICAXE would make it incredibly uncomplicated. I was trying to think of ways to do it with a 4066 or something, but can't seem to think of anything for the part where you need to combine colors. If you'd like me to code one for you or help you develope a code I'd be more than happy.

PM'd  ;)
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

stallik

I think I must be missing something. The switch is controlling the voltage to each leg of the led so why the ic?
You could use a relay drive chip such as
http://www.nxp.com/documents/data_sheet/74HC_HCT4066.pdf
Connect each leg of the led to a separate relay and switch on whichever one you want via the rotary?
This would give you possibilities of r,g,b,c,m,y & white.
In this case I would still wire rgb directly and place a resistor on the outputs of the relay chip to give a more even brightness when using the secondary colours but that depends on how many rotary positions you want to use

Just seen the reply from mth5044... Now I'm even more interested in your final solution
Insanity: doing the same thing over and over again and expecting different results. Albert Einstein

Govmnt_Lacky

@Kevin,

I want to use a single pole - 4 throw rotary switch for control. The pole could be either the GND or the 5VDC.

I would like to use Red, Blue, Green, and Yellow only.

Waiting on Matthew to see what he comes up with  ;)
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

Digital Larry

You could use diodes and skip the micro com pletely.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Govmnt_Lacky

Quote from: Digital Larry on August 11, 2013, 07:14:34 PM
You could use diodes and skip the micro com pletely.

Hey DL...

Could you please offer a sketch of what you mean? Like I said, I have very little knowledge of these things...  :-\
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

mth5044

Diodes would totally work. There was a recent thread about it.. let me see if I can locate it. Good call Digital Larry.

Digital Larry

#12
I'll try to describe it first and if you're still stuck I'll draw a picture (on vacation and lazy)...

Let's assume you're using a common anode and pulling the cathodes down to ground through a resistor to turn on the LED.

So switch position 1, let's suppose it's R and B.  Get two diodes (1N4148 are probably OK) and connect their cathodes together to S1.  The other side of S1 goes through a current limiting resistor to ground.  The anodes connect to the cathodes of the corresponding LEDs.

So switch position 2, let's suppose it's R and G and B.  Get three diodes (1N4148 are probably OK) and connect their cathodes together to S2.  The other side of S2 goes through a current limiting resistor to ground.  The anodes connect to the cathodes of the corresponding LEDs.

You might see a pattern emerging here....

From one switch to another the extra diodes are all back to back and therefore the switches are isolated from each other.  Does it make sense?

The LED cathodes will wind up with a BUNCH of diodes connected to them.

Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Govmnt_Lacky

@Larry

I still dont understand how to get the 4th color (Yellow in this case)

I might sadly need the diagram  :-\  :icon_redface:
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

Digital Larry

Hey GL I gotta take my kids for a walk.  What combo of LEDs gives yellow?  Red and green?
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

mth5044

Can't find the thread but can find this!


Govmnt_Lacky

Quote from: Digital Larry on August 11, 2013, 07:33:47 PM
Hey GL I gotta take my kids for a walk.  What combo of LEDs gives yellow?  Red and green?

According to Matthew's contribution... You got it right!  ;)
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

stallik

So rgb can go directly, r & g go via diodes to create yellow and no need for a relay. Simple Larry, enjoy your walk
Insanity: doing the same thing over and over again and expecting different results. Albert Einstein

Digital Larry

OK I get it now.  My description was a bit over complicated.  I was thinking of a way to get a selection of ANY 4 colors.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

Govmnt_Lacky

Quote from: stallik on August 11, 2013, 07:50:58 PM
So rgb can go directly, r & g go via diodes to create yellow and no need for a relay. Simple Larry, enjoy your walk

Kevin,

Could you dfiagram and/or sketch this for us simpletons?  :icon_redface:
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'