

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 | Connect to the 5V power supply. |
| GND | Connect to the ground of the power supply. |
| 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 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
}
Explanation:
digitalWrite function is used to send HIGH or LOW signals to the relay.Relay Not Activating:
Load Not Switching:
Relay Buzzing or Clicking Rapidly:
Microcontroller Resetting:
Q: Can I use a 3.3V microcontroller to control a 5V relay?
A: Yes, most 5V relay modules can be triggered by a 3.3V control signal. However, check the module's datasheet to confirm compatibility.
Q: What is the difference between NO and NC terminals?
A: The NO (Normally Open) terminal is disconnected from COM when the relay is off and connected when the relay is on. The NC (Normally Closed) terminal is the opposite—it is connected to COM when the relay is off and disconnected when the relay is on.
Q: Can I use a relay to switch DC and AC loads?
A: Yes, relays can switch both DC and AC loads, but ensure the load voltage and current are within the relay's rated specifications.
Q: Do I need an external transistor to drive the relay?
A: If you're using a relay module, it typically includes a transistor for driving the relay. For bare relays, you will need an external transistor or driver circuit.