# How to emulate a SPDT Relay

Discussion in 'General Electronics Chat' started by ShopRat59, Jan 6, 2016.

1. ### ShopRat59 Thread Starter Member

Nov 27, 2013
39
1
I'm looking for ideas on how to emulate a SPDT relay, i.e. when current is applied the circuit travels along path A and when current is removed the circuit travels down path b. This is for low voltage (12Vdc or less), low current (500ma or less) circuits.

One obvious (to me) solution is to use an NPN and PNP transistor, with the control current going to both bases, when on the NPN path is active, when off the PNP path is active.

What are other possible solutions and why are they better (realize this is a very subjective term) than the two transistor solution?

2. ### AnalogKid Distinguished Member

Aug 1, 2013
4,676
1,294
The complimentary transistor circuit will work fine, but the two loads are switched differently. The NPN pulls its load down to GND, while the PNP pulls its load up to the rail. If the two loads have a common connection to either the rail or GND, then both transistors have to be the same polarity. Depending on the loads, one option is to use two NPN's. The first one switches its load to GND *and* drives the second transistor's base. Generally deemed a better way to go because the two power devices are identical. In volume production this lowers costs.

ak

ShopRat59 likes this.
3. ### ShopRat59 Thread Starter Member

Nov 27, 2013
39
1
AK,
Thanks for the response, but I'm not sure I completely follow the set up with two NPNs, could you provide a sample circuit diagram?

4. ### Picbuster Member

Dec 2, 2013
391
53
Relay contact are usually galvanic separated from the 'coil' to emulate a relay you should take care of that part.
The answer could be a solid state relay or two fets of one gate is inverted ( if 1 is on 2 is off)
To achieve the inversion add one fet and a resistor.
Look at the education tab at 'all about circuits' read the appropriate parts and find out how to do use the fets.

5. ### ShopRat59 Thread Starter Member

Nov 27, 2013
39
1
Thanks, when I wrote this post I knew SPDT Emulation was a poor choice of words (as I am not interested in circuit isolation), but I could not think of another way to express my question. I am familiar with FETs and there usage, to me I could use them in the same manner as the BJT example I cited, but being turned on/off by voltage instead of current.

Jul 18, 2013
10,816
2,493
Have you checked out TTL logic, a D type flip-flop etc?
Max.

7. ### ShopRat59 Thread Starter Member

Nov 27, 2013
39
1
Yes, this was the second thought I had (after BJTs) but it is my understanding that a flip flop approach requires a "trigger" pulse to flip between paths, while I want to flip based on the presence or absence of current (or voltage).

Jul 18, 2013
10,816
2,493
9. ### MikeML AAC Fanatic!

Oct 2, 2009
5,450
1,066
@ShopRat59

Do you want to put the switch(s) in the positive lead to the loads (other end of loads grounded), or put the switches in the negative lead of the loads?

What voltage/current are you expecting to switch?

What voltage/current do you want the control signal to be?

Do you want the control signal to be referenced to the positive or negative end of the load?

10. ### ShopRat59 Thread Starter Member

Nov 27, 2013
39
1
Mike,
As a newb I struggle with which side to put switches on, I don't understand how to determine when each method is appropriate, and typically put them on the positive lead as this is most logical to me.

The voltage and current for both the load and the control signal is 5-12 Vdc and less than 500ma.

Same answer concerning control signal reference, I typically design for positive.

Thanks,

11. ### MikeML AAC Fanatic!

Oct 2, 2009
5,450
1,066
Ok, let's try it:

The scenario: You have two grounded 2A loads (lamps?) in a 14V car. Goal is to have one on while the other is off, and to be able to reverse which one is on under the control of an external signal, which is the typical 5V CMOS or TTL signal.

Since the loads are grounded by design, you have no choice but to do high-side switching, which requires PNP or PMOS type power switches, whose emitter/source is tied to the positive rail, and whose turn-on is controlled by their negative base-to-emitter or gate-to-source voltage.

On the other hand, the control signal is typically referenced to the ground side of the circuit, so some sort of inversion/level shifting is necessary to tie the two circuits together. That is the role of Q1.

Look at the simulation above, which shows the load currents through the two loads as a function of the control signal sweeping from 0V toward 5V. Note that there is a funky region between 1.82 and 2.17V where both loads are partially on, so this is a sort of make-before-break type of transfer switch. Note that I tailored the resistors to sort-of center the switching point about half-way between 0V and 5V.

In the real world, the control signal would come from a 555 timer or an Arduino port pin, so it would transistion through the funky region very fast, so it wouldn't matter.

Look at this simulation where the control signal V(sig) is a function of time:

It gets through the funky region in <1us, so it appears that the two load currents are perfectly complementary.

Last edited: Jan 7, 2016
12. ### ShopRat59 Thread Starter Member

Nov 27, 2013
39
1
Mike,
Thanks for the great detail, I understand your explanation except I do not understand why the mosfets couldn't be between the load and the ground (I understand in a car since the ground is the car chassis, there is often no ground wire to connect to) - wouldn't that open the circuit as well?

Also would you mind posting the .asc file so I can play with the simulation?

Thanks,

Last edited: Jan 7, 2016
13. ### MikeML AAC Fanatic!

Oct 2, 2009
5,450
1,066
Yes, but the lamp fixtures in a car (tail lights, for example) are intrinsically grounded. Any switching has to be in the high side. Besides, you specifically asked for it in post #10!

File size:
1.7 KB
Views:
1
14. ### ShopRat59 Thread Starter Member

Nov 27, 2013
39
1
Sorry, for wasting your time, I recognize the car issue and was editing my post when you responded, thanks for the file.

15. ### MikeML AAC Fanatic!

Oct 2, 2009
5,450
1,066
Here it is with low-side switching:

File size:
1.5 KB
Views:
0