

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 DC 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. |
Coil+ pin to a 5V DC control signal (e.g., from a microcontroller or power supply).Coil- pin to ground.COM pin.NO or NC pin, depending on the desired behavior:NO if the load should be powered only when the relay is activated.NC if the load should be powered by default and disconnected when the relay is activated.Coil+ pin to activate the relay and switch the load circuit.Below is an example of how to control a 5V relay using an Arduino UNO:
Coil+ pin of the relay to a digital pin on the Arduino (e.g., pin 7) through a transistor driver.Coil- pin to the Arduino's GND.COM and NO pins of the relay.// Define the relay pin
const int relayPin = 7;
void setup() {
// Set the relay pin as an output
pinMode(relayPin, OUTPUT);
}
void loop() {
// Turn the relay ON (activate)
digitalWrite(relayPin, HIGH);
delay(5000); // Keep the relay ON for 5 seconds
// Turn the relay OFF (deactivate)
digitalWrite(relayPin, LOW);
delay(5000); // Keep the relay OFF for 5 seconds
}
Relay Not Activating:
Load Not Switching:
COM, NO, and NC pins.Microcontroller Resetting When Relay Activates:
Relay Buzzing or Clicking:
Q1: Can I use a 5V relay to control AC devices?
Yes, a 5V relay can control AC devices as long as the voltage and current ratings of the relay contacts are not exceeded.
Q2: Can I directly connect a 5V relay to an Arduino pin?
While it is possible, it is not recommended unless the Arduino pin can supply sufficient current. Using a transistor driver is a safer approach.
Q3: 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.
Q4: Can I use a 5V relay with a 3.3V microcontroller?
Yes, but you will need a transistor driver circuit to ensure the relay coil receives the required 5V signal.