# How can I use transistors to work as an SPDT relay using the common pin as input and NC/NO as outputs?

Basically, this is for various lights in a car - indicators, park/rear light, brake light. I want to convert the simple output from non-American cars to lights similar to the American standard - in other words:

• pure red rear lights where the brake light bulb also works as indicator
• side markers that are lit when park light is on, but turns off when the indicator light goes on, making them blink alternately from the indicators
• side markers still blink when the park light is off, but in this case they blink simultaneously with the indicators (but, I wouldn't mind if they would blink alternately)

In other words:

• BRAKE XOR INDICATOR
• PARK XOR INDICATOR

I've implemented this many times using Single Pole Double Throw relays. For normal light bulbs, you only need 4 SPDT relays converting the 12V or floating signal to proper 0V or 12V, one for each of right indicator, left indicator, park light, brake light. You connect ground to the Normally Closed pin of the relay 12V to the Normally Open and use the common pin as the new output.

• For the indicators in front, which uses double bulbs, you connect park to 5W and indicators for the 21W connector and ground to ground. This works even without the relays.
• For the side markers you connect park light to one side and the indicator to the other side of the bulb.
• For the rear blink/brake light, you connect the brake light to one side and the indicator to the order side, You can't a use double (5W/21W) bulb with rear light on the 5W connector because then there will be no light when both the indicator and brake light is on, not even rear light - which is wrong.

Now, this is all fine, but it further complicates things if you want to use LED light, and they obviously won't work with 12V on the wrong side, so I now need:

• 2 relays using brake light as one input and left/right indicator as the other input - the output goes to the red brake/indicator light
• 2 relays using park light as one input and left/right indicator as the other input - the output goes to both front (orange) and rear (red) side markers

It feels a but wrong though, to use relays that sometimes draw more power than the LED lights they drive, so I wish to do is using electronics instead.

# THE_POINT:

What I'm looking for then is:

• (A) a circuit that have two inputs which are 12V when on and are floating when off, and outputs 12V if either of the two inputs are high, and 0V if both are low or both are high. This is exactly the same as a logical XOR gate - and yes, I'm considering to use one of those with a mosfet driver if it gets too complicated.
• (B) a circuit that takes a floating-when-off and 12V-when-on signal and turns it into proper 0V when off and 12V when on, and which can drive a couple of amps.
• (C) if it saves a few components on A, we could use B on all inputs and then deal with 0V instead of floating.

EDIT: Using the diode bridge trick, here's the circuit so far (exactly the same for the brake/indicator light - just replace the park light input with brake light. Obviously, there are two indicators, left and right, so the total number of relays is now 4 - Brake, Park, Left Indicator, Right Indicator What I'm looking at now is a way to replace the relays making the signals 0V/12V, for cost, size and reliability reasons.

• relays that sometimes draw more power than the LED lights they drive This is weird. They shouldn't do that! Those relays are the best option in my opinion. Check if those relays are for 12V. – drzymala Mar 28 '13 at 22:25
• Someone suggested using a diode bridge (rectifier) as a XOR gate, however he deleted his answer. I note that this will only work if you already have 0V/12V as input (AC side of the rectifier), and if you don't connect the minus side of the output to chassis ground, as it would then would work as an OR gate. I like the simplicity of this though! However it does leave me with (B) - I still need 4 SPDT relays for converting each signal from floating/12V to 0V/12V. Is there any simple way to do this without using relays? – Ronny Ager-Wick Apr 2 '13 at 2:47

For me, the simplest method would be to convert the 12V input levels into TTL 5V levels. The floating inputs pulled down to zero using a resistor. Then program the behavior using a small microcontroller. The outputs could be either relais or power MOSFETs. Maybe there is such a device already to buy. If you don't have tools to play with electronics then maybe arduino? Using this method, you could even program the brake light to strobe like in Formula1 Hehe :)

For the output a RFP30N06LE MOSFET would do.

• I wasn't planning on involving a micro controller. That certainly is fun, but not the goal this time. I want to keep it simple and find a good way to convert markers to blinkers that can be replicated by me and others for minimal cost. – Ronny Ager-Wick Apr 3 '13 at 2:46

For circuit A you can still use a bridge circuit: -

There is an opto-coupler that sits within a bridge and when one or the other input contact closes it feeds current through the opto's LED and back to 0V via (say) a 1kohm resistor. This should deliver about 8 or 9mA to the opto's LED.

Of note is that if both inputs are at 12V then there is zero current through the opto.

The transistor part of the opto-coupler will feed the next transistor with base current to properly turn-on and activate the relay output. The relay output can be wired exactly how you want it and if you use a changeover contact then it meets your (A) requirement.

Of course, if the switching power for your "driven" circuit is low then a push-pull arrangement of transistors can be used instead of the relay.

For circuit B, a simplification to circuit A is needed. Only one input is required and the opto LED can be connected from after the switched input back to 0V through the resistor. No need for a bridge circuit BUT if you decide (A) is a good route you might as well use the same "module" for (B).

Please let me know if (C) requirement is not served by (A) or (B)

• That's an interesting solution. I never thought of using an opto-coupler. Did you use it because there is a need to electronically isolate the output from the diode bridge, or is there a way to run an ordinary transistor (or MOSFET) instead of the opto-coupler? – Ronny Ager-Wick Apr 3 '13 at 2:40
• @RonnyAger-Wick For convenience I used an opto. In fact if a high-enough sensitivity relay can be found this would work directly and negate the need for the opto and transistor. The problem is finding one that has high-ish coil resistance so that it (say) develops enough voltage across it when it is in series with one of the resistors that pull-down the input switches. The resistors need to be there of course because the inputs are effectively normally open circuit. There are sensitive relays that can work but maybe not capable of switching the final load contact current. – Andy aka Apr 3 '13 at 7:10