Murari Singh
Murari Singh
July 12
PROJECT
REPORT 2019
HOME
In this report we are mention the work on which is based on IOT AUTOMATION
technology with arduino and node MCU.
USING IoT
WITH ARDUINO
CETPA
SIX WEEK SUMMER TRAINING
HOME AUTOMATION
USING IoT
WITH ARDUINO
By
DEEPAK KUMAR
Supervised
. By
MR. UMASHANKAR
[ July 2019 ]
1|Page
ABOUT CETPA
CETPA, the Composition of "Computer Education & Technology
Promotion Association", believes in quality not in quantity BECAUSE
KNOWLEDGE MATTERS.
CETPA has been awarded as the “Best IT and Embedded Training Company”
for 5 consecutive years for delivering high quality training and workshops at
more than 500 colleges across India. CETPA is a trustworthy brand in
Education and Training industry with its presence across several cities such as
Noida, Roorkee, Lucknow, Dehradun. The company was started 12 years back
and it is continuously expanding having its overseas branches in Germany and
Ukraine. CETPA is an associated training partner of NUVOTON,
MICROSOFT, ORACLE, DOEACC, PANASONIC, and AUTODESK.
2|Page
DECLARATION
I, student of B.Tech (ECE 7th) hereby declare that the summer training project
entitled “HOME AUTOMATION USING IoT WITH ARDUINO” which is
submitted to Department of ECE, DR. K.N. Modi Institute of engineering &
technology,Modinagar ,Uttarpradesh, affiliated to AKTU University, Lucknow
in partial fulfilment of requirement for the award of the degree of Bachelor of
Technology in ECE, has not been previously formed the basis for the award of
any degree, diploma or other similar title or recognition.
This is to certify that the above statement made by the candidate is correct to
the best of my knowledge.
MR. UMASHANKAR
4|Page
CONTENTS
CHAPTER 1
HOME AUTOMATION USING IOT WITH ARDUINO AND NODE MCU PAGE NO.
INTRODUCTION…………............................................................................................................6
CHAPTER 2
COMPONENT REQUIREMENT………………………………………………………………………………………………7
CHAPTER 3
NODE MCU…………………………………………………………………………………………………………………………..8
CHAPTER 4
MQTT PROTOCOL……………………………………………………………………………………………………………….10
CHAPTER 5
ADAFRUITE. IO……………………………………………………………………………………………………………………12
CHAPTER 6
CODE………………………………………………………………………………………………………………………………….13
CHAPTER 7
PROJECT EXECUTATION……………………………………………………………………………………………………..18
CONCLUSION………………………………………………………………………………………………………………………20
CHAPTER 8
BLUETOOTH CONTROL CAR………………………………………………………………………………………………21
CHAPTER 9
WATER LEVEL DETECTION IN TANK USING ULTRA SONIC…………………………………………………..28
5|Page
CHAPTER 1
6|Page
CHAPTER 2
PROJECT NO.1
COMPONENTS REQUIRED:-
1.NODEMCU OR ESP8266
2.MQTT FX messaging tool
3.ADAFRUIT.IO SERVER
4.LED
5.RELAY
6.JUMPER WIRE
7.POWER SUPPLY
8.ARDUINO IDE
9.LOCAL ACCESS NETWORK
7|Page
CHAPTER 3
NODE MCU[ESP8266]
It is an open-source firmware and development kit that plays a vital role in
designing your own IoT product using a few Lua script lines.
PIN DESCRIPTION
Multiple GPIO pins on the board allow us to connect the board with
other peripherals and are capable of generating PWM, I2C, SPI, and
8|Page
USB Power. It proves to an ideal choice for loading programs unless
the project you aim to design requires separate interface i.e.
disconnected from the computer.
Power Vin. This is a voltage regulator that comes with the ability to
support up to 800 mA. It can handle somewhere between 7 to 12 V.
You cannot power the devices operating at 3.3 V, as this regulator
unable to generate as low as 3.3v
9|Page
CHAPTER 4
MQTT :-
In mqtt there are few basic term which are need to understand
Publish
Subscribe
Topic
Broker
10 | P a g e
Fig:basic term in mqtt
11 | P a g e
CHAPTER 5
ADAFRUIT IO:-
12 | P a g e
CHAPTER 6
CODE
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#define Relay0 D0
//WIFI CLIENT
13 | P a g e
WiFiClient client;
void MQTT_connect();
void setup() {
Serial.begin(115200);
pinMode(Relay0, OUTPUT);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(WLAN_SSID);
14 | P a g e
WiFi.begin(WLAN_SSID, WLAN_PASS);
delay(500);
Serial.print(".");
Serial.println();
Serial.println("WiFi connected");
Serial.println(WiFi.localIP());
mqtt.subscribe(&Light0);
void loop() {
MQTT_connect();
Adafruit_MQTT_Subscribe *subscription;
15 | P a g e
if (subscription == &Light0) {
Serial.print(F("Got: "));
Serial.println((char *)Light0.lastread);
digitalWrite(Relay0, Light0_State);
void MQTT_connect() {
int8_t ret;
if (mqtt.connected()) {
return;
uint8_t retries = 3;
mqtt.disconnect();
delay(5000);
retries--;
if (retries == 0) {
while (1);
Serial.println("MQTT Connected!");
17 | P a g e
CHAPTER 7
PROJECT EXECUTATION:-
relay
led bulb
18 | P a g e
Off stage
On stage
19 | P a g e
CONCLUSION :-
20 | P a g e
CHAPTER 8
COMPONENTS REQUIREMENTS
1. TWO DC MOTOR
2. ARDUINO BOARD WITH CABLE WIRE
3. ARDUINO IDE
4. BLUETOOTH MODULE(HC-SR 05)
5. L298 MOTOR DRIVER
6. BLUE TOOTH SOFTWARE
7. POWER SUPPLY
21 | P a g e
DC MOTOR
DC motor
BLUETOOTH MODULE(HC05)
22 | P a g e
Bluetooth is a device in which there are four pins
1. Tx
2. Rx
3. Vcc
4. Gnd
23 | P a g e
CIRCUIT DIAGRAM
BLUETOOTH SOFTWARE
CODE
char data;
void setup() {
Serial.begin(9600);
pinMode(pin1,OUTPUT);
24 | P a g e
pinMode(pin2,OUTPUT);
pinMode(pin3,OUTPUT);
pinMode(pin4,OUTPUT);
void loop() {
if(Serial.available()>0)
data=Serial.read();
if(data=='f')
digitalWrite(pin1,HIGH);
digitalWrite(pin2,LOW);
digitalWrite(pin3,HIGH);
digitalWrite(pin4,LOW);
if(data=='b')
digitalWrite(pin1,LOW);
digitalWrite(pin2,HIGH);
digitalWrite(pin3,LOW);
digitalWrite(pin4,HIGH);
if(data=='l')
25 | P a g e
{
digitalWrite(pin1,HIGH);
digitalWrite(pin2,LOW);
digitalWrite(pin3,LOW);
digitalWrite(pin4,LOW);
if(data=='r')
digitalWrite(pin1,LOW);
digitalWrite(pin2,LOW);
digitalWrite(pin3,HIGH);
digitalWrite(pin4,LOW);
if(data=='s')
digitalWrite(pin1,LOW);
digitalWrite(pin2,LOW);
digitalWrite(pin3,LOW);
digitalWrite(pin4,LOW);
26 | P a g e
PROJECT EXECUTION
27 | P a g e
CHAPTER 9
COMPONENT REQUREMENT
1.ULTRASONIC SENSOR
2.ARDUINO BOARD WITH CABLE
3.ARDUINO IDE
4.BUZZER
5.POWER SUPPLY
28 | P a g e
ULTRASONIC SENSOR
PIN DESCRIPTION
VCC - The Vcc pin powers the sensor, typically with +5V
TRIGGER - Trigger pin is an Input pin. This pin has to be kept high
for 10us to initialize measurement by sending US wave.
ECHO - Echo pin is an Output pin. This pin goes high for a period
will be equal to the time taken for the US wave to return
back to the sensor
29 | P a g e
BUZZER:
CODE
void setup() {
pinMode(7,INPUT);
pinMode(led,OUTPUT);
Serial.begin(9600);
void loop() {
long duration,inches,cm;
pinMode(pinno,OUTPUT);
30 | P a g e
digitalWrite(pinno,LOW);
delayMicroseconds(2);
digitalWrite(pinno,HIGH);
delayMicroseconds(5);
pinMode(pinno,INPUT);
duration=pulseIn(pinno,HIGH);
inches=microsecondsToinches(duration);
cm=microsecondsTocentimeters(duration);
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();
delay(1000);
if(inches<=5)
digitalWrite(buzer,HIGH);
else
digitalWrite(buzzer,LOW);
return microseconds/29/2;
CIRCUIT DIAGRAM
32 | P a g e
PROJECT EXECUTION
CONCLUSION
33 | P a g e
Thank you
34 | P a g e
35 | P a g e
36 | P a g e