

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 |
|---|---|
| VCC | Connects to the 5V power supply to energize the relay coil. |
| GND | Ground connection for the relay coil. |
| IN | Control signal input (5V logic HIGH activates the relay). |
| COM | Common terminal for the load circuit. |
| NO | Normally Open terminal; connected to COM when the relay is activated. |
| NC | Normally Closed terminal; connected to COM when the relay is not activated. |
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; // Define the pin connected to the relay IN pin
void setup() {
pinMode(relayPin, OUTPUT); // Set relay pin as an output
digitalWrite(relayPin, LOW); // Ensure relay is off at startup
}
void loop() {
digitalWrite(relayPin, HIGH); // Activate the relay
delay(1000); // Keep the relay on for 1 second
digitalWrite(relayPin, LOW); // Deactivate the relay
delay(1000); // Keep the relay off for 1 second
}
Note: Ensure the relay module is connected to the Arduino's 5V and GND pins, and the IN pin is connected to pin 7.
Relay Not Activating:
Load Not Switching:
Relay Buzzing Noise:
Arduino Resets When Relay Activates:
Q1: Can I use a 5V relay to control a 220V AC appliance?
A1: Yes, as long as the appliance's current and voltage ratings do not exceed the relay's maximum ratings (250V AC, 10A).
Q2: Do I need a separate power supply for the relay?
A2: Not necessarily. If your microcontroller can supply sufficient current, you can use the same power source. However, for high-power applications, a separate power supply is recommended.
Q3: Can I use a 5V relay with a 3.3V microcontroller?
A3: Yes, but you will need a transistor or MOSFET to amplify the 3.3V signal to 5V for the relay.
Q4: What is the difference between NO and NC terminals?
A4: The NO (Normally Open) terminal is disconnected from the COM terminal when the relay is off, while the NC (Normally Closed) terminal is connected to the COM terminal when the relay is off.