

A relay is an electromechanical switch that uses an electromagnet 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 | Connect to the 5V power supply. |
| GND | Connect to the ground of the power supply. |
| IN | Control signal input. A HIGH signal activates the relay, and a LOW signal deactivates it. |
| COM | Common terminal of the relay switch. |
| NO | Normally Open terminal. Connect the load here if you want it to be OFF by default. |
| NC | Normally Closed terminal. Connect the load here if you want it to be ON by default. |
Below is an example of how to control a relay 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 Clicking but No Output:
Microcontroller Resetting When Relay Activates:
Q: Can I use a 3.3V microcontroller with a 5V relay module?
A: Yes, if the relay module supports 3.3V trigger signals. Otherwise, use a level shifter or transistor circuit.
Q: Can I control an AC load with a DC relay?
A: Yes, as long as the relay's maximum switching voltage and current ratings are not exceeded.
Q: Why is my relay module heating up?
A: This could be due to exceeding the relay's current rating. Ensure the load is within the specified limits.
Q: Can I use multiple relays with one microcontroller?
A: Yes, but ensure the microcontroller can supply enough current to drive all the relays or use a separate power supply.
This documentation provides a comprehensive guide to understanding and using relays effectively in various applications.