

A 5V relay is an electromechanical switch that uses a low voltage (5V) control signal to open or close a circuit, enabling the control of higher voltage devices. It consists of a coil, an armature, and contacts. When the coil is energized with a 5V signal, it creates a magnetic field that moves the armature, switching the contacts between their normally open (NO) and normally closed (NC) states.








The 5V relay typically has 5 pins. Below is the pin configuration:
| Pin Name | Description |
|---|---|
| Coil+ | Positive terminal of the relay coil (connect to 5V control signal). |
| Coil- | Negative terminal of the relay coil (connect to ground). |
| Common (COM) | Common terminal for the load circuit. |
| Normally Open (NO) | Open by default; closes when the relay is activated. |
| Normally Closed (NC) | Closed by default; opens when the relay is activated. |
Power the Relay Coil:
Coil+ pin to a 5V DC control signal (e.g., from a microcontroller or external power source).Coil- pin to ground.Connect the Load Circuit:
COM pin.NO or NC pin:NO pin if you want the load to turn on when the relay is activated.NC pin if you want the load to turn off when the relay is activated.Control the Relay:
Coil+ pin to activate the relay and switch the contacts.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() {
pinMode(relayPin, OUTPUT); // Set the relay pin as an output
digitalWrite(relayPin, LOW); // Ensure the relay is off at startup
}
void loop() {
// Turn the relay on
digitalWrite(relayPin, HIGH);
delay(5000); // Keep the relay on for 5 seconds
// Turn the relay off
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 on the relay module to 5V on the Arduino.GND on the relay module to GND on the Arduino.IN on the relay module to pin 7 on the Arduino.Relay Not Activating:
Load Not Switching:
COM, NO, and NC pins.Relay Buzzing Noise:
Arduino Resets When Relay Activates:
Q: Can I use the 5V relay to control AC devices?
A: Yes, the relay can control AC devices up to its rated voltage and current (e.g., 250V AC, 10A). Ensure proper isolation and safety precautions.
Q: Can I directly connect the relay to an Arduino pin?
A: While possible, it is not recommended unless the Arduino pin can supply sufficient current. Use a transistor or relay module for safer operation.
Q: What is the purpose of the flyback diode?
A: The flyback diode protects the control circuit from voltage spikes generated when the relay coil is de-energized.
Q: Can I use the relay with a 3.3V control signal?
A: No, the relay requires a 5V control signal. Use a level shifter or a relay module designed for 3.3V systems.