Introduction: Home Automation Using Arduino With Wifi, Bluetooth and IR Remote Control

Picture of Home Automation Using Arduino With Wifi, Bluetooth and IR Remote Control

This is a tutorial to show how to build a home automation system using arduino with Wifi [ESP8266-01], bluetooth (HC-05) and IR remote control. Home automation results in a smarter home and is used to provide a higher and healthier standard of living. The beauty of a home automation system is that it is highly scalable, flexible and its capabilities are limited only by our imagination.

Step 1: Overview of the Home Automation System

Picture of Overview of the Home Automation System

This systems consists of 3 custom built arduino uno boards, two of which are connected to each other via I2C bus, one of which acts as a "master sender" and the other a "slave reciever". Home automation system can be controlled using Internet, which is achieved by using ESP8266-01 and blynk libraries. It also allows us to control the system by giving voice commands using HC-05 bluetooth module and AMR voice app.

I have explained interfacing each of the components to the microcontroller.

Materials needed:

* 3x arduino uno or Atmega328 / Atmega328p

*ESP8266-01,

*HC-05

*TSOP IR receiver

*IR remote.

*nokia 5110 display

* RTC (DS1307) real time clock

To build your own 5V Power supply from 230v / 110v ac-

*12-0-12 1A step down transformer

*Bridge rectifier / 4x diodes(1N4001)

*1000uF, 25v capacitor

*DC-DC stepdown buck convertor

*LM1117 or LM317 to get 3.3V power supply for ESP8266-01

SENSORS

*PIR (passive infrared)

*DHT11(Temperature and humidity)

* other materials such as breadboard, strippers, wires, jumpers, glue, sticky tapes etc..

Step 2: Circuit Diagram

Picture of Circuit Diagram

The main control center of system are the three ATmega328p microcontroller. This part of the system manages the controllers and gets the commands from the user. It also sends temperature and humidity measurement to the mobile application. ATmega328p also gets sensor data and processes them to perform useful functions. The microcontroller also switches the relays to turn on/off the electrical devices when required. It displays the date and time using the RTC and the LCD display device.

Step 3: POWER SUPPLY

Picture of POWER SUPPLY

The micro controllers need 5V DC power supply, this is obtained from 230V AC supply.

* A 12-0-12, 1A STEP DOWN transformer converts 230v AC to 12V AC.

*12V AC is converted to unregulated DC by passing it through a BRIDGE RECTIFIER and A 1000uF capacitor.

*12V DC (unregulated) is applied at the inputs of a DC-DC step down BUCK CONVERTER.The buck converter is adjusted to get output voltage of 5V DC.

* Buck converters are highly efficient over linear regulators(LM7805).

Step 4: Connecting ESP8266-01 to Arduino Uno

Picture of Connecting ESP8266-01 to Arduino Uno

The following tutorial by me shows how to flash firmware and upload code to ESP8266-01 using uno and mega.

https://www.instructables.com/id/Connecting-ESP8266...

and then create a project in Blynk app

I've used DHT11 data to be transmitted to blynk app and used 3 buttons to control the 230v bulbs using relay.

Use the DHT11 files to send data via esp-01 to blynk app.

Step 5: Bluetooth Voice Control

Picture of Bluetooth Voice Control

Android Meets Robots: Voice Recognition, Uses android phone’s internal voice recognition to send voice commands to the microcontroller via bluetooth module. It pairs with Bluetooth Serial Modules and sends in the recognized voice as a string. The voice to text conversion requires an internet connection to the android device. For example if you say Hello the android phone will return a sting *Hello# to your bluetooth module *and # indicate the start and stop bits

check out this tutorial for connections

https://www.instructables.com/id/Voice-Activated-Ar...

Step 6: IR Controller

Picture of IR Controller

Use this library and the hex codes given in the image to program the uno to perform specific functions when key is the pressed.

https://github.com/z3t0/Arduino-IRremote

Step 7: Connecting Nokia 5110 LCD and RTC

Picture of Connecting Nokia 5110 LCD and RTC

Connections

display---arduino

clk-- 8

MOSI/Din- 9

DC-- 10

RST -- 11

CS -- 12

RTC -- arduino

SCL --- A5

SDA-- A4

Then use the code given to display the time from RTC on nokia 5110.

Step 8: RELAYS

Picture of RELAYS

A relay is basically an electrically controlled mechanical switch. Inside that harmless looking plastic box is an electromagnet that, when it gets a jolt of energy, causes a switch to trip. The microcontroller provides 5V signal to the relay it is converted to a 12V signal by the driver circuit which consists of a transistor and a diode.

Step 9: I2C Communication

Picture of I2C Communication

This library allows you to communicate with I2C / TWI devices. On the Arduino boards with the R3 layout (1.0 pinout), the SDA (data line) and SCL (clock line) are on the pin headers close to the AREF pin.

