A relay is an electrically operated switch that uses an electromagnet to mechanically operate a switch. This allows a low power signal to control a higher power circuit. Relays are commonly used in various applications, including:
Parameter | Value |
---|---|
Coil Voltage | 5V, 12V, 24V |
Coil Current | 70mA (5V), 30mA (12V), 20mA (24V) |
Contact Rating | 10A @ 250VAC, 10A @ 30VDC |
Contact Resistance | < 100mΩ |
Operate Time | 10ms |
Release Time | 5ms |
Insulation Resistance | > 100MΩ @ 500VDC |
Dielectric Strength | 500VAC (coil to contact) |
Mechanical Life | 10^7 operations |
Electrical Life | 10^5 operations |
Pin Number | Name | Description |
---|---|---|
1 | Coil+ | Positive terminal of the relay coil |
2 | Coil- | Negative terminal of the relay coil |
3 | COM | Common terminal of the relay switch |
4 | NC (Normally Closed) | Connected to COM when relay is inactive |
5 | NO (Normally Open) | Connected to COM when relay is active |
/*
* Example code to control a relay with an Arduino UNO.
* The relay is connected to digital pin 7.
*/
const int relayPin = 7; // Pin connected to the relay
void setup() {
pinMode(relayPin, OUTPUT); // Set the relay pin as an output
}
void loop() {
digitalWrite(relayPin, HIGH); // Turn the relay on
delay(1000); // Wait for 1 second
digitalWrite(relayPin, LOW); // Turn the relay off
delay(1000); // Wait for 1 second
}
Relay Not Switching:
Relay Chattering:
Overheating:
Q: Can I use a relay to switch AC loads? A: Yes, relays can switch both AC and DC loads. Ensure the relay's contact rating matches the load requirements.
Q: How do I know if my relay is working? A: You can hear a clicking sound when the relay switches. Additionally, you can measure the continuity between COM and NO/NC terminals to verify the switching.
Q: Can I control multiple relays with a single Arduino? A: Yes, you can control multiple relays with an Arduino by connecting each relay to a different digital pin and using the appropriate code to control each pin.
This documentation provides a comprehensive guide to understanding, using, and troubleshooting relays in various applications. Whether you are a beginner or an experienced user, this guide will help you effectively integrate relays into your projects.