I am building a circuit and am stumped without using many relays to achieve the result. I would appreciate any help I can get.

Basically I have 3 different colour LED's in a (push button) some of these push buttons are momentary, and some are latching. The LED's are common ground. Therefore I will be switching the power side. They are built into the pushbutton and have a resistor, so they are rated at 12 V.

I have a relay controlling if I supply red or blue, so its an either logic based on another latching pushbutton. Blue for day, red for night. I use DPDT 12V relays for this. this is globally applied to all the pushbutton led colours. I.e. all blue or all red. (There are 30 switches with 3 LEDs each)

What I need to resolve is that if I push one of the 30 buttons, it needs to turn off the red and the blue input to that button indicator, and turn on the green only for that button indicator light.

I prefer to use 12V (10 - 15V) as it is supplied by a 12V battery. was thinking it can be solved with MOSFET or similar.

Sadly the pushbuttons are only SPST latching or momentary, no spare contacts

Thanks for anyone's kind help.

Apologies for the crappily written first attempt. When I read it back I confused myself.

On the picture, the 12V is not actually 12V, it is reduced due to the dimming setting. Just put 12V for the purposes of the diagram.

enter image description here

Truth table for OP to edit [added by @Transistor].

Relay  Button  R G B
Off    Off     0 0 1
On     Off     1 0 0
Off    On      0 1 0
On     On      0 1 0

Thanks all for your information and taking the time to reply. I took a look at the cmos option 4000 series as suggested by Jasen. I have no experience in using such components. I simulated the circuit and seems I need XOR gates. This simulation works. I simplified the input selection which is via a relay.

My only concern is the 4070 shows it has a limitation of 10ma per gate (i assume). i put the led onto the power supply and it flickers between.000 and .001a which should be ok.

I removed the resistors as the LED's have their own resistors, is that ok?

the only part i have left to understand and fix is the sensing of the pushbutton switch. as you can see on the schematic it is used to switch a relay. Currently when the Pushbutton is off, the transistor allows the green LED to illuminate. I need the opposite. I need when the Pushbutton is open, the green led to be off. thanks enter image description here

  • \$\begingroup\$ So, you want to either have Blue+Red or else Green? A binary choice between these two alternatives? \$\endgroup\$
    – jonk
    Sep 19, 2021 at 5:53
  • 1
    \$\begingroup\$ Very confusing. Can you draw a picture? \$\endgroup\$
    – tlfong01
    Sep 19, 2021 at 6:16
  • 2
    \$\begingroup\$ Your specification is poorly written. You mention switch and then seem to call it PB (which suggests a push-button) and then say there are 30 buttons which don't seem to be PB. Please Edit to clarify. I've added in a truth table for you to edit. You should find that you can write your specifications much more clearly with this. \$\endgroup\$
    – Transistor
    Sep 19, 2021 at 7:46
  • \$\begingroup\$ What type of contacts are in your push buttons? Are any of them still available? If not, how are the contacts used? \$\endgroup\$ Sep 19, 2021 at 13:33
  • \$\begingroup\$ Hi Jonk, yes correct. if the pushbutton is pressed, the green is illuminated and isolates both red and blue. thanks. \$\endgroup\$
    – KINGO320
    Sep 20, 2021 at 5:10

2 Answers 2



simulate this circuit – Schematic created using CircuitLab

Figure 1. A possible solution. (LEDs are 12 V and have built-in current limiting.)

How it works:

  • RLY1 switches between day (blue) and night (red).
  • If the individual switch or button is off Q1 or Q2 is turned on depending on the day/night setting.
  • If SW1 is pressed D7 and 8 conduct pulling the bases of Q1 and Q2 high and shutting them off. A Schottky diode is used here so that its lower VF will pull higher than the BE turn-on voltage of the transistor. (I haven't tested this. You should. The simulation in Figure 2 indicates that it's good.) The result should be that green turns on and the day/night LEDs turn off.
  • The primary purpose of the Schottkys (hmm - Schottkies? I don't think so) is to prevent illumination of D1 and D4 through the bases of Q1, etc.
  • You could half the number of Schottkys and use a common one for Q1 and Q2 but you'll end up wasting current in the the base resistor of the unpowered transistor.

You'll need 60 PNP transistors and bias resistors and 60 Schottky diodes! You'll need to decide if it's worth the trouble.


simulate this circuit

Figure 2. Simulation results for the circuit indicate good control. Left: switch / button off. Right: switch / button on.

  • \$\begingroup\$ AMAZING. thanks. much appreciated. I couldn't wrap my head around it. its a lot of parts and probably could be simplified in better ways, however as the great man Ave says.. you gotta Pi$$ with the ... you got. Cheers. \$\endgroup\$
    – KINGO320
    Sep 20, 2021 at 11:02
  • \$\begingroup\$ Good. I hope you can see the usefulness of a truth table for clearly defining your requirements. Give it a day or two before accepting the answer to see if anyone has better ideas. You can upvote useful answers at any time. \$\endgroup\$
    – Transistor
    Sep 20, 2021 at 11:07
  • \$\begingroup\$ the top citcuit needs a PNP that can withstand 12V reverse bias \$\endgroup\$ Sep 21, 2021 at 9:46
  • \$\begingroup\$ Thanks, @Jasen. That's a good point. As I have shown it in Figure 1 there is nothing pulling Q1 or Q3's emitters to ground so they should be OK I think. Can you see a potential problem? \$\endgroup\$
    – Transistor
    Sep 21, 2021 at 12:18
  • \$\begingroup\$ huh? what about R3: rly1 = day: +12 sw1 d1 q1 (backwards) q3 R3+D5 ground \$\endgroup\$ Sep 21, 2021 at 12:21

this is the sort of thin that cauld be solves using 12V capable logic and a few resistors.

Old-school CMOS logic is good to 15V or more so use CD4001 or HEF4001 - you'll need one chip for every two illuminatred switches.


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ Much simpler than my solution (which I haven't fixed yet). \$\endgroup\$
    – Transistor
    Sep 21, 2021 at 21:42
  • \$\begingroup\$ Add resistors for the green LEDs. The other colors can be driven straight from the 4001 but it's a little rude - relying on the output impedance. \$\endgroup\$
    – td127
    Sep 21, 2021 at 21:49
  • \$\begingroup\$ as I understand the questuion the LEDs have inbuilt resistors, but yeah otherwise they are needed. \$\endgroup\$ Sep 21, 2021 at 22:01
  • \$\begingroup\$ @jasen, thanks. I tried your solution. I edited my post to reflect. \$\endgroup\$
    – KINGO320
    Sep 22, 2021 at 16:50
  • \$\begingroup\$ @jasen, i searched all night and was unable to come up with a solution. I tried using an inverter, clearly thats not the right solution. tried npn/pnp/mosfet and couldnt make the circuit work. any ideas? thanks \$\endgroup\$
    – KINGO320
    Sep 23, 2021 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.