Interfacing Solid State Relay with Arduino

Solid State Relay (SSR)

A Solid State Relay (SSR) is an electronic switching device that controls high voltage loads with no moving parts. It offers silent operation, fast switching, and long life, making it ideal for automation, industrial control, and smart home applications.

Working Principle of Solid State Relay

The SSR works using semiconductor devices like triacs, thyristors, and optocouplers. When a small input voltage is applied (from Arduino), the internal circuit activates a switch that controls a high-power load connected to the output.

Types of Solid State Relays

AC Solid State Relay

  • Receives input signal from Arduino.
  • Uses optocoupler to isolate control and load circuits.
  • Switches AC power ON or OFF based on input.

DC Solid State Relay

  • Triggered by a low DC voltage input.
  • Controls output to connected DC devices.
  • No mechanical parts; purely electronic operation.

Requirements

1. Arduino Board

2. Solid State Relay Module (AC or DC)

3. Load (e.g., bulb or fan)

4. Jumper wires and power source

Pin Configuration of Solid State Relay

SSR Module

  • DC+: Connect to Arduino digital output pin.
  • DC-: Connect to Arduino GND.
  • AC Load +: Connect to the AC live wire from power source.
  • AC Load -: Connect to one terminal of the AC load (e.g., light bulb).

Wiring the Solid State Relay to Arduino

To wire an SSR to Arduino, connect the control pins (DC+ and DC-) to a digital pin and ground. Then connect your AC or DC load to the output side. Be cautious while handling high-voltage wiring, and ensure proper insulation and safety.

Algorithm

  1. Initialize Components

    • Connect the DC+ pin of the SSR to a digital pin on Arduino.
    • Connect the DC- pin to Arduino GND.
    • Connect the AC side of the SSR to the load and power supply as per specifications.
  2. Write the Code

    • Define the SSR control pin as OUTPUT in setup().
    • Use digitalWrite() in the loop() to turn the SSR ON or OFF.
    • Add conditions or sensor triggers to control load automatically.
  3. Control the Load

    • Switch appliances ON or OFF based on code logic.
    • Integrate sensors or timers for smart control.
  4. Test the System

    • Upload the code to Arduino.
    • Verify that the SSR responds correctly to control signals.
    • Ensure safe operation when switching actual loads.
1// Define the Arduino pin connected to the SSR control input
2int ssrPin = 3;  // SSR input connected to digital pin 3
3
4void setup() {
5  //  Initialize the SSR pin as an OUTPUT
6  pinMode(ssrPin, OUTPUT);
7
8  Serial.begin(9600); // Start Serial Monitor (for debugging)
9  Serial.println("Solid State Relay Test Started");
10
11  //  Initialize SSR to OFF
12  digitalWrite(ssrPin, LOW); // LOW usually turns SSR OFF (depends on your SSR module)
13}
14
15void loop() {
16  // Turn the SSR ON (AC appliance will turn ON)
17  digitalWrite(ssrPin, HIGH);
18  Serial.println("SSR ON - AC Load ON");
19  delay(3000);  // Keep it ON for 3 seconds
20
21  // Turn the SSR OFF (AC appliance will turn OFF)
22  digitalWrite(ssrPin, LOW);
23  Serial.println("SSR OFF - AC Load OFF");
24  delay(3000);  // Keep it OFF for 3 seconds
25}
26

Applications of Solid State Relays

  • Smart home lighting control
  • Heater and fan switching
  • Industrial automation systems
  • Refrigeration units
  • Silent HVAC control
  • IoT energy management systems

Conclusion

Interfacing a Solid State Relay with Arduino is a reliable and efficient way to control high-voltage devices without noise or mechanical failure. With simple wiring and fast response, SSRs are perfect for modern automation and energy-saving systems.