0% found this document useful (0 votes)
44 views

Murari Singh

This document provides details about a 6-week summer training project on home automation using IoT with Arduino and Node MCU. The project involves controlling home appliances like lights and fans remotely using IoT technology. It describes the components required including Node MCU, MQTT protocol, Adafruit.io server, LED, relay, jumper wires, power supply, and Arduino IDE. It also explains how Node MCU, MQTT protocol, and Adafruit.io work and their basic terms. The document outlines the code, project execution, and concludes with learning outcomes from the project.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Murari Singh

This document provides details about a 6-week summer training project on home automation using IoT with Arduino and Node MCU. The project involves controlling home appliances like lights and fans remotely using IoT technology. It describes the components required including Node MCU, MQTT protocol, Adafruit.io server, LED, relay, jumper wires, power supply, and Arduino IDE. It also explains how Node MCU, MQTT protocol, and Adafruit.io work and their basic terms. The document outlines the code, project execution, and concludes with learning outcomes from the project.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 37

CETPA

SIX WEEK SUMMER TRAINING

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

Submitted in partial fulfilment of the requirements for


the award of the degree of

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 is no 1 in the field of Software & Embedded Training programs for


engineering & other students. CETPA INFOTECH PVT LTD is the leader in
the “specialized training” brands of India certified by ISO 9001:2015 for its best
quality. CETPA INFOTECH is the largest training service provider in various
engineering domains for all engineering students as well as for the working
professionals. It has an extensive experience of nurturing over 200000+ students
in the past few years.

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.

STUDENT’S NAME ROLL NO STUDEN’S SIGNATURE

DEEPAK KUMAR 1607731003

TRANEE NAAME SIGNNATUTE

MR. UMASHANKAR

Mr. SUMIT GUPTA


(Head of Department)
(Assistant Professor of electronics & communication)
DR.K.N.M.I.E.T,MODINAGAR,GHAZIYABAD,201204
3|Page
ACKNOWLEDGEMEN

I would like to express my special thanks of gratitude to my teacher


Mr. Umashankar who help me to do this wonderful project on the
topic HOME AUTOMATION USING IOT WITH ARDUINO, which
also helped me in doing a lot of Research and i came to know about so
many new things I am really thankful to them.
Secondly i would also like to thank my parents and friends who helped
me a lot in finalizing this project within the limited time frame.

I would like to express my


gratitude towards member of CETPA INFOTECH PVT. LTD. for their
kind co-operation and encouragement which help me in completion of
this project. I would like to express my special gratitude and thanks to
industry persons for giving me such attention and time.

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

HOME AUTOMATION USING IOT WITH


ARDUINO and NODE MCU.
INTRODUCTION

 Home automation is the process controlling home appliances


automatically using various control system techniques. The electrical
and electronic appliances in the home such as fan, lights, outdoor lights,
kitchen timer, etc., can be controlled using various control techniques.

 There are various techniques to control home appliances such as Iot


based home automation ,home automation under WiFi through android
apps from any smartphone, Arduino based home automation, home
automation by android application based remote control, home
automation using digital control, RF based home automation system
and touch screen based home automation.

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.

 The module is mainly based on ESP8266 that is a low-cost Wi-Fi microchip


incorporating both a full TCP/IP stack and microcontroller capability.

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

UART serial communications.

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.

 Provide 3.3V. This is another great option to power up the module. If


you have your own off-board regulator, you can generate an instant
power source for your development kit.

 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 :-

 Mqtt stands for Message Queuing Telemetry Transport. It is a


lightweight publish and subscribe system where you can publish and
receive messages as a client.

 MQTT is a simple messaging protocol, designed for constrained


devices with low-bandwidth. So, it’s the perfect solution for Internet of
Things applications.

Basic term in MQTT

In mqtt there are few basic term which are need to understand

 Publish
 Subscribe
 Topic
 Broker

 Publish:- publish means a data is sent to the devices

 Subscribe:-the device which received the message will respond


on the command.

 Topic : topic may be anything such as if we have two switches


then will be two topic which is differentiated by two different
name sw1 and sw2

 Broker:- The broker is primarily responsible for receiving all


messages, filtering the messages, decide who is interested in
them and then publishing the message to all subscribed
clients.

10 | P a g e
Fig:basic term in mqtt

11 | P a g e
CHAPTER 5

ADAFRUIT IO:-

Adafruit.io is a cloud service - that just means we run it for US


and we don't have to manage it. We can connect to it over the
Internet. It's meant primarily for storing and then retrieving data
but it can do a lot more than just that!

What we can do with adafruit.io

 Display our data in real-time, online


 Make ourproject internet-connected: Control motors, read sensor data,
and more!
 Connect projects to web services like Twitter, RSS feeds, weather services,
etc.
 Connect our project to other internet-enabled devices
 The best part? All of the above is do-able for free with Adafruit IO

12 | P a g e
CHAPTER 6

CODE

