Tuesday, January 14, 2014

Solid State Relays

I find solid state relays (SSR) very convenient, especially for controlling AC power lines.  They typically include opto-isolation and zero crossing detection (explained later.)  Also, they can be controlled with as little as 3V.  This means that you can connect them directly to a GPIO pin. However, I still prefer to put a transistor in between to prevent drawing too much current from the GPIO.

All these features do come at a price.  The typical SSR that I use costs about $10.  PC board mounted SSRs that handle small current can be as little as $1 each.  The 40amp SSRs that I used to control the heater for my hot tub cost about $25.  (I will describe that project in a later post.)

There is an important point you need to know about when using SSRs - the AC and DC versions are not interchangeable.  When switching AC current, the relay should only turn on or off when the voltage is at zero during the AC cycle.  This is what "zero crossing detection" does and it prevents a large surge from entering the device you are controlling.  I have used a DC SSR to control a lamp and blown the bulb due to the lack of zero crossing detection.  Also, if you use an AC SSR to control a DC load, it will turn on just fine, but it will never turn off since the SSR never detects the load voltage crossing zero.  This has confused many a hobbyist and now you won't be one of them.

15 comments:

  1. What kind of SSR would you recommend for controlling a lamp with?

    ReplyDelete
    Replies
    1. Any SSR that is AC and can handle the load will do. A 60W light bulb at 120V draws 0.5A, so you can use a 1A relay for most lamps.

      Delete
  2. Could you please document your hot tub heater project ? Thanks !

    ReplyDelete
    Replies
    1. That turned out to be a difficult and dangerous effort. I really don't want to encourage the readers of this blog (many of whom are beginners) to attempt this type of project. You can read about the most interesting part here:
      http://raspberrypihobbyist.blogspot.com/2014/01/fail-safe-circuit-using-discrete-logic.html
      All that is needed to control the hot tub are appropriate relays for the pumps and the heater and a user interface.

      Delete
  3. Did you buy exatly this type (jgx1505fb) of relay? Thanks!

    ReplyDelete
    Replies
    1. Yes, but I didn't buy it. It was taken from salvaged equipment many years ago.
      Choosing an SSR is very easy. Just get one that meets the following requirements:
      - AC or DC (very important as described in the article above)
      - rated load (how may amps at what voltage can it handle)
      - driving voltage (usually a large range. 3 to 25V is common)
      The only complication I have run into is needing a heat sink when handling very high current. This was required for my hot tub project that used 40Amps and 220V.

      Delete
    2. Thanks,

      I thought the same...but now i have two Fotek SSR (http://ecx.images-amazon.com/images/I/411URtdqYBL._SX425_.jpg and http://i01.i.aliimg.com/img/pb/694/007/508/508007694_312.jpg) and I can't control them with raspberry's 3.3v :(

      I guess it's the same problem like with these guys:
      (http://tech.iprock.com/?p=10030)
      "While the rated trigger voltage on the label is 3 – 32 volts DC, we found that one of the relays we purchased required something closer to four volts to trigger. We then found other reports where other purchasers of those types of relays have encountered similar issues. Some people could buy several and find they all worked, others were not so fortunate and would have issues like we did."

      There are tons of same stories with other SSR-s too on the forums, so I just want to be sure the next one that I order will work with 3.3v...

      Delete
  4. Hi Ted,

    I m software person , don`t know much about hardware but I feel I can use this DC SSR for switching on/off house appliances. But from your description above I need to conform that when u said "the relay should only turn on or off when the voltage..." . Does it mean I need to buy 2 pieces of DC SSR if I want to control both on & off (one for on , one for switching off) ?

    ReplyDelete
    Replies
    1. You only need one, but it needs to be one made for switching AC. The ones made for AC will detect when the voltage cycle crosses zero and wait to switch on or off until then. This prevents a large surge from flowing to the device.
      Using an SSR made for switching DC would work but it risks causing damage to the device from those surges. For example, if you are switching incandescent lights with a DC SSR you will have more frequent burnt out bulbs.

      Delete
  5. Hi Ted B Hale, I am in the middle of a project using a fotek 40a SSR (SSR-40 DA). I am not asking you for electrician-type advice, and I will have an electrician inspect what I am making before I throw the switch. That said, will an SSR like this respond to "U.S." 240v power? What I mean is, my supply is main 220v via a NEMA 6-20R socket. This 220V AC configuration has 2 hot and 1 ground line. The power supply should cross zero 60 times per second. The SSR high side is rated 24-380VAC. The control/low side is rated 3-32V DC. I am hoping that the "zero-crossing" you discussed does not require a neutral line for comparison. Have you tried this with US 220V AC, and do these SSRs generally work with this power format?

    ReplyDelete
    Replies
    1. Yes they work with 220V AC and can sense zero crossing without the neutral line. This is the same (or very similar to) the relay I originally used for my hot tub heater element. I strongly suggest that you attach a large heat sink if you are using it at anywhere near its rated amperage. Mine eventually melted. I had a heat sink but I did not have enough air flow to carry away the heat. I now use a normal relay, but a relay that large reuqired me to change to a 24V control line.

      Delete
  6. can a raspberry pi control 3 or more solid state relay ?? pls reply asap . thanks

    ReplyDelete
    Replies
    1. Yes. It only takes one GPIO to control a relay and the raspberry pi has a lot more than three.

      Delete
  7. Very informative post.Thanks for telling us the important point about the AC and DC versions which are not interchangeable when using SSRs. All the information you have shared about Solid State Relays is useful.
    solid state relay heatsink

    ReplyDelete
  8. I would be careful when saying you should use zero crossing type SSR only. There is a perfectly great reason to avoid this in some cases. If the load has transformer only then for example a light bulb, current will lag the voltage by 90 degrees. In this case you guarantee high current draw for the load each time it comes on. This can cause premature failure of the load itself and of the SSR depending on gap between the specifications. Another place to avoid... let us say you are building a pulse width modulation circuit to become a dimmer. This requires the SSR to fire when the signal is received (at various times during the cycle) but be precise about it. If you use only zero crossing fire, this circuit is dead out of the box.

    ReplyDelete