1-Channel and 4-Channel Solid State Relay Applications Using Light Bulbs

Overview:

Solid state relays are switches whose output turns on or off any type of load its connected to. Solid state relays have great advantages over regular relays, such as providing faster switching, having greater reliability and a longer lifespan.

This tutorial will use both a 1-Channel and a 4-Channel Solid State Relay to control a series of loads, with light bulbs being used as an example. The 1-Channel module will simply turn the load on and off at a consistent rate while the 4-Channel module will create a sequence akin to a light show.

 

Hardware Used:

Arduino UNO

1-Channel Solid State Relay

4-Channel Solid State Relay

Jumper Wires

Receptacle - 4

Extension Cord (w/ exposed copper wires) – 4

Light bulbs - 4

Screwdriver

 

Software Used:

Arduino IDE

 

Application Discussion

Solid state relays operate like switches that turn on or off loads depending on the signal applied. These relays also provide electrical isolation between input and output circuits as do normal relays. These relays have a number of advantages over traditional relays that were mentioned earlier but they also have some drawbacks such as a greater output resistance and lower resilience towards spikes and overloads. Despite these risks, solid state relays are being used more often as they provide a more cost-effective solution for many electronic circuit designs, especially when the service of the equipment is considered.

This tutorial aims to teach you how solid state relays can control a series of loads, using light bulbs as an output. These applications range from simply switching them off at a predetermined time to a slightly more elaborate sequence of actions with multiple bulbs.

 

Solid State Relay (1-channel module, 5V low level)

Product description:

1-channel Solid State Relay module with control voltage of 5V. The function of a solid state relay is to act as an electronic switching device that switches on or off a load circuit. This Solid state relay works with Arduino.

Specifications:

  • 5V Omron solid state relay 240V 2A, output with resistive fuse 240V 2A
  • Size: 24*32*21mm/0.94*1.25*0.82”
  • Input Power: 5V DC (160mA)
  • Input control signal voltage: (0-2.5V state low relay OFF) (3-5V state high relay ON)
  • Modular Interface: Input section: DC +: positive power supply (by relay voltage power supply) DC-: connect power negative CH: relay module signal to trigger the end (high level trigger effective)
  • Voltage version: 5V
  • Static current: 0mA
  • Working current: 12.5mA
  • Trigger voltage: 3.3-5V
  • Trigger current: 2mA

 

4-Channel Solid State Relay 5V Low Level

Product Description:

 

The 4 channel solid state relay module is equipped with resistive fuse 240V 2A, 5V low level trigger, widely used in PLC control, home intelligent control,industry electronic DIY etc.


Specification:
Color: black & blue
Type: 4 channel relay module (5V)
Input power supply: 5V DC (160MA)
Input control signal voltage:
(0-2.5V low state relay OFF)
(3.3-5V state high relay ON)
Load: 240V 2A
Module interface:
DC +: positive power supply (by relay voltage power supply)
DC-: connect power negative
CH: Relay Module signal triggering end (Low level trigger effective)
5V solid state relays 240V 2A, output with resistive fuse 240V 2A.

Application:
PLC control, home intelligent control,industry, electronic DIY etc.


Note: Power must be DC voltage and need to be consistent with the voltage relay.

 

Hardware Setup

1-Channel Relay Module

Actual Setup

Fritzing Diagram

Schematic Diagram

Pin Configuration

Arduino UNO pins

PIN 8   => CH1 (BLUE)

GND 2 => D- (RED)

VCC    => D+ (GREEN)

 

1-Channel SSR pins (interchangeable)

Wire leading to receptacle => left end                                                                     Wire leading to outlet         => right end

 

4-Channel Relay Module

Actual Setup

Fritzing Diagram

 

Schematic Diagram

 

Pin Configuration

Arduino UNO pins

PIN 2       => CH1 (BLUE)

PIN 3       => CH2 (WHITE)

PIN 4       => CH3 (YELLOW)

PIN 5       => CH4 (PURPLE)

GND PIN => D- (BLACK)

VCC        => D+ (RED)

 

4-Channel SSR pins (interchangeable)

Wires leading to outlet         => left ends                                                                    Wires leading to receptacle => right ends

 

Software Setup:

The Arduino Codes for the application can be downloaded here or you can copy the codes down below.

1-Channel Relay Module

int relayPin = 8;

void setup() {
  Serial.begin(9600);
  Serial.println("Robojax Solid State Relay ");
  pinMode(relayPin, OUTPUT);

}

void loop() {
  digitalWrite(relayPin, LOW);
  Serial.println("Relay ON ");
  delay(1000);
  digitalWrite(relayPin, HIGH);
  Serial.println("Relay OFF ");
  delay(1000);
}

