Using DPDT Switch To Control All Three Colors Of An RGB LED

Discussion in 'The Projects Forum' started by jpalarchio, Feb 2, 2010.

  1. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
    I've been lurking for a while and I'm a complete newbie that's learning more every day by reading this forum.

    I have a project where I'm using a center-off DPDT switch that is controlling a relay on one side and on the other side I would like to use an RGB LED to indicate status.

    When the switch is up ("auto" for my project), I would like to light the blue LED.

    When the switch is in the center position ("off" for my project), I would like to light the red LED.

    When the switch is down ("manual on" for my project), I would like to light the green LED.

    Unfortunately my lack of experience has me stuck in that I can't figure out how to light the "auto" or "manual on" LED without lighting the "off" LED at the same time.

    Seems like I should be able to do this through some kind of combination of diodes but I've yet to come up with anything.

    Any assistance in this area would be greatly appreciated. It seems like I need some type of logic to block the voltage to the red LED when either of the others is lit.
     
    Last edited: Feb 2, 2010
  2. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    1. What is your power supply voltage, and
    2. how much current do you want to run through each LED?

    EDIT: Do you have a part number for the RGB LED?
     
  3. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
  4. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    You can do it like this. Someone else may come up with a simpler circuit.
     
  5. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
    Thanks Ron.

    I can't say I completely understand how it all works just yet but I'm doing some reading and it's another learning point for me.
     
  6. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
    Looking at this more, it was suggested to me that it could possibly be done more easily with a NOR gate.

    Any ideas?
     
  7. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    That will work, but it takes more than a NOR gate. I am not too thrilled with someone who throws out an idea without a schematic. Have your suggestor provide a schematic, and post it here.
     
  8. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
    Unfortunately I don't have a schematic, it was just a thought tossed out.

    Waiting for a few components to come in and then I'm going to build up the circuit you provided previously. I understand how that one works now and it's reasonably simple.

    I'm going to have about 10-12 of these switches on my control panel so if there was a smaller footprint, I thought I'd try it.
     
  9. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    You should measure the cheap (expensive) Chinese LED because they say "common cathode" but show "common anode".
    I wonder if it will last longer than 1 week.
     
  10. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
    Yeah, the quality is suspect sometimes, go figure...

    I actually ended up ordering a diffused version from a different vendor but those chinese listings tend to have errors in the details all the time.
     
  11. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Here's a version with one less part.
     
  12. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    I think it'll be hard to get simpler than this.
     
  13. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
    Wow, that's really great Ron.

    Much appreciated. The different variations give me some stuff to analyze too. Thanks!
     
  14. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    The following circuit is untested but *should* work. :D

    [​IMG]
     
  15. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    That might be good enough. I simulated it, and the red LED was still getting 2.2mA wnen it was supposed to be off. That might still result in a fair amount of light.
    I changed the red LED that you added to one with 3.6V drop (@20mA), and the red current dropped to 13uA when it was supposed to be off, but it was drawing only 15mA when on. That would probably be OK.
    I certainly wouldn't trust simulation results for this circuit. it would need to be tested before committing to it.
     
  16. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    I know. That's why it is untested. :p

    Just replace LED D4 with a regular blue or white LED or a 3.9V zener diode and everything will be fine.
     
  17. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
    Wow, you guys are really starting to make this too easy.

    I'll pickup the parts to try and test these out. Both solutions are simple enough for me at this point; very cool to see the progression from something I thought was going to be near impossible to something that very achievable.

    Thanks again.
     
  18. RAC

    New Member

    Feb 6, 2010
    2
    0
    How about using a 2 pole 3 position switch? Not sure how locked into a ON-OFF-ON you are but ........
     
  19. jpalarchio

    Thread Starter New Member

    Feb 2, 2010
    9
    0
    Not really locked into ON-OFF-ON but it seemed the most economical and that's what I bought.

    I'm using a DPDT switch where one side of the switch is controlling a relay through manual input (on and off) or from an arduino (auto). The other side of the switch is going to control the status LED (red = manual off, green = manual on, blue = auto).

    What I've learned here is that there's probably 25 different ways to accomplish this same functionality and at my scale, the cost difference of having one or two more components probably isn't significant.
     
  20. RAC

    New Member

    Feb 6, 2010
    2
    0
    I tend to look at things from an electro-mechanical veiwpoint so the rotary switch seemed "easy" to me, but thats why I started to visit this site, so I could get a different perspective. Maybe I am missing something obvious but I do enjoy seeing the different solutions.
     
Loading...