How to Make an IoT Device to Control Appliances and Monitor Weather Using Esp8266
by JunezRiyaz in Circuits > Electronics
11989 Views, 33 Favorites, 0 Comments
How to Make an IoT Device to Control Appliances and Monitor Weather Using Esp8266
![IMG_20170503_142842_HDR.jpg](/proxy/?url=https://content.instructables.com/FLA/4JAX/J2830UU1/FLA4JAXJ2830UU1.jpg&filename=IMG_20170503_142842_HDR.jpg)
The Internet of things (IoT) is the inter-networking of physical devices (also referred to as "connected devices" and "smart devices"), buildings, and other items—embedded with electronics, software, sensors, actuators, and network connectivity that enable these objects to collect and exchange data.
Now I am going to instruct how to make an IoT base device which is capable of controlling the appliances and realtime weather monitoring . This device is build using ESP8266 Node Mcu .
Esp8266 node mcu is a device with built in wifi module and micro controller which can interface with arduino ide .
Lets Get Started..
Components Required
![blu.jpg](/proxy/?url=https://content.instructables.com/FY1/ZYIL/J0COTVNR/FY1ZYILJ0COTVNR.jpg&filename=blu.jpg)
![dht11.jpg](/proxy/?url=https://content.instructables.com/F3P/RNSY/J2831STX/F3PRNSYJ2831STX.jpg&filename=dht11.jpg)
Circuiting
![Screenshot (45).png](/proxy/?url=https://content.instructables.com/F5G/T5FS/J0COTVNX/F5GT5FSJ0COTVNX.png&filename=Screenshot (45).png)
![IMG_20170504_131513_HDR.jpg](/proxy/?url=https://content.instructables.com/F91/YU2G/J2832HQT/F91YU2GJ2832HQT.jpg&filename=IMG_20170504_131513_HDR.jpg)
- First take a perfboard and place female header pins with respect to Node Mcu esp8266 pins.
- Take male header pins and solder beside of female header pins and interconnect the male and female header pins w.r.t Esp8266 to take output.
- Add some more male header pins at +V and GND pins of Esp8266
- Now the turn to make power supply , take a dc jack and IC7805 place it on the perfboard.
- Connect Vin of IC7805 to +V of Dc jack and GND to GND.
- Now wire the +5v out of 7805 to Vin of Esp8266 and GND of IC7805 to GND of Esp8266.
- Now wire the Relay board and DHT 11 module to Esp 8266 according to pins in the circuit.
- The connections int he circuit is same as the pins declared in the program.
Now we need to prepare the dashboard and program the device.
Downloads
Creating a Device in Dashboard.
![Using the Cayenne MQTT API to add your Arduino Device](/proxy/?url=https://content.instructables.com/F9H/K872/J2831QDR/F9HK872J2831QDR.jpg&filename=Using the Cayenne MQTT API to add your Arduino Device)
![Screenshot (66).png](/proxy/?url=https://content.instructables.com/F4B/OI06/J2832GUH/F4BOI06J2832GUH.png&filename=Screenshot (66).png)
For this project I used Cayenne IoT platform .
First you need to go Cayenne site and create an account by sign up.
Now follow the instructions as given in the video.
While creating the device you need to select MQTT type.
Then site will generate username, password and client id for the device, you need to copy it . This is needed for further procedure.
For more info visit here [Tutorial by Cayenne IoT team ]
Programming
Download the libraries attached and include it in arduino ide .
I attached the code.
- First Open the code and edit as follow.
- Enter SSID of your wifi network ( Wifi network name ) with in the quotes.
char ssid[] = "enter your wifi network name ";
3. Enter password of your wifi network with in the quotes.
char wifiPassword[] = "enter your wifi router password ";
4.Now you need to fill user name,password,clientid which you got while adding the device.
char username[] = "enter user name ";
char password[] = "enter password ";
char clientID[] = " enter client id ";
Now save and upload the code to ESP 8266 node mcu module.
When esp8266 node mcu module is connect to that server , you can see automatically widgets created in your dashboard. Pin those widgets and edit them (name, type etc) .
Thats all Guys ...
For complete construction see the video below.
Construction and Testing
![Home Automation and Weather Monitor Using IOT](/proxy/?url=https://content.instructables.com/FXW/SMQQ/J2831S8E/FXWSMQQJ2831S8E.jpg&filename=Home Automation and Weather Monitor Using IOT)
Feel free to comment.
If you want to learn C Programming you can easily learn at codingtute. It will enhance your arduino programming skills.
For more projects subscribe my youtube channel [Click Here]