4-Channel Relay Module

int ssr[]={2,3,4,5}; 
int triggerType = HIGH;
int wait = 2000;

int ssrON, ssrOFF;

void setup() {
    Serial.begin(9600);
    if(triggerType)
    {
      ssrON = HIGH;
      ssrOFF = LOW;
    }else{
      ssrON = LOW;
      ssrOFF = HIGH;
    }
 for(int i=0; i < 4; i++)
 {    
    pinMode(ssr[i], OUTPUT);
    digitalWrite(ssr[i], ssrOFF);
 }
    Serial.println("Robojax 4 SSR ");
}

void loop() {
 for(int i=0; i < 4; i++)
 {
      contrlSSR(i+1, ssrON, 2000);
 }


 for(int i=0; i < 4; i++)
 {
      contrlSSR(i+1, ssrOFF, 1000);
 }
   
   contrlSSR(1, ssrON, 2000);
   contrlSSR(2, ssrON, 3000);
   contrlSSR(4, ssrON, 2000);
 
   contrlSSR(1, ssrOFF, 0);
   contrlSSR(4, ssrOFF, 0);
   contrlSSR(2, ssrOFF, 0);
    
   delay(2000);
    Serial.println("====== loop done ==");

}

void contrlSSR(int number, int control, int wait)
{
  if(control == HIGH)
  {
     Serial.print("SSR "); Serial.print(number);Serial.println(" ON");
      digitalWrite(ssr[number-1], ssrON);
      delay(wait);
  }else{
     Serial.print("SSR "); Serial.print(number);Serial.println(" OFF");
      digitalWrite(ssr[number-1], ssrOFF);
      delay(wait);     
  }
}
 

Code Breakdown:

1-Channel Solid State Relay Module

int relayPin = 8;
  • Sets pin 8 for the relay output.
Serial.begin(9600);
Serial.println("Robojax Solid State Relay ");
pinMode(relayPin, OUTPUT);

  • Initialize serial communication at 9600 bits per second.
digitalWrite(relayPin, LOW);
Serial.println("Relay ON ");
delay(1000);
  • Sets relay pin to LOW.
  • Turns the relay switch ON.
digitalWrite(relayPin, HIGH);
Serial.println("Relay OFF ");
delay(1000);
  • Sets relay pin to HIGH.
  • Turns the relay switch OFF.

 

4-Channel Solid State Relay Module


int ssr[]={2,3,4,5}; 
int triggerType = HIGH;
int wait = 2000;

int ssrON, ssrOFF;
  • Arduino pin numbers used for SSR.
  • Type LOW if low trigger and HIGH if high trigger SSR is used.
  • Delay time.
  • Use for two different SSR trigger types.

for(int i=0; i < 4; i++)
 {
      contrlSSR(i+1, ssrON, 2000);
 }
 for(int i=0; i < 4; i++)
 {
      contrlSSR(i+1, ssrOFF, 1000); 


  • Turn SSRs one by one ON.
  • Turn SSRs one by one OFF.

  

contrlSSR(1, ssrON, 2000); 
contrlSSR(2, ssrON, 3000);
contrlSSR(4, ssrON, 2000);
 
contrlSSR(1, ssrOFF, 0);
contrlSSR(4, ssrOFF, 0);
contrlSSR(2, ssrOFF, 0);
  • Turn SSR1 ON for 2 seconds.
  • Turn SSR2 ON for 3 seconds.
  • Turn SSR4 ON for 2 seconds.
  • Turn ssr1 OFF.
  • Turn ssr4 OFF.
  • Turn ssr2 OFF.
void contrlSSR(int number, int control, int wait)
{
  if(control == HIGH)
  {
     Serial.print("SSR "); Serial.print(number);Serial.println(" ON");
      digitalWrite(ssr[number-1], ssrON); 
      delay(wait);
  }else{
     Serial.print("SSR "); Serial.print(number);Serial.println(" OFF");
      digitalWrite(ssr[number-1], ssrOFF);    
      delay(wait);     
  }
}
  • Turn the SSR ON.
  • Turn the SSR OFF.

 

Video Output

 

 

Conclusion

Solid state relays are good alternatives to switches and are effective at delivering the proper signals to its loads, whether they may be light bulbs or not.

References

https://robojax.com/learn/arduino/?vid=robojax-solid-state-relay

https://robojax.com/learn/arduino/?vid=robojax_4ch_ssr

1-channel solid state relay4-channel solid state relayArduinoArduino unoLight bulbReceptacleRelayRelay moduleSolid state relaySsr

Leave a comment

All comments are moderated before being published