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

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
dht11.jpg

Node MCU Esp8266 [Banggood]

4 Channel Relay Board [Banggood]

Perfboard [Banggood]

Header Pins [Banggood]

DC Jack [Banggood]

DHT 11 [Banggood]

Circuiting

Screenshot (45).png
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
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.

  1. First Open the code and edit as follow.
  2. 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

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]

Visit my website for more projects.