In this tutorial you will learn how to control AC devices such as lights, fans or motors with a Solid State Relay Module and an Arduino UNO. In comparison to mechanical relays, Solid State Relays (SSRs) are silent and can switch much faster and more often.
However, note that this specific kind of relay can only be used to switch AC devices, e.g. lights that run on ~110V or ~220V alternating current (AC). You cannot use it to control devices that run on DC (direct current) power.
I will use a COB LED light as an example of an AC device that can be controlled by a Solid State Relay Module. You can easily pick your own device. Just make sure that the power consumption is less than 400 Watts, since that is about the maximum load the Solid State Relay we are using here can switch.
Required Parts
Below you will find the parts required for this project. Obviously you will need a Solid State Relay Module. But watch out, there are low-level and high-level triggered Modules. Low-level means the relay switches on when the input signal is low. That is the type we are using in this tutorial. If you buy a Solid State Relay Module read the description carefully to make sure you get the right one.
Apart from the Solid State Relay you will need a microcontroller. I picked an Arduino UNO but you can use any other Arduino as well. If you want to use an ESP32 that is possible, but you need a board that provides a 5V power supply output.
As for the AC device, I wanted to switch a COB LED light. They run on ~110V or ~220V. I listed the ~110V model below. You must select one that matches the AC mains voltage in your country.
Note that COB LED lights are very bright and get very hot. If you want to turn them on for more than a second you must use a heatsink preferably with a cooling fan! I listed a heatsink below.

Solid State Relay 5V

LED COB Chip 50W 110V

Heatsink Cooling Fan for 100W LED

Arduino Uno

Dupont Wire Set

Breadboard

USB Cable for Arduino UNO
Makerguides is a participant in affiliate advertising programs designed to provide a means for sites to earn advertising fees by linking to Amazon, AliExpress, Elecrow, and other sites. As an Affiliate we may earn from qualifying purchases.
Mechanical versu Solid State Relays
Let’s quickly talk about the differences between the common Mechanical Relays and the Solid State Relay we are using in this tutorial.
Mechanical Relay
A mechanical relay is the traditional type that uses an electromagnet to physically move a set of contacts. When current flows through its coil, a magnetic field is created, which pulls a small armature and closes or opens the switch contacts. Because the switching is done mechanically, you can often hear a distinct “click” each time the relay changes state.

Mechanical relays are quite versatile, can handle both AC and DC loads, and are typically more affordable than their solid-state counterparts. They are also very robust when it comes to switching high voltages and currents, making them a popular choice in industrial control systems, automotive electronics, and home appliances.
However, the moving parts introduce limitations. The contacts wear out over time due to arcing when switching inductive loads, which shortens their lifetime. The mechanical movement also makes them slower, with switching times usually in the range of 5 to 15 milliseconds. Additionally, they generate electrical noise when switching, which can sometimes interfere with sensitive circuits.
If you want to learn more about Mechanical Relays, have a look at our How To Use A Relay With Arduino and the Interfacing a Relay Module With ESP32 – A Complete Guide tutorials.
Solid State Relay
A Solid State Relay (SSR), on the other hand, has no moving parts. Instead of physical contacts, it uses semiconductor components such as optocouplers, TRIACs, thyristors, or MOSFETs to perform the switching.

This design makes them much faster than mechanical relays, with switching times often in microseconds rather than milliseconds. Since there are no physical contacts, they are silent in operation and have a much longer lifespan, as there is no mechanical wear or arcing involved.
They are also more resistant to vibration and shock, which makes them well-suited for environments where reliability and durability are critical. Another advantage is their lower control power requirements: many SSRs can be triggered directly from the logic-level outputs of a microcontroller such as an Arduino without the need for an external transistor driver.
Despite these advantages, solid state relays come with their own trade-offs. Because they use semiconductor devices, they typically introduce a small voltage drop across the output, which leads to heat generation. This means that SSRs often require heat sinks when driving high current loads.
They can also leak a tiny amount of current even when turned off, which can be problematic in applications that require a true open circuit. Additionally, while mechanical relays can switch both AC and DC easily, most SSRs are optimized for either AC or DC loads, not both. They are also generally more expensive than mechanical relays.
Summary
In practice, the choice between mechanical and solid state relays depends heavily on the application. If you need to switch large currents occasionally, want a cost-effective solution, and don’t mind the clicking sound, a mechanical relay is usually the right choice.
If you need fast, silent, and reliable switching, particularly in environments where the relay will be cycled very frequently or where longevity is important, then a solid state relay is the better option.
Solid State Relay Module
You can control a Solid State Relay directly but for ease of use with a microcontroller and for safety reasons you usually want a few extra parts and use a Solid State Relay Module, instead of the “raw” Solid State Relay. The picture below shows the Solid State Relay Module we are using in this tutorial:

