

A relay is an electromechanical switch that uses an electromagnetic coil to open or close a circuit. It allows a low-power signal to control a higher power circuit, providing isolation and control in various applications. Relays are widely used in automation, home appliances, automotive systems, and industrial equipment to control high-current devices such as motors, lights, and heaters.








Below are the general technical specifications for a standard 5V single-channel relay module:
The relay module typically has the following pins:
| Pin Name | Description |
|---|---|
| VCC | Power supply for the relay module (5V DC). |
| GND | Ground connection. |
| IN | Control signal input (logic HIGH activates the relay). |
| COM | Common terminal for the relay switch. |
| 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 relay module using an Arduino UNO:
// Define the relay control pin
const int relayPin = 7;
void setup() {
pinMode(relayPin, OUTPUT); // Set the relay pin as an output
digitalWrite(relayPin, LOW); // Ensure the relay is off initially
}
void loop() {
digitalWrite(relayPin, HIGH); // Turn the relay on
delay(1000); // Keep it on for 1 second
digitalWrite(relayPin, LOW); // Turn the relay off
delay(1000); // Keep it off for 1 second
}
Code Explanation:
relayPin is connected to the IN pin of the relay module.Relay Not Activating:
Load Not Switching:
Relay Stuck in One State:
Microcontroller Resetting When Relay Activates:
Q: Can I use a 3.3V microcontroller to control a 5V relay?
A: Yes, most relay modules with optocoupler isolation can be triggered by 3.3V signals.
Q: What is the difference between NO and NC terminals?
A: The NO terminal is open by default and closes when the relay is activated. The NC terminal is closed by default and opens when the relay is activated.
Q: Can I control an AC load with a DC relay?
A: Yes, as long as the relay's maximum voltage and current ratings are not exceeded.
Q: How do I protect my circuit from relay-induced voltage spikes?
A: Use a flyback diode across the relay coil to suppress voltage spikes when the relay is deactivated.