Home Automation Using Arduino and IR
A DIY Guide
Hello Tinkerers! hope you enjoy playing around with Arduino and also messing up sometimes : )
This story refers to any easy way controlling your home appliances through Arduino using IR remote , And for the best part you won’t be needing and aftermarket remote for this, I will teach you how to to this with any existing IR remote you have at your home ! Lets jump through it
STEP 1
You will need the following
- Arduino development Board ( Anyone you prefer; I’ve used Arduino Uno )
- Relay Module 2 Channel (No. of channels Depend upon how many appliances you want to control )
- IR Receiver TSOP38238 ( You can use any IR receiver Just check the Datasheet of one which you are using the pin may differ)
- Optional Resistance between 33 Ohm and 1K Ohm for operational safety.
- Jumper Wires as required
Now for connections, connect as follows
OUT pin of IR Receiver — — — — -~D9 *
Vcc of IR Receiver — — — — — — 3.3 V Pin
GND of IR Receiver — — — — — -GND On Arduino
In1 of Relay — — — — — — — — D3
In 2 of Relay — — — — — — — — D4
Vcc of Relay — — — — — — — — -5 V on Arduino
GND of Relay — — — — — — — — GND on Arduino
Note-*the output pin of the IR Reciever should be connected of PWM Digital Pin,
You can use your own preferences for pins as per your choice as far as primary need is fulfilled
Step 2
The Most important part is coding your Development Board, Now there are two parts, you can download both the codes including “IRremote” library from https://github.com/Mukulmw/IR_Homeautomation
Decoding
- Decoding your own remote that You are going to use, this part senses the DEC code that each button on your remote transmits and display that in your serial monitor .
- Basically you will be using total of any four buttons of your choice i.e for each relay you will need two ,one to turn ON and second to turn OFF. It depends on how may relays do you want to operate.
- By uploading the following on your Arduino point the remote towards your IR receiver the press the buttons on your remote that you want to assign.
- Keep Note of the IR codes for further use
Important- You need to add “IRremote” Library to your IDE firstThe Code
The code
Once you noted IR codes from your remote using above programme, nextstep is to upload the following programme on you Arduino, Remember to change the DEC IR code from the below programme with the once you noted down.
Step 4
Now its time to connect your relay to the load, Just follow the circuit diagram aside. Test your DIY Home automation, and HUHYYAH! you are done! That wasn’t that hard, Keep visiting for more new exciting stuffs!
Originally published at https://www.bloombisect.com on December 22, 2020.