Introduction: How to Make an IoT Device to Control Appliances and Monitor Weather Using Esp8266
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..
Step 1: Components Required
Step 2: Circuiting
- 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.
Step 3: Creating a Device in Dashboard.
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 ]
Step 4: 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.
Step 5: Construction and Testing
We have a be nice policy.
Please be positive and constructive.
how to open this file