

A 5V relay is an electromechanical switch that uses an electromagnetic coil to open or close its internal contacts. This allows a low voltage signal (5V) to control high voltage or high current circuits safely and efficiently. Relays are widely used in applications where electrical isolation is required between the control circuit and the load circuit.








The 5V relay typically has 5 pins for SPDT relays. Below is the pin configuration:
| Pin Name | Description |
|---|---|
| Coil+ | Positive terminal of the electromagnetic coil (connect to 5V DC). |
| Coil- | Negative terminal of the electromagnetic coil (connect to ground). |
| Common (COM) | Common terminal for the relay's switching contacts. |
| Normally Open (NO) | Contact that remains open when the relay is inactive. Closes when activated. |
| Normally Closed (NC) | Contact that remains closed when the relay is inactive. Opens when activated. |
Power the Relay Coil:
Coil+ pin to a 5V DC power source.Coil- pin to ground.Connect the Load:
NO or NC terminal:NO if the load should be powered only when the relay is activated.NC if the load should be powered when the relay is inactive.COM pin and the other terminal to the appropriate contact (NO or NC).Control the Relay:
NC to NO).Below is an example of how to control a 5V relay using an Arduino UNO:
// Define the pin connected to the relay module
const int relayPin = 7;
void setup() {
// Set the relay pin as an output
pinMode(relayPin, OUTPUT);
// Ensure the relay is off at startup
digitalWrite(relayPin, LOW);
}
void loop() {
// Turn the relay on (activates the NO contact)
digitalWrite(relayPin, HIGH);
delay(5000); // Keep the relay on for 5 seconds
// Turn the relay off (deactivates the NO contact)
digitalWrite(relayPin, LOW);
delay(5000); // Keep the relay off for 5 seconds
}
Note: Ensure the relay module is connected to the Arduino as follows:
VCC to Arduino 5VGND to Arduino GNDIN to the relayPin (pin 7 in this example)Relay Not Activating:
Relay Buzzing or Clicking Repeatedly:
Load Not Switching Properly:
COM, NO, and NC pins.Microcontroller Resetting When Relay Activates:
Q: Can I use a 5V relay with a 3.3V microcontroller?
A: Yes, but you will need a transistor or relay driver circuit to step up the control signal to 5V.
Q: Can the relay handle AC and DC loads?
A: Yes, the relay can handle both AC and DC loads, but ensure the load voltage and current are within the relay's rated specifications.
Q: What is the purpose of the flyback diode?
A: The flyback diode protects the driving circuit from voltage spikes generated when the relay coil is turned off.
Q: Can I control multiple relays with one microcontroller?
A: Yes, as long as each relay has its own driver circuit and the microcontroller has enough GPIO pins to control them.