กลับหน้าหลัก
views
How to Use Arduino Solid State Relay Active LOW 5V 4 Channel
Last updated on

How to Use Arduino Solid State Relay Active LOW 5V 4 Channel


How to Use Arduino Solid State Relay Active LOW 5V 4 Channel

A Solid State Relay (SSR) is a contactless switching device. Unlike traditional electromagnetic relays that use coils and moving contacts, an SSR relies on an internal optocoupler and Triac to switch AC loads. The main advantages are no mechanical wear, silent operation, and faster switching speed. In this tutorial, we will use an Active LOW 5V 2A 4-Channel SSR module to control two 220V light bulbs through the Arduino Serial Monitor.

SSR 4-Channel module diagram showing DC+ DC- CH1 CH2 CH3 CH4 A1 A2 B1 B2 pin locations and labels

Required Components

  • Arduino UNO R3 with USB cable
  • Power Adapter 9V 2A (5.5x2.5mm barrel jack) — essential for stable SSR operation
  • Breadboard MB-102 (830 points)
  • Jumper wires: Male-Male, Male-Female, Female-Female, 20cm each, at least 40 pieces
  • Solid State Relay Active LOW 5V 2A 4 Channel module
  • E27 light bulb socket with LED bulb 7W (×2)
  • AC power cord with plug (220V household wiring)
  • Dual-color LED pilot lamp (red-green) 220V for status indication

Understanding Active LOW Logic

The Active LOW designation means the relay activates when the control pin receives a LOW signal (0V), not HIGH. When the pin is pulled HIGH, the relay stays off. This is the opposite of most standard relay modules. The internal optocoupler uses an infrared LED to trigger the Triac, which then conducts AC power to the load.

Safety Warning: The AC side (220V) is lethal. Use proper wire gauges, wire correctly, and consider consulting a licensed electrician if you are unsure.

Comparison table showing Active LOW vs Active HIGH behavior, pin state and relay output for both types

Wiring Diagram: Arduino UNO to SSR 4 Channel

Part 1: DC Control Side (Arduino → SSR)

Arduino UNO   ->   Solid State Relay
--------------------------------------
    5V        ->   DC+
    GND        ->   DC-
    Pin 2      ->   CH1
    Pin 3      ->   CH2
    Pin 4      ->   CH3
    Pin 5      ->   CH4

Part 2: AC Load Side (SSR → Appliances)

SSR Terminal   ->   Connected To
-----------------------------------
    A1          ->   LOAD 1 (Light bulb 1 live terminal)
    A2          ->   LOAD 2 (Light bulb 2 live terminal)
    B1          ->   AC Neutral (N)
    B2          ->   AC Neutral (N)

Part 3: AC Mains Wiring

220V AC Mains
-----------------------------------
Live (L)  ->  Load 1 live terminal
             Load 2 live terminal
Neutral (N) ->  SSR B1
              ->  SSR B2
Complete circuit diagram showing Arduino connected to SSR module and 220V AC wiring to two light bulbs

Arduino Code: Control SSR via Serial Monitor

This sketch receives single-character commands (0–5) through Serial Monitor to toggle SSR channels. The key point: Active LOW means digitalWrite(LOW) turns the SSR ON.

// ==========================================
// Arduino Solid State Relay Active LOW Control
// ==========================================
// Commands via Serial Monitor (9600 baud):
//   0 = Turn all SSR OFF
//   1 = Turn SSR Channel 1 ON
//   2 = Turn SSR Channel 2 ON
//   3 = Turn SSR Channel 3 ON
//   4 = Turn SSR Channel 4 ON
//   5 = Turn all SSR ON
// ==========================================

const int CH1 = 2;
const int CH2 = 3;
const int CH3 = 4;
const int CH4 = 5;