The big, black square block in the middle is the actual Solid State Relay (SSR). It is a G3MB-202P with an input voltage of 5V DC that can switch AC loads of up to 240VAC with 2 Amperes:

Note that there are several variants of the G3MB with different input and load voltages as shown in the following table:

For more details see the Datasheet for the G3MB Solid State Relay.
Module Circuit
As mentioned, a Solid State Relay Module contains additional parts around the actual relay. The diagram below shows the typical circuit of a Solid State Relay Module based on the G3MB-202P:

Let’s have a closer look at the circuit: The 1N4007 diode (D1) protects the input circuit and the G3MB-202P SSR from a wrong polarity input connection.
The S8050 driver transistor (T1) turns on the SSR when a logic-high (H) level signal is inputted to the SIG pin of the input header. There is another version (and that is the one we are using here), with an active-low (L) switch input that uses the S8550 transistor, instead. If you look closely at the bottom of the module you can read “Low Level Trigger”:

The module needs a power supply of 5V DC through the 5V pin of the input header and the typical operating current is about 10mA.
The input control signal (SIG) voltage should be between 0-2.5V for the low level (relay OFF) and between 3-5V high level (relay ON). That is for the low-level active version we are using here. The circuit also contains a red LED (LED1), which lights up when the relay is in ON state.
The switch contacts (SW-1 & SW-2) are used to switch 240V AC loads up to 2A and the fuse (F1) serves as output protection. That means you can switch AC devices up to 240V×2A=480W but to be on the safe side, you should limit yourself to 400 Watts.
Components of Solid State Relay Module
If you look on the Solid State Relay Module from the top you can identify the most important parts of the circuit:

A final word regarding the module layout. You will find that the high voltage side is very close to the low voltage connector pins and traces. It would have been better to change the orientation of the G3MB-202P on the PCB to bring the high and low voltage side further apart.
Connecting Solid State Relay Module to Arduino
In this section we are going to connect the Solid State Relay Module to an Arduino UNO. Start by connecting 5V from the Arduino to the DC+ input of the SSR Module and GND to the DC- input. The signal input CH1 of the Module can be connected to any digital output pin of the Arduino. I picked GPIO 13 but any other digital GPIO will work as well.

On the high voltage side you need to connect your AC voltage source to the AC load, e.g. a lamp through the switching side of the Module. Be very careful when handling high voltages!
For test purposes, I connected a 220V, 50 Watt, COB LED light as load as shown below:

