The Yongli 5V Relay 3 C is a 3-channel relay module designed for interfacing high-voltage devices with low-voltage microcontroller systems like Arduino, Raspberry Pi, or PIC. Each channel can control a separate device, making it suitable for a variety of applications such as home automation, industrial controls, and hobbyist projects.
Pin Number | Description | Type |
---|---|---|
1 | IN1 (Input Signal 1) | Digital |
2 | IN2 (Input Signal 2) | Digital |
3 | IN3 (Input Signal 3) | Digital |
4 | GND (Ground) | Power |
5 | VCC (5V Input) | Power |
6-8 | COM (Common) | Power |
9-11 | NO (Normally Open) | Switch |
12-14 | NC (Normally Closed) | Switch |
// Define relay control pins
const int relay1 = 2;
const int relay2 = 3;
const int relay3 = 4;
void setup() {
// Set relay pins as outputs
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(relay3, OUTPUT);
}
void loop() {
// Turn on relay 1
digitalWrite(relay1, HIGH);
delay(1000); // Wait for 1 second
// Turn off relay 1
digitalWrite(relay1, LOW);
delay(1000); // Wait for 1 second
// Repeat for relay 2 and 3
digitalWrite(relay2, HIGH);
delay(1000);
digitalWrite(relay2, LOW);
delay(1000);
digitalWrite(relay3, HIGH);
delay(1000);
digitalWrite(relay3, LOW);
delay(1000);
}
Q: Can I control the relay module with a 3.3V microcontroller?
A: Yes, but ensure that the 3.3V signal is sufficient to trigger the relay. Check the module's datasheet for the minimum input signal voltage.
Q: Is it safe to control AC devices with this relay module?
A: Yes, as long as you do not exceed the maximum voltage and current ratings and ensure proper isolation and safety precautions.
Q: Can I use PWM to control the relay?
A: No, relays require a stable HIGH or LOW signal to switch states. PWM is not suitable for relay control.
Remember to always follow safety guidelines when working with electronics, especially when controlling high-voltage devices.