

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 high-power devices, making it an essential component in automation, home appliances, and industrial systems. Relays are commonly used for isolating control circuits from high-power loads, enabling safe and efficient operation.








Below is the pin configuration for a standard 5V SPDT relay:
| Pin Name | Description |
|---|---|
| Coil+ | Positive terminal of the electromagnetic coil (connect to control voltage) |
| Coil- | Negative terminal of the electromagnetic coil (connect to ground) |
| COM | Common terminal for the load circuit |
| NO | Normally Open terminal (disconnected from COM when the relay is inactive) |
| NC | Normally Closed terminal (connected to COM when the relay is inactive) |
Connect the Coil Terminals:
Connect the Load Circuit:
Power the Relay:
Below is an example of how to control a relay using an Arduino UNO:
// Define the relay control pin
const int relayPin = 7; // Connect this pin to the relay's Coil+ terminal
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); // 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: Connect the relay's Coil- terminal to the Arduino's GND. Use a transistor or relay module if the Arduino cannot directly drive the relay.
Relay Not Activating:
Load Not Switching:
Relay Buzzing or Chattering:
Damage to Microcontroller:
Q: Can I use a relay to control AC devices?
A: Yes, relays are commonly used to control AC devices. Ensure the relay's voltage and current ratings are suitable for the AC load.
Q: Do I need a separate power supply for the relay?
A: It depends on your circuit. If the control circuit cannot provide sufficient current, use a separate power supply for the relay.
Q: What is the difference between NO and NC?
A: NO (Normally Open) means the circuit is open when the relay is inactive, while NC (Normally Closed) means the circuit is closed when the relay is inactive.
Q: Can I use a relay with a Raspberry Pi?
A: Yes, but since the Raspberry Pi's GPIO pins cannot supply enough current, you will need a relay module or a transistor driver.
By following this documentation, you can effectively integrate a relay into your electronic projects for safe and reliable control of high-power devices.