The Songle SRD-05VDC-SL-C is a 5V relay module that allows a low-power signal to control high-power devices, acting as an electrically operated switch. It uses an electromagnet to mechanically operate a switch, which can be used to turn on/off larger loads that a typical microcontroller cannot handle directly. Common applications include home automation, industrial controls, and automotive electronics where controlling lights, motors, and other high-power devices is required.
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Connects to 5V power supply |
2 | GND | Connects to ground |
3 | IN | Control signal input (active HIGH) |
4 | NO | Normally Open contact; connects to load when relay is activated |
5 | COM | Common contact; connects to power supply for load |
6 | NC | Normally Closed contact; connected to load when relay is not activated |
Power Connections:
Control Signal:
Load Connections:
// 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 (NO contact is closed)
digitalWrite(relayPin, HIGH);
delay(1000); // Wait for 1 second
// Turn off the relay (NO contact is open)
digitalWrite(relayPin, LOW);
delay(1000); // Wait for 1 second
}
Q: Can I control this relay with a 3.3V signal? A: The relay is designed for a 5V signal, but it may operate at 3.3V. However, reliable operation is not guaranteed at lower voltages.
Q: How many relays can I control with an Arduino? A: It depends on the number of available digital output pins on your Arduino. Each relay requires one digital pin.
Q: Is it necessary to use a flyback diode? A: While the relay module may have built-in protection, it is good practice to use an external flyback diode, especially when switching inductive loads.
Q: Can I use PWM to control the relay? A: No, the relay requires a steady HIGH or LOW signal to switch states. PWM is not suitable for driving relays.
For further assistance, consult the manufacturer's datasheet and application notes.