Since I did not use a heat sink, I had to make sure to switch on the COB LED only for very short periods! The code example in the following section therefore activates the COB LED only for 100 milliseconds. As mentioned, if you want to switch on the COB LED longer you must use a heatsink – preferably with a fan!
Code to Control AC devices with Solid State Relay
The following code shows you how to control an AC device with the Solid State Relay. It is essentially the simple Blink program. It switches the output (lamp) on for 100 milliseconds and then off for 1 second:
const byte relayPin = 13;
void setup() {
pinMode(relayPin, OUTPUT);
}
void loop() {
// Relay ON
digitalWrite(relayPin, LOW);
delay(100);
// Relay OFF
digitalWrite(relayPin, HIGH);
delay(1000);
}
Note that the logic is inverted (LOW means ON) and (HIGH means OFF), since we are using a low-trigger SSR Module. If you have a high-level triggered SSR just invert the logic.
With this code and a COB LED you essentially get a very bright flash light that could be used as part of an alarm system to scare off intruders. The stroboscopic effect is very disturbing and blinding.
Conclusions and Comments
In this tutorial you learned how to control a COB LED with a G3MB-202P Solid State Relay and an Arduino. Since the G3MB-202P reads an input level between 3V and 5V as high, you could use an ESP32 to control it. However, the G3MB-202P also requires 5V for power and you therefore will need an ESP32 with a 5V power supply pin.
Solid State Relays are great if you need fast, silent, and frequent switching. But they are more expensive than Mechanical Relays and typically switch either AC or DC loads but not both.
If you want to switch large currents occasionally, Mechanical Relays are often a better choice. To learn more about Mechanical Relays have a look at our How To Use A Relay With Arduino and the Interfacing a Relay Module With ESP32 tutorials.
If you have any questions feel free to leave them in the comment section.
Happy Tinkering ; )
Stefan is a professional software developer and researcher. He has worked in robotics, bioinformatics, image/audio processing and education at Siemens, IBM and Google. He specializes in AI and machine learning and has a keen interest in DIY projects involving Arduino and 3D printing.


Bob Kentridge
Monday 19th of January 2026
This is the perfect article for me. I want to accurately control the strobe frequency of a number of (probably 4, maybe up to 8) COB LEDs (Majatou High Power Cob Led Chip Light, COB LED Lamp Chip, 100W Cold White High Power Voltage Light Source). I have an equal number of SSR modules which look pretty much identical to the one you used (the SSR itself is labelled G3MB-202P and is rated to switch 2A AC at 250v). I also have a variety of heatsinks and heatsinks with fans for the COB LEDs and an Arduino to run everything. In order to simplify the design I wondered if I could control the COB LEDs in pairs, so I use a single SSR module to control two COB LEDs which I connect in series to the AC power source and thence to the SSR?
For info, I am a Professor of Psychology, and this project is for a couple of scientific experiments. In one I want to produce a set of strobe frequencies which are an approximate match to the dominant frequencies measured from a flickering flaming torch (I can't use the flaming torch in my experiment, so I want to reproduce the illumination it provides electronically - I will use optical neutral density filters to reduce the intensities of some frequencies as required). In the second, unrelated study, I will use an EEG system to measure the dominant frequencies of brain activity elicited when a person sees strobe lighting and then adjust the strobe frequencies online either to match the dominant EEG frequency or to yoke it to an increment of the dominant frequency to determine whether the dominant EEG can be modified. Strobes at particular frequencies are assumed to induce resonances in brain activity in primary visual cortex (and beyond) resulting in patterns of travelling waves in cortex, these are manifest visually as quite intense geometric 'hallucinations'. There are commercial systems designed to do this and marketed as tools to help a user relax, fall asleep, reduce anxiety, meditate and the like (see e.g. https://lumenate.co/product/lumenate-nova). I am more interested in the relationship between lighting frequency, EEG frequency, and the induced visual consequences and specifically, to test the assumption that strobes of particular frequencies generate standing, or travelling, waves of activity in primary visual cortex.
Many thanks,
Bob Kentridge Professor of Psychology Durham University, Durham, UK
Stefan Maetschke
Tuesday 20th of January 2026
Hello, I assume these are AC COB LEDs (same as in the tutorial) and not DC COB LEDs.
In theory, as long as the current does not exceed the rating (2A) multiple COB LEDs can be switched with the same SSR. However, the LEDs need to be connected in parallel to the power source (not in series) and the SSR should switch the live wire.
Also, AC COB LEDs can draw a very high inrush current (10x than nominal) at turn-on. Low-current SSRs often fail shorted when repeatedly exposed to inrush. To be on the save side a 5–10A SSR, would be better when switching two 100W COB LEDs at once.
Finally, depending on the frequency an SSR might not be the right choice here. Most AC SSRs are zero-cross triac types and only switch on at the AC zero crossing. At 50 Hz mains, this means the maximum clean strobe frequency is about 10–20 Hz. I assume that is to low for the experiment you have in mind.