use the master writer and slave receiver codes. The Uno with WIFI and DHT acts as master sender and the uno with bluetooth, IR receiver acts as slave receiver.

https://www.arduino.cc/en/Reference/Wire

Step 10: Home Automation System

Picture of Home Automation System

The final system is as shown.

Step 11: Code

You can find the code to this project in the following link

Code

Comments

gelooooooow07 (author)2016-12-10

Great bro! but where are the codes?

Amith MP (author)gelooooooow072017-06-21

https://github.com/Amitmp/Home-Automation-project

HaseebS10 (author)2017-02-24

can we access in this WiFi (arduino) from other network or from anywhere??

Amith MP (author)HaseebS102017-06-21

Yes

zoha imran (author)2017-03-07

Aoa sir my project is remote control of home appliance with arduino through webpage for interfacing arduino with webpage i am using esp8266 esp 12...in project i am using master slave technique ...which means webpage will interface with master arduino through esp8266 then that master arduino will send signal to slave arduino through rf module ..and this slave will now light up the appliances....now main issue is i have made webpage communication between master slave has been done ...but interfacing of arduino with webpage is making problem ....my code is correct connections are correct but the code is not burning in wifi module it is giving error "
Error : failed to open com6
Error: espcom_open failed
Error: espcom_upload_mem failed "
Do you have some idea about it ?
Moreover sir i wana ask we have to remove arduino chip when we are buring code in esp8266 ?
Or we have to write the code in the same arduino file which we have developed while communication between master and slave ?

Amith MP (author)zoha imran2017-06-21

https://github.com/Amitmp/Home-Automation-project

VinuthaV (author)2017-05-17

nice explanation.. also plz give me the code and circuit diagram for voice controlled home automation using arduino uno and esp8266 01..thanku

Amith MP (author)VinuthaV2017-06-21

https://github.com/Amitmp/Home-Automation-project

Amith MP (author)2016-10-16

ESP8266-1 needs 3.3v power supply. The whole system is running on 5V supply so I've used a Linear voltage regulator LM317.

AdelbertD (author)Amith MP2016-10-17

sir can you show us the LM317 connection or show atleast a circuit diagram how will I connect the LM317.. i think there is 2 resistor connected and a capacitor? what are the value of used components?

AdelbertD (author)2016-10-15

why it is that the ESP8266-1 on the video it has capacitor and resistors,, that is not on the circuit diagram? I want to make this as my project i just need your help.

AdelbertD (author)2016-10-11

another thing sir you said you used 3 atmega328 but i can only see a 2 atmega328 on the circuit diagram.

AdelbertD (author)2016-10-10

Can you add up more on the circuit diagram sir/madam? Can you complete the circuit diagram?

Ramkumar paidi (author)2016-08-13

sar have u done any tutorial in youtube for it so that I can see how it is working if yes plz send me the link of it sar

Amith MP (author)Ramkumar paidi2016-08-14

https://www.youtube.com/playlist?list=PLs2Ndc5xvbarf6pqn83TpvVKdyGVDAl0i

Ramkumar paidi (author)2016-08-13

super project sar

Vince35 (author)2016-06-29

Looks nice! Do you know about the free open source Home Assistant? http://home-assistant.io/
You can hookup a lot to that.

kavish laxkar (author)2016-06-24

Great bro
Keep it up.:)
I think you made it as a final year project.:D

andrewty (author)2016-06-24

The advantage of creating a 12Vdc supply and then regulating that down to 5Vdc for the control circuits is that the relays can operate from the 12Vdc.

One could use a small 10VA 9Vac single secondary mains isolating transformer to get the 12Vdc across the 1000uF smoothing capacitor.

10VA gives a continuous maximum DC output current of approx 600mA. This could be upto 1200mA if very low duty cycle.

If you know your circuits don't need any more than 300mAdc you could use a 6VA transformer.

JC41 (author)2016-06-23

Great ible. One suggestion is to skip the buck regulator and just go with linear. The current draw is probably less than 1 Amp, and since you're mains-connected, power consumption shouldn't be an issue. Linear will save cost and space, and provide cleaner power to the uc's.

Amith MP (author)2016-06-23

Thank you :)

billbillt (author)2016-06-23

Wonderful project!!.. All the more interesting with your use of a model!!.. A++++!!..

Fermartol (author)2016-06-21

The truth is that the explanation is quite good , it is interesting but might miss some illustrative larger image Article ... anyway I congratulate you for the post !

regards and more information in this web


About This Instructable

46,129views

706favorites

License:

Bio: An Electronics and communication engineer !!!
More by Amith MP:Home Automation Using Arduino With Wifi, Bluetooth and IR Remote ControlConnecting ESP8266-01 to Arduino UNO/ MEGA and BLYNK
Add instructable to: