

A 5V relay is an electromechanical switch that uses an electromagnetic coil to open or close contacts. It allows a low voltage signal (5V) to control high voltage or high current circuits, making it an essential component in automation, home appliances, and industrial control systems.








Below is the pin configuration for a typical 5V SPDT relay module:
| Pin Name | Description |
|---|---|
| VCC | Connect to 5V DC power supply to energize the relay coil. |
| GND | Connect to ground (0V) of the power supply. |
| IN | Control signal input. A HIGH signal (3.75V to 5V) activates the relay. |
| COM | Common terminal for the relay switch. |
| NO | Normally Open terminal. Connect the load here if you want it powered when the relay is activated. |
| NC | Normally Closed terminal. Connect the load here if you want it powered when the relay is deactivated. |
Note: Some relay modules may include an onboard LED to indicate the relay's state.
Below is an example of how to control a 5V relay using an Arduino UNO:
// Example: Controlling a 5V relay with Arduino UNO
// Connect the relay module's IN pin to Arduino pin 7
// VCC and GND of the relay module should be connected to 5V and GND of Arduino
#define RELAY_PIN 7 // Define the pin connected to the relay module
void setup() {
pinMode(RELAY_PIN, OUTPUT); // Set the relay pin as an output
digitalWrite(RELAY_PIN, LOW); // Ensure the relay is off at startup
}
void loop() {
digitalWrite(RELAY_PIN, HIGH); // Activate the relay
delay(5000); // Keep the relay on for 5 seconds
digitalWrite(RELAY_PIN, LOW); // Deactivate the relay
delay(5000); // Keep the relay off for 5 seconds
}
Note: Ensure the relay module is compatible with the Arduino's 5V logic level.
Relay Not Activating:
Load Not Switching:
Relay Clicking Rapidly:
Overheating:
Q: Can I use a 5V relay with a 3.3V microcontroller?
Q: Do I need a flyback diode with a relay module?
Q: Can I control an AC appliance with a 5V relay?
Q: Why is the relay module's LED not lighting up?
By following this documentation, you can effectively integrate a 5V relay into your projects and troubleshoot common issues.