5142+ reviews
Order by 16:00 for same day shipping
14 days return
GB
EN
Individual
Business
17/04/2025
Relays are electronic switches. They use electromagnetism to switch a heavy circuit with a small signal. Ideal for projects with Arduino, Raspberry Pi or ESP32. They isolate the control side from the load side. This way you protect your microcontroller and you can switch higher voltages or currents than the chip can handle. You can best see it as an on/off switch that you operate with a microcontroller instead of by hand.
There are two types of relays: mechanical and solid state (SSR).
Mechanical relays have a coil and an iron core. When you apply current to the coil, a magnetic field is created. This attracts an armature that closes or opens mechanical contacts. You can choose from three types of contacts: NO (normally open), NC (normally closed), or COM (combi).
Mechanical relays are cheap and can handle a lot of current, but they make a clicking noise and wear out after millions of switching operations.
Solid state relays switch with semiconductors such as triacs or MOSFETs. They have no moving parts. This makes them quiet, fast and virtually wear-free. They are more expensive and can allow a small leakage current to flow.
A coil forms the heart of the mechanical relay . Current through the coil generates a magnetic field. This attracts the armature. NO contacts close, NC contacts open. If you remove the voltage, the armature falls back.
Note: if the current stops, the magnetic field collapses. This gives a high voltage peak, also known as back-emf. Protect your microcontroller with a flyback diode or snubber circuit. These safely divert the peak.
A Solid State Relay has an input, an optocoupler and a switching component such as a triac or MOSFET. The input drives an LED, which activates the optocoupler. This in turn drives the switch.
Solid State Relays operate on a wide range of voltages, from 3–32 V DC to 90–280 V AC. They switch quickly and without contact. Ideal for intensive use. But be careful: some also allow a small amount of current to pass in the off position.
An Arduino provides 5V and some milliamps per pin. Therefore use a ready-made relay module. This usually has a built-in transistor and flyback diode.
Connect VCC and GND to the Arduino. Connect the signal pin to a digital I/O. Send HIGH or LOW to switch. With simple C++ code you can make a lamp or motor work.
The GPIOs on a Pi provide 3.3V and can handle peaks of up to 16mA. Use a relay module with a 3.3V trigger or put a transistor in between.
Connect as follows: GPIO → transistor → coil → power. Use Python with RPi.GPIO to control the relay. Don't forget the flyback diode.
The ESP32 operates at 3.3V and can supply up to 40mA per pin. Choose relay modules with low inrush current or build a driver with a transistor and resistor.
Thanks to Wi-Fi and Bluetooth, the ESP32 is perfect for remote control. Think of lights or notifications via MQTT.
First, look at the voltage and current of your load. Choose a relay that can handle 1.5× as much. This will absorb inrush currents.
Determine which contact type you need. NO for standard off, NC for failsafe in case of power failure.
Pay attention to the control current. Mechanical relays often require 5 or 12 V and tens of mA. Solid state relays switch at just a few mA via an LED.
Ensure good insulation and safe distances between high and low voltage parts. Also consider switching speed: mechanical around 10 ms, SSR often less than 1 ms. Lifespan: mechanical a few million switching operations, SSR much longer.
Finally, pay attention to dimensions, mounting and cooling.
Use a 5V relay module with Arduino or ESP32 to switch a 230V lamp. Leave the neutral wire alone for extra safety.
For inductive loads, choose a relay that is suitable for AC. For example, a mechanical relay of 10 A. Or an SSR with triac. Then take into account leakage current that can cause heat.
For large systems like HVAC, use relays rated for 230V and at least 16A. Add surge protection such as MOVs or an RC snubber.
Ensure good insulation and grounding, especially at mains voltage. Use flyback diodes or snubbers to absorb peaks. Place warnings on your housing.
Use switches for manual control in case of emergency. And consider EMI filters to prevent interference.
Relays are essential if you want to switch heavy loads with low voltage. Do you choose a mechanical relay? Then you benefit from a low price and high current capacity. Do you go for an SSR? Then you get speed and a long life.
Your choice depends on voltage, current, behavior and safety. With these guidelines you can build reliable circuits with Arduino, Pi or ESP32.