Introduction: Home Automation Basics
Hello all. This instructable will guide you to grasp the basics of Home Automation. As this is of basic level, we are only going to use only Arduino and few other components.
Story about the Instructable:-
I am still learning about Arduino programming. My earlier made project, Home Health Sensor(Instructable soon...) was a success. I was thinking what to make next, I had no idea... In one month I thought we are about to go into the space age:) Everyone will sooner or later have a Smart Home so why not to make a it starting with Home Automation(Though many have it now. I knew this project will take time. I decided to start with the basics. As I only know C, Visual Studio, Python(Still learning), programming languages, I started by making a device that would turn on a LED bulb when someone enters the room. My friends, Saattvik(Arduino Tech in Instructables), Adrish and Harsh teamed up for the project. We are programming the Arduinos(Slaves) and would soon make a program that runs on win 10 in Raspberry Pi 2. I had multiple ideas for the system. Mostly monitoring of temperature, humidity, light, people entering would turn on/off the devices. This is only half of the Smart Home Project. To complete that, the project requires a off grid, Solar Power System that would make the home self sustainable. Do comment below what can we add further.
So, Let's start with the project by gathering materials...:)
Step 1: Things We Need:
All things should be available locally or you can order them online
1. Arduino UNO(NANO, MEGA, etc. will work)
2. IR sensor module(If you don't have one, gather materials given separately)
3. 5v Relay(A relay board rated at 5v will work)(Make sure operating voltage of relay coil is 5v or it won't work)(Also check that the relay can handle 110V AC or 240V AC at 50/60 Hz as per your home grid)
4. USB cable
5. Plenty of male-female or male-male jumpers
6. LED bulb with any power rating or any device that can work with a relay.(Don't use a High Power Rating device such as Heaters, Air Conditioners with relays or you'll trip your MCB!!!)
7. Laptop/computer with Arduino software(if you haven't upgrade it to 1.8.5 from arduino.cc ;) )
8. Wires for handling high current.
Materials you need for making a IR sensor:-
1. IR LED
3. 2x 330Ω resistors
4. 10kΩ potentiometer
5. BC547 Transistor
Step 2: Make the IR Sensor:
As per the given circuit make the Sensor. You may make it on a breadboard or a PCB.
I have attached Fritzing files here:-
Step 3: LED Testing of IR Sensor:
Wire up the IR sensor as per the given schematics.
After the wiring upload the attached sketch to your Arduino.
Now, power up your Arduino and place your hand on the IR LED and Photo diode and LED connected to pin 13 should turn on. Usually the LED is labelled as L in Arduino boards. If the LED does not light up, then check your connections.
Step 4: Add the Device With the Relay:
After IR sensor testing it is time for adding a device and controlling it.
Wire up everything as per schematics
Pin12________________One pin of the coil
GND________________Other pin of the coil
Relay<-------------------->Device(LED bulb)<-------------------->Mains(Be careful in this step)(You may add a safety switch and fuse as a additional safety measure)
NO(Normally Open)___________Live Neutral_____________________Neutral
After wiring, upload the given code to your Arduino.
Step 5: Testing:
Finally its testing time. Power up your Arduino and turn on the LED Bulb safety switch. When you place your hand in front of the IR Sensor, then the Bulb should light up. If it does not turn on then turn of the safety
switch immediately and check your connections.
Step 6: Final Words:
I recently came across a component called a contactor that can handle high voltages and high current(up to 415V and 16A) devices like water pumps, air conditioners, heaters etc. I will try to implement these in the project.
So, You may have gained some knowledge of controlling a device using a Arduino and IR Sensor. In future I will publish a Instructable on controlling fan speed using a temperature sensor and combine it with this project. And at the end of the series we shall be able to make a SMART HOME..:)
Thanks for spending your time in reading this instructable. I hope you like the instructable. If you did, favorite this instructable and vote for me in the contests. Follow me for more. You can check out my youtube channel for testing videos. You may pen down your comments for questions, suggestions etc. See you soon...
Participated in the
Arduino Contest 2017