A 12V relay is an electromechanical switch that allows a low-power electrical signal to control a much higher power circuit. It is a critical component in various applications, including automotive electronics, home automation, and industrial control systems. Relays are used to switch on/off lights, motors, and other high-power devices, providing isolation between the control circuit and the power circuit.
Pin Number | Description | Notes |
---|---|---|
1 | Coil End 1 | Connect to 12V power supply |
2 | Coil End 2 | Connect to ground through control |
3 | Common (COM) | Connect to the common line |
4 | Normally Open (NO) | Closed when relay is energized |
5 | Normally Closed (NC) | Open when relay is energized |
Powering the Coil:
Switching a Load:
// Define 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 will close)
digitalWrite(relayPin, HIGH);
delay(1000); // Wait for 1 second
// Turn off the relay (NO contact will open)
digitalWrite(relayPin, LOW);
delay(1000); // Wait for 1 second
}
Q: Can I use the relay with AC loads? A: Yes, the relay can switch AC loads up to its rated voltage and current.
Q: How do I know if the relay is working? A: You should hear a clicking sound when the relay actuates. You can also use a multimeter to test continuity across the NO or NC contacts when the relay is energized or de-energized.
Q: Is it safe to switch high-power loads with a relay? A: Yes, as long as the load does not exceed the relay's rated capacity and proper precautions are taken for isolation and protection.
Remember to always follow safety guidelines when working with high voltage and current to prevent accidents and equipment damage.