Hello guys, in this tutorial we will learn how to use solid state relay to control 240V/120v with 5v Arduino. We will also see what is difference between contact relay and solid state relay. So let’s get started.

For this you will need

  1. Arduino,
  2. Solid state relay,
  3. Jumper Wire,
  4. 240V/120V Light bulb,
  5. Bulb holder, wires and plug.

Before starting this tutorial. I want to give you a warning. Doing incorrectly can cause you serious injury or damage your Arduino. If you are not sure don’t do this.

Contact relay which actuate by means of electromagnetic force. When contact happen it makes “click” sound. Mechanical contact takes little large time to move. And also there is a chance to wear out the mechanical part.


Mechanical Relay

Where as in solid state relay works on optocoupler. Which does not require any mechanical moving part. Therefore solid state relay have fast switching speed than contact relay.

Solid state relay

Solid state relay

This solid state relay is triggered by 3 to 32VDC. And output voltage is up to 330VAC.

Do connection as shown in diagram.

How to use solid state relay to control 240V/120v with 5v Arduino.

Upload blink sketch from examples and change delay time to 2000 millisecond for on and off.

int led_light = 13;
void setup() {
pinMode(led_light, OUTPUT);


void loop() {
digitalWrite(led_light, HIGH);
digitalWrite(led_light, LOW);

After uploading the code turn on extension board. You can see it is on for 2 second and off for 2 second. Now I connected CFL bulb it works fine. But when I connect LED bulb at LOW signal it flicker for few millisecond. You can control fan, light any home appliance with this relay.

Till then keep learning keep making.