void setup() {
  Serial.begin(9600);

  // Set all SSR control pins as OUTPUT
  pinMode(CH1, OUTPUT);
  pinMode(CH2, OUTPUT);
  pinMode(CH3, OUTPUT);
  pinMode(CH4, OUTPUT);

  // Active LOW: Start with HIGH (OFF)
  // LOW = ON, HIGH = OFF
  digitalWrite(CH1, HIGH);
  digitalWrite(CH2, HIGH);
  digitalWrite(CH3, HIGH);
  digitalWrite(CH4, HIGH);

  Serial.println("===========================");
  Serial.println("  SSR Active LOW Control");
  Serial.println("===========================");
  Serial.println("Send 0 = Turn all OFF");
  Serial.println("Send 1-4 = Turn SSR channel 1-4 ON");
  Serial.println("Send 5 = Turn all ON");
  Serial.println("===========================");
}

void loop() {
  if (Serial.available() > 0) {
    char command = Serial.read();

    // Turn all OFF first
    digitalWrite(CH1, HIGH);
    digitalWrite(CH2, HIGH);
    digitalWrite(CH3, HIGH);
    digitalWrite(CH4, HIGH);

    switch (command) {
      case '0':
        Serial.println("- All SSR stopped");
        break;

      case '1':
        // Active LOW: LOW activates SSR
        digitalWrite(CH1, LOW);
        Serial.println("- SSR Channel 1 active");
        break;

      case '2':
        digitalWrite(CH2, LOW);
        Serial.println("- SSR Channel 2 active");
        break;

      case '3':
        digitalWrite(CH3, LOW);
        Serial.println("- SSR Channel 3 active");
        break;

      case '4':
        digitalWrite(CH4, LOW);
        Serial.println("- SSR Channel 4 active");
        break;

      case '5':
        // Turn all channels ON
        digitalWrite(CH1, LOW);
        digitalWrite(CH2, LOW);
        digitalWrite(CH3, LOW);
        digitalWrite(CH4, LOW);
        Serial.println("- All SSR active");
        break;

      default:
        Serial.println("Invalid command. Send 0-5");
        break;
    }
  }
}

Step-by-Step Upload and Test Procedure

  1. Open Arduino IDE and paste the code above
  2. Select Board → Tools → Board → Arduino UNO
  3. Select Port → Tools → Port → (your COM port)
  4. Upload — click the Upload button or press Ctrl+U
  5. Open Serial Monitor — Tools → Serial Monitor or press Ctrl+Shift+M
  6. Set Baud Rate to 9600 in the dropdown at the bottom right
  7. Send commands — type a number 0–5 and press Enter or click Send

Expected Results

CommandActive SSRLED on Module
0All OFFAll LEDs OFF
1Channel 1LED CH1 ON
2Channel 2LED CH2 ON
3Channel 3LED CH3 ON
4Channel 4LED CH4 ON
5All ONAll LEDs ON

Safety Notes for AC Wiring

  • Keep DC and AC wiring clearly separated. Route AC wires away from the breadboard and Arduino.
  • Do not route 220V AC through the breadboard. Use screw terminals or Junction boxes for AC connections. Breadboard tracks are not rated for mains voltage.
  • Verify L and N connections. Incorrect wiring can damage equipment or cause shorts.
  • Use the 9V 2A adapter. USB power may be insufficient, leading to unstable SSR switching.

Video Reference

Summary

Controlling a 4-Channel Active LOW SSR with Arduino requires understanding three sections: (1) DC wiring connecting Arduino’s 5V, GND, and pins 2–5 to the SSR’s DC+, DC-, and CH1–CH4, (2) AC wiring from A1/A2 to the load and B1/B2 to neutral, and (3) uploading the sketch and sending commands via Serial Monitor. The critical concept to remember: Active LOW means LOW signal turns the relay ON, HIGH turns it OFF — the opposite of typical relay logic.

อยากทำโปรเจคแบบนี้?

รับทำโปรเจค Arduino / IoT จบงานไว ส่งงานครบ พร้อมสอน

If you need Arduino project service or urgent IoT development, see full service details on the home page

จ้างทำโปรเจคเลย

ความคิดเห็น

Verified user reviews

รีวิวและความคิดเห็นจากผู้ใช้จริง

ล็อกอินด้วยบัญชีบนเว็บนี้แล้วให้คะแนนหรือคอมเมนต์ได้เลย ระบบเก็บผ่าน Supabase ไม่ต้องใช้ GitHub แล้ว

กำลังโหลดรีวิว...