0
\$\begingroup\$

I bought a cheap SSR relay (SSR-40DA) on ebay and like to connect it directly to arduino, Schematic on website (http://www.fotek.com.hk/solid/SSR-1.htm) shows that LEDs already have resistors in the circuit, do I need to add additional 220R resistor to output pin or not?

Thanks.

SSR schematic

P.S. It's not clear from this answer Wiring SSR with Arduino how to correctly connect this relay, sorry if duplicate.

\$\endgroup\$
2
\$\begingroup\$

You don't need the 1N4004 diode shown in the circuit you linked to ("Wiring SSR with Arduino"), since SSR's are not inductive so no flyback diode is needed.

Also you don't need the transistor since according to the datasheet you linked to for the relay, it will operate over a range of 3-32v, with a constant current of 7.5 mA for the LEDs (thanks Dwayne). This is well within the sink capability of any microcontroller output port.

So according to the diagram you provided above, pin 3 is positive (+) and should be connected to +5v. Pin 4 is negative so that will be connected to the output pin of the Arduino. You should set the output pin to 0 to operate the relay, and 1 to release it.

Since the LEDs already have built-in resistors you don't need to include them. Just connect your AC load to the SSR per the diagram to pins 1 and 2.

The output pin should be configured as open-drain, meaning it can sink current to turn the relay on, but will not source current to turn it off (instead it will be left in a high-impedance state). It would be a good idea to put a resistor, perhaps 10K, in between the output pin and +5, so the relay will guaranteed to be off when it is supposed to be (thanks whatsisname).

\$\endgroup\$
  • \$\begingroup\$ As I understand I don't need a transistor, datasheet says that relay needs 12v/7.5ma, for 5V it theoretically is 12/5*7,5 = 18ma that is acceptable current for most MC. Is my assumptions correct? \$\endgroup\$ – HardQuestions Feb 14 '15 at 21:53
  • 1
    \$\begingroup\$ Actually I think it would be 12/7.5 = 1600 ohm equivalent coil resistance; 5 / 1600 = 3.1 mA. So you are right, no transistor is needed. I'll update my answer. \$\endgroup\$ – tcrosley Feb 14 '15 at 22:03
  • \$\begingroup\$ Most packaged Solid State Relays drive the LED with a constant current. In older designs, this was a simple 2-transistor circuit. I see no reason that might have changed with modern designs. If the datasheet says that the SSR need 7.5 mA with 12V input, it most likely needs 7.5 mA for all input voltages. \$\endgroup\$ – Dwayne Reid Feb 15 '15 at 3:43
  • \$\begingroup\$ @DwayneReid Thanks for your comment, I forgot that they were LEDs. Another update ... \$\endgroup\$ – tcrosley Feb 15 '15 at 3:52
  • 1
    \$\begingroup\$ Also don't forget to throw a pull-up on the output pin so the relay isn't toggled on during startup or if the AVR fails for some other reason. \$\endgroup\$ – whatsisname Feb 15 '15 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.