Interfacing 1 Channel Relay with Arduino
1 Channel Relay Module
A 1 Channel Relay Module allows you to control high-voltage devices using the low-voltage outputs from an Arduino. It's commonly used in home automation, industrial control, and DIY electronics where switching AC or high-powered DC loads is required.
Working Principle of 1 Channel Relay
The relay works as an electrically operated switch. When the Arduino sends a signal to the relay's input pin, it activates an internal electromagnet, which closes (or opens) the circuit connected to the relay’s terminals, allowing you to control external devices safely.
Types of Relay Modules
Mechanical Relay
- Receives a low voltage signal from Arduino.
- Energizes the internal coil to pull the switch.
- Connects or disconnects the external high voltage circuit.
Solid-State Relay (SSR)
- Receives a control signal from Arduino.
- Uses internal electronics to switch the load.
- Operates silently with faster switching and longer lifespan.
Requirements
1. Arduino
2. 1 Channel Relay Module
3. 100 ohm resistor
4. Jumper wires
Pin Configuration of 1 Channel Relay
Relay Module Pins
- VCC: Connect to +5V on Arduino.
- GND: Connect to GND on Arduino.
- IN: Signal input from Arduino to control the relay.
- COM: Common terminal for switching.
- NO: Normally Open terminal – device turns ON when relay is active.
- NC: Normally Closed terminal – device stays ON until relay is active.
Wiring the 1 Channel Relay to Arduino
To connect the 1 Channel Relay to Arduino, link the VCC and GND to +5V and GND. Connect the IN pin to a digital output pin on the Arduino. Use COM and NO/NC terminals based on your control needs for the external device.
Algorithm
Initialize Components
- Connect the VCC and GND pins of the relay to +5V and GND on the Arduino.
- Connect the IN pin to a digital pin on the Arduino board.
Write the Code
- Set the relay control pin as OUTPUT in the setup() function.
- Use digitalWrite() to activate or deactivate the relay in the loop() function.
- Implement logic based on sensor readings or button inputs.
Control External Devices
- Connect the external device to COM and NO/NC terminals of the relay.
- Use Arduino logic to control when the relay should switch the load.
Test the Project
- Upload the code to the Arduino.
- Observe how the relay switches the connected device on and off based on the logic.
Arduino Code
1int relayPin = 7; // Relay control pin connected to Arduino digital pin 7
2
3void setup() {
4 pinMode(relayPin, OUTPUT); // Set relay pin as OUTPUT
5 Serial.begin(9600); // Start serial communication
6}
7
8void loop() {
9 digitalWrite(relayPin, HIGH); // Turn ON the relay (activates the connected device)
10 Serial.println("Relay is ON");
11 delay(2000); // Keep it ON for 2 seconds
12
13 digitalWrite(relayPin, LOW); // Turn OFF the relay (deactivates the connected device)
14 Serial.println("Relay is OFF");
15 delay(2000); // Keep it OFF for 2 seconds
16}
17
Applications of 1 Channel Relays
- Home automation and smart lighting
- Controlling AC appliances
- Automated irrigation systems
- Garage door automation
- Smart HVAC and fans
- Industrial safety control systems
Conclusion
Interfacing a 1 Channel Relay with Arduino gives you control over high-power devices with ease. From home automation to industrial setups, it's a fundamental module that bridges low-voltage control and high-voltage action in your projects.