1. Introduction
Controlling home appliances wirelessly is one of the first steps toward home automation. This project demonstrates how to control electrical devices using an IR (Infrared) remote with Arduino.
Using an IR receiver, Arduino can decode signals from a TV remote and control appliances through a relay module.
This project is ideal for:
- Beginners in home automation
- Arduino learners
- DIY smart home enthusiasts
2. Components
- Arduino UNO
- IR Receiver Module (TSOP1738)
- IR Remote (TV/DVD remote)
- Relay Module (5V, 1 or 2 channel)
- Bulb / Fan (for demonstration)
- Breadboard
- Jumper Wires
- Power Supply
3. Circuit and Connections
🔌 Connections:
IR Receiver → Arduino
- VCC → 5V
- GND → GND
- OUT → Pin 2
Relay Module → Arduino
- VCC → 5V
- GND → GND
- IN → Pin 8
Appliance Connection (IMPORTANT ⚠️)
- Live wire → Relay COM
- Relay NO → Appliance
- Neutral → Direct to appliance
4. Detailed Step-by-Step Circuit Working
- The IR remote sends infrared signals when a button is pressed.
- The IR receiver captures these signals.
- Arduino decodes the received signal into a unique code.
- Each button on the remote has a different code.
- Arduino compares the received code with predefined values.
- When a match is found:
- Relay turns ON/OFF
- Appliance is controlled
5. Code
📌 Install Library:
Install IRremote library in Arduino IDE.
#include <IRremote.h>
int receiverPin = 2;
int relayPin = 8;
IRrecv irrecv(receiverPin);
decode_results results;
bool state = false;
void setup() {
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW);
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
// Replace with your remote button code
if (results.value == 0xFFA25D) {
state = !state;
digitalWrite(relayPin, state);
}
irrecv.resume();
}
}
6. Detailed Step-by-Step Code Working
IRrecvinitializes IR receiverdecode_resultsstores received datairrecv.decode()checks signalresults.valuegives button code- When code matches → relay toggles
irrecv.resume()prepares for next signal
7. Tips
- First upload a code to print IR values and note your remote codes
- Avoid direct sunlight on IR receiver
- Use multi-channel relay for multiple appliances
- Always use proper insulation for AC wiring ⚠️
- You can add LCD to display appliance status
8. Uses
- Home automation system
- Remote-controlled lights and fans
- Smart classroom control
- Assistive device for elderly people
9. Conclusion
This project is a simple yet powerful introduction to home automation using Arduino. By combining IR communication with relay control, you can easily operate real-world appliances. The project can be expanded further using WiFi or Bluetooth for advanced smart home systems.