A 12V Single Channel Relay is an electronic switch that allows you to control a high power circuit with a low power signal. The relay module typically consists of a coil, a relay (electromechanical switch), input and output terminals, and a driving circuit. It is commonly used in applications where it is necessary to control a large power load with a small digital signal, such as home automation, industrial controls, and automotive electronics.
Pin | Description |
---|---|
VCC | Connect to 12V power supply |
GND | Connect to ground |
IN | Control signal input (active LOW) |
NO | Normally open contact |
COM | Common contact |
NC | Normally closed contact |
Power Connections:
Control Signal:
Load Connections:
// Define the relay control pin
const int relayPin = 7;
void setup() {
// Set the relay pin as an output
pinMode(relayPin, OUTPUT);
// Start with the relay off
digitalWrite(relayPin, HIGH);
}
void loop() {
// Turn on the relay
digitalWrite(relayPin, LOW);
delay(1000); // Wait for 1 second
// Turn off the relay
digitalWrite(relayPin, HIGH);
delay(1000); // Wait for 1 second
}
Q: Can I use this relay with a 5V control signal? A: Yes, but ensure that the VCC is still connected to a 12V supply, and the control signal is compatible with the relay's input requirements.
Q: Is it necessary to use a flyback diode with this relay? A: Yes, it is recommended to use a flyback diode across the relay coil to protect the control circuitry from voltage spikes.
Q: Can I control this relay with a PWM signal? A: It is not recommended to use PWM to control a relay, as the relay may not function properly with rapidly changing signals. Use a steady HIGH or LOW signal instead.