Connecting SSR relay

schematicssolid-state-relay

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.

Best Answer

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).