

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 when the relay is inactive; closes when the relay is energized. |
| Normally Closed (NC) | Closed when the relay is inactive; opens when the relay is energized. |
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 pin. The load will be powered only when the relay is energized.NC pin. The load will be powered when the relay is not energized.Control the Relay:
Below is an example of how to control a 5V relay using an Arduino UNO:
// Example: Controlling a 5V relay with Arduino UNO
// Pin 7 is used to control the relay
const int relayPin = 7;
void setup() {
pinMode(relayPin, OUTPUT); // Set relay pin as output
digitalWrite(relayPin, LOW); // Ensure relay is off at startup
}
void loop() {
digitalWrite(relayPin, HIGH); // Turn relay on
delay(1000); // Keep relay on for 1 second
digitalWrite(relayPin, LOW); // Turn relay off
delay(1000); // Keep relay off for 1 second
}
Note: Connect the relay's Coil+ pin to Arduino pin 7 (via a transistor if needed) and Coil- to ground. Use a flyback diode across the relay coil.
Relay Not Switching:
Load Not Powering On:
COM, NO, and NC pins. Ensure the load is within the relay's rated voltage and current.Microcontroller Resets When Relay Activates:
Relay Stuck in One State:
Q1: Can I use a 5V relay to control AC devices?
Yes, as long as the device's voltage and current are within the relay's rated specifications (e.g., 250V AC, 10A).
Q2: Do I need a separate power supply for the relay?
Not necessarily. If your microcontroller or power source can provide sufficient current (70-100 mA), you can use the same supply. Otherwise, use an external power source.
Q3: Can I control multiple relays with one microcontroller?
Yes, but ensure the microcontroller can handle the combined current requirements. Use transistors or a relay driver module for better control.
Q4: What is the purpose of the flyback diode?
The flyback diode protects the control circuit from voltage spikes generated when the relay coil is de-energized. It is essential for circuit safety and longevity.