A 2 Channel 12V Relay Module is an electronic device that allows a low-power signal, often from a microcontroller like an Arduino, to control two separate high-power circuits. It acts as an electrically operated switch and is commonly used in automation projects, home appliances, and automotive electronics where controlling high voltage or high current devices is necessary.
Pin Number | Description | Type |
---|---|---|
1 | VCC | Power |
2 | GND | Power |
3 | IN1 | Control |
4 | IN2 | Control |
5 | COM1 (Common 1) | Switch |
6 | NO1 (Normally Open 1) | Switch |
7 | NC1 (Normally Closed 1) | Switch |
8 | COM2 (Common 2) | Switch |
9 | NO2 (Normally Open 2) | Switch |
10 | NC2 (Normally Closed 2) | Switch |
Powering the Module:
Interfacing with a Microcontroller:
Connecting the Load:
Q: Can I use this relay module with a 5V microcontroller? A: Yes, the trigger voltage is compatible with 5V logic levels.
Q: What is the difference between NO and NC? A: NO stands for Normally Open, meaning the relay's switch is open when not powered, and NC stands for Normally Closed, meaning the switch is closed when not powered.
Q: How many devices can I control with this relay module? A: You can control two separate devices, one per channel.
// Define relay control pins
const int relayPin1 = 7;
const int relayPin2 = 8;
void setup() {
// Set relay pins as output
pinMode(relayPin1, OUTPUT);
pinMode(relayPin2, OUTPUT);
}
void loop() {
// Turn on relay 1
digitalWrite(relayPin1, HIGH);
delay(1000); // Wait for 1 second
// Turn off relay 1
digitalWrite(relayPin1, LOW);
delay(1000); // Wait for 1 second
// Turn on relay 2
digitalWrite(relayPin2, HIGH);
delay(1000); // Wait for 1 second
// Turn off relay 2
digitalWrite(relayPin2, LOW);
delay(1000); // Wait for 1 second
}
Note: In the above code, HIGH
is used to activate the relay, and LOW
is used to deactivate it. This may vary depending on the relay module's design, so consult the module's datasheet for accurate information.