The 5V 8-Channel Relay Module is an electronic device that enables control of multiple high-power circuits using low-power signals from a microcontroller like an Arduino. Each relay serves as an electrically operated switch that can be turned on or off to control devices such as motors, lights, and other appliances that require higher voltages and currents than a microcontroller can provide directly.
Pin Number | Description | Type |
---|---|---|
1 | IN1 | Input |
2 | IN2 | Input |
3 | IN3 | Input |
4 | IN4 | Input |
5 | IN5 | Input |
6 | IN6 | Input |
7 | IN7 | Input |
8 | IN8 | Input |
9 | GND | Ground |
10 | VCC | Power |
11 | JD-VCC | Relay Power |
Note: IN1 to IN8 are the control inputs for each relay. VCC is for the logic part, and JD-VCC is for the relay power. GND should be connected to the microcontroller ground.
Power Connections:
Input Signal:
Load Connections:
// Define relay control pins
const int relayPins[] = {2, 3, 4, 5, 6, 7, 8, 9};
void setup() {
// Initialize all relay control pins as outputs
for (int i = 0; i < 8; i++) {
pinMode(relayPins[i], OUTPUT);
digitalWrite(relayPins[i], HIGH); // Relays are active LOW
}
}
void loop() {
// Example: Turn on each relay for 1 second, then off
for (int i = 0; i < 8; i++) {
digitalWrite(relayPins[i], LOW); // Activate relay
delay(1000); // Wait for 1 second
digitalWrite(relayPins[i], HIGH); // Deactivate relay
delay(1000); // Wait for 1 second
}
}
Q: Can I control the relays with a 3.3V signal? A: Yes, the control signal is TTL compatible and can be triggered with a 3.3V signal.
Q: Do I need to use all eight relays? A: No, you can use as many or as few relays as your application requires.
Q: Can I power the module using the 5V from the Arduino? A: Yes, for low current applications. However, for multiple or high-current relays, an external power supply is recommended.
Q: How do I know if a relay is on or off? A: Each relay has an indicator LED that lights up when the relay is activated (ON).
Q: Is it safe to control mains voltage with this relay module? A: While the relay can switch mains voltage, ensure you have proper knowledge of electrical safety and take necessary precautions. If unsure, consult a professional.