24 V SSR replacement for classic relay

Discussion in 'Embedded Systems and Microcontrollers' started by PZUFIC, Sep 24, 2015.

  1. PZUFIC

    Thread Starter New Member

    Jan 7, 2012
    23
    0
    Hello!

    I made a I/O board which is connected to Raspberry PI 2. For outputs I used small signal relays. Power supply for primary and secondary relay sides is the same. Because the switching frequency is not very low I want to replace some of the relays with custom made SSR. The relays are currently switched on and off with ULN2003A which creates a connection to the ground.

    I want to make simple PCB that can replace classic relay without changing original PCB. Power supply for the control and switch side is the same so as the voltage, which is 24 V. I will use this to power on some LED's (about 0,5 A) and to put 1 or 0 to the PLC input.

    Is there any easy and reliable solution?
     
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,766
    1,101
    Welcome to AAC!
    Post a schematic of your 'original pcb' so that we can see what modifications are needed.
     
    PZUFIC likes this.
  3. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    Pretty much by definition, a relay has complete galvanic isolation between the coil and the contacts. You can choose to reference both to the same ground or power supply rail, but you have to do that externally. Do you need that for your application? If the controlled circuit is running on the same power and ground as the controlling circuit, you might be able to replace the relay with just a power MOSFET. This gets into how to mount the device, so a photo of your current board would help.

    ak
     
    PZUFIC likes this.
  4. strantor

    AAC Fanatic!

    Oct 3, 2010
    4,302
    1,988
    You haven't provided the pin arrangement for your relays but maybe you could use something like this as a direct replacement :

    [​IMG]

    If not, maybe you could solder leads to your relay coil pads and use standard square package SSRs somewhere off the PCB.

    [​IMG]
     
    PZUFIC and #12 like this.
  5. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    For 1/2 A at 24 V, any low to medium power transistor, BJT or MOSFET, might work, depending on the output polarity, probably without a heatsink. Can't say without seeing your I/O board circuit.

    ak
     
    PZUFIC likes this.
  6. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,500
    2,365
    There are an abundance of Opto22 boards, ebay etc, that take 4/8/16/24 opto IDC/ODC modules, these use either 5vdc or 24vdc switching logic and switch a range of control voltages.
    The early generation has a fuse and LED indicator on the board, the later generation has the indicator and fuse on the module itself.
    Max.
     
    PZUFIC likes this.
  7. PZUFIC

    Thread Starter New Member

    Jan 7, 2012
    23
    0
    Ok, first of all I have to thank all of you for your answers and help and then let me explain some things.

    I attached the schematic to this post. It's not very well drown because I mainly use it just for PCB design. In principles work's like that:
    • the RPi is powered from power supply with 5 V an 12 V output with common ground
    • the RPi, set the output
    • 3,3 V form RPi goes to ULN 2003A which connect optocoupler cathode to ground (RPi is not powerful enough to switch on optocoupler LED, optocoupler is powered by 5 V from RPi)
    • optocoupler secondary side (relays) is powered by 24 V power supply, which has no connection with 5 V or 12 V one
    • the same power supply 24 V is then used for powering the devices through the relays on the board
    • and for one channel there is also 12 V from the RPi power supply feeded trough relay contacts
    All voltages are DC.

    If I'm thinking right there should be no problem for 24 V devices, but for one that uses 12 V power from the same supply as RPi would bi difficult without connecting the grounds together which is not desirable? Or maybe with another optocoupler.

    I would like to make a PCB module which I can then solder in instead of relay. So plug and play version.

    The system works ok with relays but I'm not sure if the relays (small signal relays) will work ok for long time, because the switch ratting is prity heigh about 800 per hour, almost 24/7. There is not much current but...
     
  8. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    1. Each relay is DPDT, wired as a parallel redundant SPDT. Are you using both throws for each relay?
    2. How are the loads connected to the relays? In other words, is the relay connecting the high side of the load to +24 V, the low side of the load to GND, or something else?
    3. Back to grounds, if the same 24V that powers the relay coils powers the loads, then Q2 pin 8 (relay driver GND) shares a common ground with the relay loads. True?
    4. If #3 is true, then each relay can be replaced by one or two medium sized power transistors, depending on the answer to #1.

    Or forget all of that and use this: http://www.clare.com/home/pdfs.nsf/www/LBA716.pdf/$file/LBA716.pdf

    Also, if you haven't laid out the board yet or can re-spin it, you can eliminate Q2 and drive the switching transistors directly with VO1 and VO2 optocouplers' transistor outputs. The LBA parts need only 2 mA max, so you might be able to drive them with the controller directly, eliminating both 2003's.

    ak
     
    Last edited: Sep 24, 2015
    PZUFIC likes this.
  9. PZUFIC

    Thread Starter New Member

    Jan 7, 2012
    23
    0
    Hello!

    Sorry that I didn't response, because I have some other major problems to solve first before getting on that SSR again.

    I'm currently using Omron G5V-2 relays. There is not need for NC contact, NO will be just fine. Because the board is already build I need something pin compatible, which means I have to build it. All of the loads are DC.

    The optocouplers are there for isolation, because I want to have the RPI totally separated from 24 V DC. As I found out this is not possible because the 24 V negative pole is grounded and there are many things connected to RPI that are grounded. For example: LCD screen (VGA - pole grounded) and much more. So I grounded the RPI power supply - pole to.

    I would like to have high-side switching if possible without inverting (now the outputs are inverted because Q2 outputs are connected to ground by default).

    Thank you very much all of you, for help.
     
  10. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    1. Q1, VO1, and Q2 all are fixed and there's no getting around them? Not a problem, just want to confirm.
    2. Is this change for existing boards or only new production?
    3. If for new production, is eliminating parts like Q2 and replacing it with jumpers an option?
    4. SMT or PTH parts?
    5. *** What are the values or R1 and R2?

    SPST NO relay function is the easiest to replace with a solid state device. A P-channel power MOSFET turns on when its gate is pulled low, just like the relay coils you have now, and gives you high-side switching. A single transistor per output will work for DC loads. For AC you need two FETs back to back because of the internal body diode.

    OR, use a very small SSR, basically an optocoupler with a 1 A output current rating. Not cheap, but very simple. Got got got to know the values of R1 and R2.

    Schematic to follow.

    ak
     
    Last edited: Sep 30, 2015
    PZUFIC likes this.
  11. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    Attached is a schematic with two different approaches. The upper one is lower cost and has higher switching current capability, but is only for DC loads that share a common ground with the control voltage. The lower one is higher cost, way more simple, and can switch a fully isolated AC or DC load. In both circuits Q2 is bypassed to fix your logic polarity.

    ak
    SSR-01-c.gif
     
    PZUFIC likes this.
  12. PZUFIC

    Thread Starter New Member

    Jan 7, 2012
    23
    0
    After reconsideration we decided to build new board, because there are some problems, like no ground present on relay pads and so on...
    And we also need to connect all power supply grounds to earth (can't be avoided, USB devices with metal casing, ground trough VGA and display), so optocouplers have lost a bit of their function.

    Before I saw AnalogKid schematic I tried many FET driver versions. All of them actually work fine, but there is a problem with 24 V voltage, which is to high for most FET Ugs. So I first create a divider and then realized that if I want to have switching voltages in range 10-24V DC is not gonna work right or I will have to modify elements for one channel which is used for 12V DC. Others are 24V (for now but what if that changes). So I put zener diod in series with R1 instead between gate and source if I reference on AnalogKid shematic. It also works fine but it just reduced Ugs for a fixed value, which is better in compare to a divider but whit the same diode and different voltages there will be different Rdson. So I moved the diode up, like on AnalogKid schematic. But there is another problem. When switching from high to low without load, there is still 24 V on the drain but it's dropping to zero because of DMM input resistance (can make a problem if connected to PLC input). So I added a 30k resistor in series with zener diode. I tested the circuit with different diode and different FET and it works fine. Is there any theoretical problem about it? I don't need high frequency switching.

    I attached a shematic.
     
  13. dannyf

    Well-Known Member

    Sep 13, 2015
    1,767
    357
    R3 isn't needed because of the zener.

    A p-ch tend to have higher Rdson so I would have used a n-ch instead.

    If the load is inductive, you may want to put a diode there.

    If your load is sufficiently small, you could get away with just a logic-level mosfet driven directly by your input signal.
     
    PZUFIC likes this.
  14. PZUFIC

    Thread Starter New Member

    Jan 7, 2012
    23
    0
    I tested the circuit without it and when switching from high to low without load there is still voltage on output and that can cause problems.
    Some of the outputs will go to PLC. PLC input current is very low, so...

    I need switching in high side.

    I will put this into account, but for now there is no inductive load. I can also attach diode directly to the load.

    I want to have some "space" so i will design it for 4 A.
     
  15. dannyf

    Well-Known Member

    Sep 13, 2015
    1,767
    357
    On which side? The coil side or the contact side?
     
    PZUFIC likes this.
  16. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    R3 is needed to assure rapid and complete MOSFET turn-off. It is in every circuit I've done using this technique, but in haste I forgot it on my schematic. oops. If you want to get all techy, R3 and Q1's gate capacitance form a turn-off time constant. If this were a PWM application or something else that needed fast turn off, I'd change R3 to 1K. But for you app, something higher is OK.

    I recommend R1, R2, and R3 all be 10K in your circuit. As long as Vgs is between 10 V and 20 V, it doesn't matter that the R2/R3 voltage divider is tickling the edge of zener conduction, and one resistor value in three places is better than one each of three different values. Also, 100K is awfully large for a BJT base resistor.

    If you want the zener to conduct during the on state to give the gate a lower source impedance for better noise immunity, leave R3 at 10 K and change R1 and R2 to 4.7 K.

    Are you going all discrete, or will you still use the ULN2003 for multi-circuit drive? My resistor value recommendations are the same for both.

    ak
     
    PZUFIC likes this.
  17. PZUFIC

    Thread Starter New Member

    Jan 7, 2012
    23
    0
    Contact side.

    Example:
    You need to connect +24 V DC to PLC input to make it high. You can't do that with a ground switching. Plus in industrial world usually all the negative poles of DC power supplies are connected to ground(earth), so it's more common to switch positive pole rather then negative.
     
  18. PZUFIC

    Thread Starter New Member

    Jan 7, 2012
    23
    0
    I agree.

    I tried and if I lower the R3 from 30k down, the voltage on zener diode starts to lower and so Ugs. If I'm thinking right that is because of more load the zener stabilization starts to fail.


    Entire new PCB with SMD components and direct drive from RPi to BJT->FET.
     
  19. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,515
    1,246
    You can by inverting your output logic polarity, adding a pull-up resistor from the PLC input to +24V, and switching the bottom of the resistor to GND. That one resistor greatly simplifies things at the relay-equivaleent-output end, but if the PLC has an internal pull-down it forms a voltage divider that might be a problem. Also, if the PLC world runs on things being pulled up rather than down it might not work for unknown future situations. 4 A P-channel parts are plentiful, so it looks like the safe play is to stay with high side switching. Now, about that high-side N-channel gate driver...

    ak
     
    PZUFIC likes this.
  20. PZUFIC

    Thread Starter New Member

    Jan 7, 2012
    23
    0
    What about zener diode and R3 as I wrote few posts up?
     
Loading...