How to emulate a SPDT Relay

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

  1. ShopRat59

    Thread Starter Active Member

    Nov 27, 2013
    56
    2
    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

    AAC Fanatic!

    Aug 1, 2013
    8,078
    2,285
    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 Active Member

    Nov 27, 2013
    56
    2
    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?

    Thanks in advance,
     
  4. Picbuster

    Well-Known Member

    Dec 2, 2013
    977
    126
    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 Active Member

    Nov 27, 2013
    56
    2
    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.
     
  6. MaxHeadRoom

    Expert

    Jul 18, 2013
    18,822
    5,869
    Have you checked out TTL logic, a D type flip-flop etc?
    Max.
     
  7. ShopRat59

    Thread Starter Active Member

    Nov 27, 2013
    56
    2
    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).
     
  8. MaxHeadRoom

    Expert

    Jul 18, 2013
    18,822
    5,869
  9. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,444
    1,075
    @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 Active Member

    Nov 27, 2013
    56
    2
    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,444
    1,075
    Ok, let's try it:

    337.gif


    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:

    337a.gif

    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 Active Member

    Nov 27, 2013
    56
    2
    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,444
    1,075
    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!

     
    panic mode likes this.
  14. ShopRat59

    Thread Starter Active Member

    Nov 27, 2013
    56
    2
    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,444
    1,075
    Here it is with low-side switching:
    338.gif
     
  16. ci139

    Active Member

    Jul 11, 2016
    605
    87
    about "Emitter−Base Breakdown Voltage" page 2 3-rd row from top 2N2222(PDF)
    (other) the mosfets have reverse protection diode built in so you need to use them as with mosfet SSR-s or buy 1 . . . an interesting article https://electronics.stackexchange.c...iodes-low-cost-ac-solid-state-relay-with-mosf
    . . . i prsonally doubt there is a circuit allowing both fets to conduct simultaneously (it's theoretically possible but hard to achieve) . . . the source of such claim https://www.avdweb.nl/tech-tips/four-quadrants-mosfet-graph ... but i'm still pessimistic about such (? . . . it's about ideal diode not MOSFET SSR ? ← likely the cause of fuzz)
     
  17. panic mode

    AAC Fanatic!

    Oct 10, 2011
    1,759
    532
    use H-bridge and you can have anything you like
     
  18. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    8,078
    2,285
    Actually it is easy to achieve, as indicated in the link you posted. Anything that generates 5-10 V between the dual sources and the dual gates will turn on both MOSFETS. I've done this for a phase type lamp dimmer with a very low voltage drop, and cycle-stealing lamp dimmer under the bed with no heatsink and basically no heat.

    ak
     
  19. ci139

    Active Member

    Jul 11, 2016
    605
    87
    -- i have tried to burn off the acetone *from the nitro lacquer finish floor and some years later the gasoline from my arms ? """successfully""" >.< - good the apartment didn't burn down and the skin grew back :confused: i tried to simulate what you describe with no success (but it was done in a bit hurry , maybe i should retry)

    *note : you have to use a (wet) thick blanket to cut off such fire!
     
    Last edited: Sep 14, 2019
  20. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    8,078
    2,285
    I do not store gasoline under my bed.

    ak
     
Loading...