A 1-Channel Relay is an electromechanical device that acts as an electrically operated switch. It allows a low power signal to control a higher power circuit, which is essential for interfacing microcontrollers with high-power devices. This 1-Channel Relay can handle up to 10A at 5V, making it suitable for a wide range of applications, including home automation, industrial controls, and hobbyist projects.
Pin Number | Description | Notes |
---|---|---|
1 | Normally Open (NO) | Contact opens when relay is off |
2 | Common (COM) | Connects to NO or NC |
3 | Normally Closed (NC) | Contact closes when relay is off |
4 | Coil Positive (VCC) | Connect to 5V supply |
5 | Coil Negative (GND) | Connect to ground |
6 | Signal (IN) | Control signal from microcontroller |
// Define the relay control pin
const int relayPin = 2;
void setup() {
// Set the relay pin as an output
pinMode(relayPin, OUTPUT);
}
void loop() {
// Turn on the relay (activate the NO contact)
digitalWrite(relayPin, HIGH);
delay(1000); // Wait for 1 second
// Turn off the relay (deactivate the NO contact)
digitalWrite(relayPin, LOW);
delay(1000); // Wait for 1 second
}
Q: Can I control this relay with a 3.3V microcontroller? A: While the relay coil requires 5V, some 3.3V microcontrollers can activate the relay if the input circuitry is compatible. Check the relay module's specifications.
Q: Is it safe to switch AC loads with this relay? A: Yes, but always ensure you are qualified to work with AC voltage and take appropriate safety precautions.
Q: How can I reduce electrical noise when switching the relay? A: Use a snubber circuit across the relay contacts or a flyback diode across the coil to minimize noise.
Remember, safety first when working with electricity, especially with high voltages or currents. Always consult a professional if you are unsure about working with electrical components.