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 high-power device, making it an essential component in many electronic and electrical systems. Relays are widely used in applications such as home automation, industrial control systems, automotive electronics, and power distribution systems. They provide electrical isolation between the control circuit and the load, ensuring safety and reliability.
Below are the general technical specifications for a standard single-pole single-throw (SPST) relay. Specifications may vary depending on the specific relay model.
The relay typically has 5 pins for SPDT relays or 3 pins for SPST relays. Below is the pin configuration for a standard SPDT relay:
Pin Number | Name | Description |
---|---|---|
1 | Coil (+) | Positive terminal of the electromagnetic coil. |
2 | Coil (-) | Negative terminal of the electromagnetic coil. |
3 | Common (COM) | Common terminal connected to the moving contact of the relay. |
4 | Normally Open (NO) | Contact that remains open until the relay is activated. |
5 | Normally Closed (NC) | Contact that remains closed until the relay is activated. |
For SPST relays, only the COM, NO, and Coil pins are present.
Connect the Coil:
Connect the Load:
Add a Flyback Diode:
Power the Circuit:
Below is an example of how to control a relay using an Arduino UNO:
// Define the pin connected to the relay
const int relayPin = 7;
void setup() {
// Set the relay pin as an output
pinMode(relayPin, OUTPUT);
// Ensure the relay is off initially
digitalWrite(relayPin, LOW);
}
void loop() {
// Turn the relay on
digitalWrite(relayPin, HIGH);
delay(1000); // Keep the relay on for 1 second
// Turn the relay off
digitalWrite(relayPin, LOW);
delay(1000); // Keep the relay off for 1 second
}
Relay Not Activating:
Load Not Turning On/Off:
Relay Buzzing or Clicking Rapidly:
Burnt Relay Contacts:
Can I use a relay with an AC load? Yes, relays can switch both AC and DC loads. Ensure the relay's contact rating supports the AC voltage and current.
Why is a flyback diode necessary? The flyback diode protects the control circuit from voltage spikes generated when the relay coil is de-energized.
Can I control a relay directly from an Arduino? Yes, but ensure the Arduino pin can supply enough current for the relay coil. If not, use a transistor or relay module.
What is the difference between NO and NC contacts?