

A relay is an electromechanical switch that uses an electromagnetic coil to open or close a circuit, allowing control of high-power devices with low-power signals. Relays are widely used in applications where electrical isolation, high-current switching, or remote control of circuits is required. They are essential in automation systems, home appliances, automotive electronics, and industrial equipment.








Below is the pin configuration for a typical 5V SPDT relay module:
| Pin Name | Description |
|---|---|
| VCC | Connects to the positive supply voltage (e.g., 5V DC). |
| GND | Connects to the ground of the power supply. |
| IN | Control signal input (e.g., from a microcontroller like Arduino). |
| COM | Common terminal for the relay switch. |
| NO | Normally Open terminal. Connects to COM when the relay is activated. |
| NC | Normally Closed terminal. Connects to COM when the relay is not activated. |
// This example demonstrates how to control a relay module with an Arduino UNO.
// The relay is connected to pin 7 of the Arduino.
#define RELAY_PIN 7 // Define the pin connected to the relay module
void setup() {
pinMode(RELAY_PIN, OUTPUT); // Set the relay pin as an output
digitalWrite(RELAY_PIN, LOW); // Ensure the relay is off at startup
}
void loop() {
digitalWrite(RELAY_PIN, HIGH); // Turn the relay on
delay(1000); // Keep the relay on for 1 second
digitalWrite(RELAY_PIN, LOW); // Turn the relay off
delay(1000); // Keep the relay off for 1 second
}
RELAY_PIN with the appropriate pin number if using a different setup.Relay Not Activating:
Relay Clicking but Load Not Working:
Voltage Spikes or Noise:
Relay Overheating:
Can I use a relay with an AC load? Yes, relays are designed to handle both AC and DC loads. Ensure the relay's ratings match the AC voltage and current requirements.
What is the difference between NO and NC terminals?
Can I control multiple relays with one microcontroller? Yes, you can control multiple relays by connecting each relay's IN pin to a separate digital output pin on the microcontroller.
Why is electrical isolation important in relays? Electrical isolation protects the control circuit (e.g., microcontroller) from high voltages or currents in the load circuit, ensuring safety and preventing damage.
By following this documentation, you can effectively use a relay in your electronic projects while ensuring safety and reliability.