RGB LED

I am in need of an indicator circuit that uses an ON-OFF-ON toggle switch to control the state of an common cathode RGB LED. THe circuit will be used to build an indicator panel for a DIY automation project that shows that state of the Hand Off Automatic (toggle) switch.

I have a somewhat working circuit using an PNP transistor. The ON-ON part works perfectly by toggling the Green and Blue anodes. However the OFF state, where the RED LED is to be lit, does not work as well. The G and B leds continue to stay dimly lit.

I came up with this circuit through trial and error. I would like to know what I have done wrong and how to make the circuit (or a new circuit) work as "expected":

Switch "ON-1" GREEN lit Switch "OFF" RED lit Switch "ON-2" BLUE lit

Regards, Bill

Reply to
beananimal
Loading thread data ...

I should have posted the link to the circuit

formatting link

beananimal wrote:

Reply to
beananimal

I'm redrawing that, with mods - use a fixed font, like courier:

on o----------+----------------- Blue anode +12 --+--o off | | o----+-----|----------------- Green anode [D] on | | |k | | | | | \\e [D] [D] | |k |k |--------+-----+ /| | / [47k] | | | GND Red Anode

I'd pull down the base of the tranny to turn it on to make the red one come on, then essentially short the base to +12 to turn the tranny off for green or blue. I've added the diode in series with the emitter to be sure that it gets turned off fairly decisively. The two diodes are called "steering diodes" or an "or" gate. In this case, I guess more of a 'nor'. :-)

Hope This Helps! Rich

Reply to
Rich Grise

Thanks Rich,

I tried using diodes in a similar fashion but they didn't work (likely because I neglected to add 47K resistor. I am eager to try your proposed circuit and like it's simplicity. I messed around with using a second transistor to ensure a complete turn off.. but did not like the complexity (not to mention I was more or less just guessing at component values).

I am very familair with gates and logic, just not how to construct them from discrete components :)

Is the 3rd diode (the one on the emitter) to keep the voltage drop equal in reference to the base?

Reply to
beananimal

Also, can a single diode (1n4148 or similar) be used to connect to several emitters (to keep component count and board space to a minimum?. If the avg LED current is 20ma, then I would think that 8 emitters could be tied to a single 1n4148 rated at 200ma? The indicators will be in 3 banks of 8 (for a total of 24 switches).

Thanks again for your help!

Reply to
beananimal

No, the diodes have to be per switch, assuming you want each set of three to be independent from the others.

If you want to know if _any_ of the "green" switches is closed, however, (and leave the rest as is) then yes, you'd use a diode for each switch, in addition to the "local" one, and tie all of their emitters together at the "any one or more" node, which is again, called an "or" gate.

The reason for the diode in the emitter lead is to bias the emitter up by .7V so that when the switch is closed, the base would be reverse biased. Without that, the transistor could still leak if it had only the diode from emitter to base, i.e., there'd be one diode drop, and the e-b junction would be biased right at the knee.

I also assume that your omission of dropping resistors in your schematic means that you've either already accounted for them or the LED(s) has(have) their own current-limiting built in.

Thanks! Rich

Reply to
Rich Grise

Rich

I think I understand what is going in here. I can see that the "steering" diodes are driving the base high when the switch is in an ON state and thus preventing the transistor from conducting. I also see that they prevent the current from traveling back to the opposite LED on the switch. I also understand why the RED led lights when the switch is in the off position becasue the transistors base is pulled low relative to the Emitter via the 47K pulldown. Even after your edxplanation the emitter diode puzzles me somewhat (excuse my ignorance but I am 100% self taught when it comes to electronics).

After reading what your wrote several times, I am starting become confused :)

The voltage drop across the emitter is .7 volt, so lets say 11.3 volts to the emitter at all times. When the switch is closed, 12V travels to the anode of an LED and through a steering diode to the base of the transistor (where it is 11.7 volts due to the drop across the diode). Wouldnt this make the Base and Emitter the same? I would have though

With regards to the current limiting, yes I have been placing a current limiting resistor at the cathode of each LED (thats what that 1K resistor at the cathode was for). I am aware that each of the 3 internal LEDs in the package draws a slightly different current, but in this case I am using a fairly large value to keep ALL of them somewhat dim and because only 1 is lit at a time I assumed the resistor at the cathode would be fine, instead of a single unit at each anode. Am I missing something here as well?

I had assumed that providing 12V to all of the switches and then using a single diode to feed all of the emitters would provide the same thing.

I have drawn (I think) what you have proposed in circuit3

formatting link

And what I had thought would work in circuit4

formatting link

As you can see each RGB LED is to indicate the state of ONLY the switch it is associated with.

I am learning... but it is taking the patience of people like yourself. Thank you for all of the help. Please feel free to give up any time, as I fear that my lack of knowledge may be making this a frustrating use of your time.

Reply to
beananimal

circuit

I made a mistake in the original "circuit4" and have since fixed the error. The emitter diode is now positioned as I mentioned.

Reply to
beananimal

...

Well, you seem to have de-confuserized yourself, because circuit3 is perfect, except for one minor detail - it's upside down. By convention, we put the + supply at the top, and ground at the bottom. This is from TOOB days, but people have stuck with it.

And, this really should have been at .basics, but it's probably a little late for that...

I'm too lazy to trace all of the current paths, but that shouldn't be too hard for you to do - conventional current flows in the direction of the arrows, and remember Ohm's law and Kirkhoff's law, and that transistor E-B junctions, as well as diodes, drop about .6-.7V when they're conducting. And, to really know if this would work "as advertised", you should prototype it. :-)

Well, you're asking intelligent qustion, and doing your own homework. In general, we like questions of the type: "Here's what I've done on my own, but here's what I'm stuck on...".

Hang in there! Rich

Reply to
Rich Grise

Rich Thank you again for all of the help. I have breadboarded both circuit #3 and #4 and both seem to work. I am in the process of trying to figure out exactly what is goin in #4 to see if it is suitable and predictable/reliable (not such a trivial task for me). In the future I will post such questions to the .basics forum in hopes of getting the same type of quality answer. I have also corrected my supply rails and will keep that in mind for future schematics.

Reply to
beananimal

One other point: take a look at the way Rich oriented his schematic: horizontal, with respect to the input. Typically, a schematic is drawn with input signal(s) entering horizontally from the left and output(s) on the right; + on the top and - on the bottom. Best to try to draw your diagrams that way.

Ed

Reply to
ehsjr

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.