//Home Automation project using iot

#include <ESP8266WiFi.h>

#include "Adafruit_MQTT.h"

#include "Adafruit_MQTT_Client.h"

#define Relay0 D0

#define WLAN_SSID "Redmi" // Your SSID

#define WLAN_PASS "deepak123" // Your password

/************************* Adafruit.io Setup *********************************/

#define AIO_SERVER "io.adafruit.com" //Adafruit Server

#define AIO_SERVERPORT 1883

#define AIO_USERNAME "deepak11111" // Username

#define AIO_KEY "ea36a8b795b3450da189e8e1809fa163" // Active


Key

//WIFI CLIENT

13 | P a g e
WiFiClient client;

Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT,


AIO_USERNAME, AIO_KEY);

Adafruit_MQTT_Subscribe Light0 = Adafruit_MQTT_Subscribe(&mqtt,


AIO_USERNAME "/feeds/Relay0");

void MQTT_connect();

void setup() {

Serial.begin(115200);

pinMode(Relay0, OUTPUT);

// Connect to WiFi access point.

Serial.println();

Serial.println();

Serial.print("Connecting to ");

Serial.println(WLAN_SSID);

14 | P a g e
WiFi.begin(WLAN_SSID, WLAN_PASS);

while (WiFi.status() != WL_CONNECTED) {

delay(500);

Serial.print(".");

Serial.println();

Serial.println("WiFi connected");

Serial.println("IP address: ");

Serial.println(WiFi.localIP());

mqtt.subscribe(&Light0);

void loop() {

MQTT_connect();

Adafruit_MQTT_Subscribe *subscription;

while ((subscription = mqtt.readSubscription(20000))) {

15 | P a g e
if (subscription == &Light0) {

Serial.print(F("Got: "));

Serial.println((char *)Light0.lastread);

int Light0_State = atoi((char *)Light0.lastread);

digitalWrite(Relay0, Light0_State);

void MQTT_connect() {

int8_t ret;

if (mqtt.connected()) {

return;

Serial.print("Connecting to MQTT... ");

uint8_t retries = 3;

while ((ret = mqtt.connect()) != 0) {


16 | P a g e
Serial.println(mqtt.connectErrorString(ret));

Serial.println("Retrying MQTT connection in 5 seconds...");

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 :-

Finally …….we are at point of conclusion of this project.


In this project we are successfully made a home automation system based
on iot technology with node mcu .The advantage of this project is that we
are able to control the home appliances with internate in smart way . IOT
system increases the efficient resource utilization as well as monitor natural
souce..It reduce the human effort then obiously save our time.

The future of IoT is virtually unlimited due to


advances in technology and consumers desire to integrate the devices
.Internate has made it possible to connect .

20 | P a g e
CHAPTER 8

BLUETOOTH CONTROLLED CAR

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

The word DC is basically an abbreviation of Direct current. So, a direct


current motor is commonly used motor having two input terminals, one is
positive and the other one is negative. If we connect these terminals with the
voltage supply the motor will rotate. If you change the polarity then motor will
rotate in opposite direction.

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

Tx of Bluetooth pin is connected to Rx pin of arduino while Rx pin of


Bluetooth is connected to tx pin of arduino.

L298 MOTOR DRIVER

23 | P a g e
CIRCUIT DIAGRAM

BLUETOOTH SOFTWARE

BLUETOOTH TERMINAL HC05 is software which downloaded with


playstore is connected with our Bluetooth module

Car is control with software in which a terminal is given.,we have to send


the command to the module as per the program and car controlled

CODE

const int pin1=13;

const int pin2=12;

const int pin3=11;

const int pin4=10;

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

WATER LEVEL DETECTION IN TANK USING ULTRASONIC SENSOR

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

GND - This pin connected to the ground .

29 | P a g e
BUZZER:

A buzzer or beeper is an audio signalling device, which may


be mechanical, electromechanical, or piezoelectric (piezo for short).
Typical uses of buzzers and beepers include alarm devices, timers, and
confirmation of user input such as a mouse click or keystroke.

CODE

const int pinno=7;

const int buzzer=13;

void setup() {

pinMode(7,INPUT);

pinMode(led,OUTPUT);

Serial.begin(9600);

void loop() {

long microsecondsToinches(long duration);

long microsecondsTocentimeters(long duration);

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);

long microsecondsToinches(long microseconds){


31 | P a g e
return microseconds/74/2;

long microsecondsTocentimeters(long microseconds)

return microseconds/29/2;

CIRCUIT DIAGRAM

32 | P a g e
PROJECT EXECUTION

CONCLUSION

Finally …….we are at point of conclusion of this project.


In this project we are successfully made a water leve detection in tank.The
advantage of this project is that we get a sound if our water tank is full .
and we will off the switch of the motor due to this we will able to save the
water .

33 | P a g e
Thank you

34 | P a g e
35 | P a g e
36 | P a g e

You might also like