0% found this document useful (0 votes)
30 views36 pages

Pritam Piyush - 101704091 - Design Project Final Report

Uploaded by

Pritam Piyush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views36 pages

Pritam Piyush - 101704091 - Design Project Final Report

Uploaded by

Pritam Piyush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

ALTERNATE SEMESTER

DESIGN PROJECT REPORT


Undertaken at

THAPAR INSTITUTE OF ENGINEERING AND TECHNOLOGY

On

HOME AUTOMATION AND APPLIANCES USAGE CONTROL


USING
INTERNET OF THINGS (IOT)

Submitted by
Pritam Piyush
101704091
Under the Guidance
of

Faculty Coordinator
Dr. Surya Prakash
Associate Professor

2021

Electrical and Instrumentation Engineering Department


Thapar Institute of Engineering and Technology
Patiala – 147004 Punjab (India)
DECLARATION

I hereby declare that the project entitled “Home Automation and Appliances usage control
using IOT” is an authentic record of my own work carried out at Thapar Institute Of
Engineering And Technology, as requirements of alternate semester for the award of degree of
B.E. Electrical Engineering, Thapar Institute of Engineering and Technology, Patiala, under the
guidance of Dr.Surya Prakash, Associate Professor, EIED during 24thFebruary, 2021 to
3rdJune, 2021.

Date : 03.06.2021 Name : Pritam Piyush

Certified that the above statement made by the student is correct to the best of our knowledge
and belief

i
ACKNOWLEDGEMENT

With the successful completion of the project under the stipulated time, I would like to take this
opportunity to present my whole hearted compliments, with higher regards and warm thanks to
one and all, which played an integral role and acted as sinews of this project . I would like to grab
this opportunity to express my gratitude to all the individuals for their keen devotion without
whom this endeavor would not have been a success.

I would also like to pay my boundless thanks to Dr. Surya Prakash Sir for extending help and
guidance during the period. They have definitely played an integral role towards successful
completion of the project.

Pritam Piyush

(101704091)

ii
ABSTRACT

With advancement of Automation technology, life is getting simpler and easier in all aspects. In today’s
world Automatic systems are being preferred over manual system. With the rapid increase in the
number of users of internet over the past decade has made Internet a part and parcel of life, and IoT is
the latest and emerging internet technology. Internet of things is a growing network of everyday object-
from industrial machine to consumer goods that can share information and complete tasks while you are
busy with other activities. Wireless Home Automation system(WHAS) using IoT is a system that uses
computers or mobile devices to control basic home functions and features automatically through internet
from anywhere around the world, an automated home is sometimes called a smart home. It is meant to
save the electric power and human energy. The home automation system differs from other system by
allowing the user to operate the system from anywhere around the world through internet.

iii
GANTT CHART

Project title– Home Automation and Appliances usage control using IOT
……………………………….

Intern–Pritam Piyush(101704091)

Duration–24thFebruary to 3rdJune, 2021

The Gantt chart describing various activities undertaken during project work is summarized as
follows:-

ACTIVITIES FEBRUARY MARCH APRIL MAY JUNE


Study about project’s
necessities
Overview of project
details
Literature Survey

Goal Report
Lockdown Due to
COVID-19. Read
about all the
technologies
concerned with IOT
Learnt and Implemented
the Interfacing of various
Wireless Communication
modules like HC05
Bluetooth module and
ESP8266 Wifi module.
Learnt about
Implementation and
working of two
channel relay driver.

iv
TABLE OF CONTENTS

DECLARATION ................................................................................................................. i
ACKNOWLEDGEMENT .................................................................................................. ii
ABSTRACT ....................................................................................................................... iii
GANTT CHART ............................................................................................................... iv
TABLE OF CONTENTS .................................................................................................... v
LIST OF FIGURES .......................................................................................................... vii
LIST OF TABLES……………………………………………………………………….vii

CHAPTER 1 INTRODUCTION ................................................................................................. 7

CHAPTER 2 NEED ANALYSIS................................................................................................. 8

CHAPTER 3 LITREAURE SURVEY ........................................................................................ 9

CHAPTER 4 COMPONENTS REQUIRED ............................................................................ 10

CHAPTER 5 DESIGN METHODOLOGY AND PROJECT DESCRIPTION ................... 11


5.1ARDUINO UNO .................................................................................................... 11
5.2RELAY ................................................................................................................... 15
5.3BLUETOOTH MODULE ...................................................................................... 20
5.4WIFI MODULE ...................................................................................................... 22

CHAPTER 6 DESIGN BLOCK DIAGRAM ........................................................................... 25

CHAPTER 7 DESIGN PROJECT COMBINED MODULE.................................................. 26

CHAPTER 8 PROGRAMMING LOGIC AND CODE EMPLOYED .................................. 27


APPENDIX-A................................................................................................................... 30
PLAGIARISM REPORT .................................................................................................. 35

v
LIST OF FIGURES

FIG 1:- ARDUINO UNO R3……………..…………………………...……………………………..…...12


FIG 2:- H125S TWO CHANNEL RELAY ........................................................................................ 19
FIG 3:-BLUETOOTH MODULE ....................................................................................................... 21
FIG 4:PIN DESCRIPTION OF BLUETOOTH MODULE .............................................................. 22
FIG 5:-ESP8266 WIFI MODULE ....................................................................................................... 22
FIG 6:-ESP8266 WIFI MODULE PIN DIAGRAM .......................................................................... 23
FIG 7:- PIN BLOCK DIAGRAM OF DESIGN PROJECT .............................................................. 25
FIG 8:- DESIGN PROJECT COMBINED MODULE ...................................................................... 26
FIG 9:- DESIGN PROJECT COMBINED MODULE ...................................................................... 26

LIST OF TABLES

TABLE 1:-ESP8266 WIFI MODULE AT COMMANDS SHEET ............................................... 23

vi
CHAPTER 1 INTRODUCTION

Home automation has become more advantaegous due of its safety and security. In today’s times, home
automation is capable to monitor all the home appliances. Home automation system now is energy
efficient and eco friendly. It encompasses basic features to maintain the user satisfaction and comfort.
This proposed model is a precise combination of Android smart phone and embedded system which
include Arduino Uno Board, Wi-Fi module, Bluetooth module and relay circuit.

To help the wireless connectivity with the system, the Arduino Uno will be interfaced with a WiFi
module(ESP8266). This sets up the internet connection to the system and all the home appliances can in
turn be connected and controlled by internet.
The device is to be then connected to an Android App which allows us to control the devices using
Bluetooth technology .Usage statistics different devices can be seen as a plot on ThingSpeak App. By
using this app we can monitor and control the home appliances and their usage information from any
part of the world with ease.

7
CHAPTER 2 NEED ANALYSIS

Nowadays, we have remote controls for our television units and other electronic appliances, which have
made our lives easy to live day in and day out. But, Have we ever thought about home automation
which would give the facility of controlling lights, fans and other electrical appliances ? Off-course,
Yes!
But, are the options available today cost-effective? If the answer is No, a solution needs to be found for
this, which is a new system called Arduino based home automation using Bluetooth and wifi module.
This system is cost effective and can give the user, control of any electronic device without even
spending for a remote . This project helps the average common man to control all the
electronic/electrical devices using his/her smartphone. Time is money. To save people’s time,we
introduce Home Automation system using Bluetooth . With the help of this system we can control our
home appliances from our mobile phone itself. We can turn on/off your home appliances within the
range of Bluetooth and check their usage statistics on the net.

8
CHAPTER 3 LITERATURE SURVEY

A. IMPLEMENTATION OF INTERNET OF THINGS FOR HOME AUTOMATION:


Mamata Khatu, Neethu Kaimal, Pratik Jadhav and Syedali Adnan Rizvi [1] they presented a paper on
the implementation of Internet of things for home automation. This paper stressed on IoT coverage that
connects all the electrical/electronics devices with theinternet and thus helps in providing many services
and huge amount of data and statistical information. They also stressed on Cloud computing, Cloud
based platform help to connect the devices that surrounds as so that we can easily access anything at any
time from anywhere. They have illustrated sensing as a service on cloud by using certain application
like Augmented Reality, Agriculture, Environment and finally they have proposed a prototype model for
giving sensing as a service on cloud. The society need new and scalable, compatible and secure
solutions for both the various devices and the internet. Security concern can be solved by this model
since we are employing Wi-Fi Wireless Equivalent Privacy (WEP) and Wi-Fi Protected Access (WPA)

B. BLUETOOTH BASED WIRELESS HOME AUTOMATION SYSTEM USING FPGA:


B.Murali Krishna, V.Narasimha Nayak, K.Ravi Kishore Reddy, B.Rakesh, P.Manoj Kumar and
N.Sandhya [2] they discuss their paper on the Bluetooth based Wireless Home automation system using
FPGA.They primarily stressed on Bluetooth technology. With the help of the Bluetooth module (HC-
05) and Android Phone as device, they control the home appliances, which are all interfaced to FPGA
board. Thus, they have stated the advantages of the home automation, which is energy efficient and time
efficient for us. Moreover, they have stated that it is also helps the handicapped and old aged people.

9
CHAPTER 4 COMPONENTS REQUIRED

1. ARDUINO UNO

2. 2 CHANNEL RELAY(5v)

3. BLUETOOTH MODULE (HC05)

4. POWER SUPPLY

5. LOAD(2 BULBS 220V)

6. CONNECTING WIRES

7. WIFI MODULE (ESP8266)

8. SMARTPHONE(BLUETOOTH ENABLED)

10
CHAPTER 5 DESIGN METHODOLOGY DESCRIPTION

ARDUINO UNO

Arduino is an open source computer hardware and software enterprise, project, and community
that designs and produces single-board microcontrollers and kits for building interactive
devices that can sense and control objects in the physical world. The company's products are
distributed as open-source hardware and software, which are licensed and verified to use under
the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL),
granting the production of Arduino boards and software distribution by all. Arduino boards are
available in the market in preassembled form, or as DIY kits.

Arduino board designs employ a variety of microprocessors and controllers. The boards are
fortified with sets of digital and analog input/output (I/O) pins that can be interfaced to various
expansion boards or Breadboards in other circuits. The board uses serial communications
interfaces, including Universal Serial Bus (USB) on a few models, which are also used for
loading programs from desktops. The microcontrollers are usually programmed using a dialect of
features from the programming languages C and C++. In addition to using usual compiler
toolkits, the Arduino project gives an integrated development environment (IDE) based on the
Processing language model.

The Arduino project started in 2003 as a model for students at the Interaction Design Institute
Ivrea in Ivrea, Italy, with an aim to give a cost effective and easy way for students and
professionals to create devices that work with their environment using sensors and other tools.

11
Features of the Arduino UNO board are as follows:
1. Microcontroller: ATmega328 Operating Voltage: 5V
2. Input Voltage (recommended): 7-12V Input Voltage (limits): 6-20V
3. Digital I/O Pins: 14 (of which 6 provide PWM output) Analog Input Pins: 6
4. DC Current used for I/O Pin: 40 mA DC Current for 3.3V Pin: 50 mA
5. Flash Memory: 32 KB of which 0.5 KB used by bootloader SRAM: 2 KB (ATmega328)
6. EEPROM: 1 KB (ATmega328)
7. Clock Speed: 16 MHz

FIG 1 ARDUINO UNO R3

12
ARDUINO HARDWARE COMPONENT:-

Arduino is open-source hardware based enterprise. The hardware prototypesare distributed under
a Creative Commons Attribution Share-Alike 2.5 license and are made available as an open
source content which is free to use for all on the Arduino website.Description and production
files for some versions of the hardware are also made available for all.

Even though the hardware and software designs are free to use for all under copyleft licenses, the
developers have asked the name Arduino to be exclusive to the official product and not be used
for derived works without the consent of the enterprise.

Most Arduino boards encompasses of an Atmel 8-bit AVR microcontroller (ATmega8,


ATmega168, ATmega328, ATmega1280, ATmega2560) with different amounts of flash
memory, pins, and features. The 32-bit Arduino is based on the Atmel SAM3X8E, was made
public in 2012. The board uses single or double-row pins or female headers that help connections
for programming and interfacing into other circuits. These may join with add-on modules named
as shields. Multiple and arguably stacked shields may be individually addressed via an I²C serial
bus. Most boards have a 5 V linear regulator and a 16 MHz crystal oscillator or ceramic
resonator. Some prototypes, such as the LilyPad, run at 8 MHz and have the onboard voltage
regulator because of specific form-factor restrictions.

Arduino microcontrollers are pre-programmed with a boot loader that eases uploading of
programs to the on-chip flash memory. The primary bootloader of the Arduino UNO is the
optiboot bootloader. Boards are loaded with program code via a serial connection to another
desktop. Some serial Arduino boards have a level shifter circuit to convert between RS- 232
logic levels and transistor–transistor logic(TTL) level signals. Current Arduino boards are
programmed via Universal Serial Bus (USB), using USB-to-serial adapter chips
such as the FTDI FT232. Some boards,like as later-model Uno boards,instead use the FTDI chip
with a separate AVR chip having USB-to-serial firmware, which can be repraogammed via its
own ICSP header. Other varients, such as the Arduino Mini and the unofficial Boarduino, use a
detachable USB-to-serial adapter board or cable, Bluetooth or other methods.
13
ARDUINO SOFTWARE COMPONENT:-

IDE

The Arduino integrated development environment (IDE) is a multiplatform application (for


Windows, macOS, Linux) that is written in the Java programming language. It came from the
IDE for the languages Processing and Wiring. It has a code editor with features such as text
cutting and pasting, searching and replacing text, automatic indenting, brace matching, and
syntax highlighting, and gives simple one-click mechanisms to make and upload programs to an
Arduino board. It also has a message area, a text console, a toolbar with buttons for common
functions and a hierarchy of operation menus. The source code for the IDE is released under the
GNU General Public License, version 2.

The Arduino IDE allows the languages C and C++ using special rules of code making. The
Arduino IDE gives a software library from the Wiring project, which gives many similar input
and output procedures. User-written code only needs two basic functions, for starting the sketch
and the main program loop, that are compiled and attached with a program stub main() into an
executable cyclic program with the GNU toolchain, also attached with the IDE . The Arduino
IDE uses the program avrdude to change the executable code into a text file in hexadecimal
encoding that is loaded into the Arduino board by a loader logic in the board's firmware.

Sketch
A logic program written with the Arduino IDE is called a sketch. Sketches are saved on the
development desktop as text files with the file extension .ino. Arduino (IDE) pre-1.0 saved
sketches with the use of extension .pde.
A minimal Arduino C/C++ program is made up of of only two functions:

setup(): This function is called once when a sketch initiates again after power-up or reset. It is
used to start variables, input and output pin modes, and other libraries required in the sketch.

loop(): After setup() has been called, function loop() is executed continuosly in the main
program. It commands the board until the board is powered off or is reset. 14
RELAY:

A relay is an electrically controlled switch. Many relays make use of an electromagnet to


mechanically control a switch, but other operating theories are also made use of, like solid-state
relays. Relays are employed where it is necessary to command a circuit by a exclusive low-
power signal, or when many circuits must be controlled by the help of only one signal. Relays
were used highly in telephone exchanges and early computers to do logical operations.

Solid-state relays control power circuits with immoval parts, while using a semiconductor
device to do switching. Relays with calibrated operating nature and sometimes many operating
coils are used to safeguard electrical circuits from overload or faults; in modern electric power
systems these functions are done by digital instruments still called "protective relays".

Magnetic latching relays need one pulse of coil power to move their contacts in one direction,
and in other, redirected pulse to move them bckwards. Continuos sending of pulses from the
same input have no effect.

Magnetic latching relays might have either single or dual coils. On a single coil device, the relay
will work in one direction when power is applied with one polarity, and will reset when the
polarity is changed in opposite direction. On a dual coil device, when polarized voltage is put on
to the reset coil the contacts will change. AC controlled magnetic latch relays have single coils
that employ steering diodes to differentiate between operate and reset commands.

The Arduino Relay module allows a varied range of microcontroller such as Arduino, AVR ,PIC,
ARM with digital outputs to command larger loads and devices such as AC or DC Motors,
electromagnets, solenoids, and light bulbs. This module is designed to be interfaced with 2
relays that is able to control 2 relays. The relay output state is individually indicated by a light-
emitting diode.

2 channel relay features:


Number of Relays: 2 Control signal: TTL level
Rated load: 7A/240VAC 10A/125VAC 10A/28VDC 15
Types:-

Coaxial relay

The places where radio transmitters and receivers share one common antenna, usually a coaxial relay is
used as a TR (transmit-receive) relay, which constantly switches the antenna from the receiver to the
transmitter. This safeguards the receiver from the high power of the transmitter. Such relays are usually
used in transceivers which join transmitter and receiver in one single unit. The relay contacts are made
not to reflect any radio frequency power backwards to the source, and to give very high isolation
between receiver and transmitter terminal units. The characteristic impedance of the relay is made sure
to match the transmission line impedance of the system.

Contactor relay

A contactor is a heavy-duty effective relay usually with higher current ratings, used for switching
electric motors and lighting loads. Constant current ratings for common contactors range between 10
amps to few hundred amps. High-current contacts are made with alloys having silver. The unavoidable
arcing effects the contacts to oxidize; But, silver oxide is still a good conductor. Contactors with
overload protection devices are usually employed to start motors.

Force-guided contacts relay

A 'force-guided contacts relay' has relay contacts that are mechanically combined together, so that when
the relay coil is energized/de-energized, all of the joined contacts move together. If one set of contacts in
the relay becomes immovable, no other contact of the same relay will be able to move too. The function
of force-guided contacts is to allow the safety circuit to check the status of the relay. Force-guided
contacts are called as "positive-guided contacts", "captive contacts", "locked contacts", "mechanically
linked contacts", or "safety relays".

16
Overload protection relay

Electric motors need overcurrent protection to stop damage from over-loading the motor, or to defend
against short circuits in connecting cables or internal faults in the motor windings. The overload sensing
setup are a form of heat operated relay in which a coil heats a bimetallic strip, or where a solder pot
melts, dispensing a spring to operate auxiliary
contacts. These auxiliary contacts are in series with the coil. If the overload sees excess current in the
load, the coil gets de-energized.

This thermal protection works relatively slowly allowing the motor to get higher starting currents
before the protection relay will trip. Where the overload relay is exposed to the same ambient
temperature as the motor, a needful though crude compensation for motor ambient temperature is
provided.

The other common overload protection system employ an electromagnet coil in series with the motor
circuit that directly operates contacts. This is synonimous to a control relay but need a rather high fault
current to operate the contacts. To stop short over current spikes from causing nuisance triggering the
armature movement is damped with a dashpot. The thermal and magnetic overload detections are
typically used together in a motor protection relay.

Electronic overload protection relays calculates motor current and can know motor winding temperature
by a "thermal model" of the motor armature system that can be set to give more accurate motor
protection.

Solid-state relay

A solid-state relay (SSR) is a solid state electronic device that gives a function similar to an
electromechanical relay but does not have any moving components, increasing long-term effectiveness.
A solid-state relay uses a thyristor, TRIAC or other solid-state switching device, activated by the control
signal, to change the controlled load, instead of a solenoid.
An optocoupler (a light-emitting diode (LED) coupled with a photo transistor) can be used to isolate
controllable circuit.
17
Pole and throw

Since relays are electrically functional switches, the terms applied to switches is also applied to relays;
a relay switches one or more poles, each of whose contacts can be switched on by energizing the coil.

Normally open (NO) contacts connect with the circuit when the relay is activated; the circuit is
disjointed when the relay is inactive. Normally closed (NC) contacts disconnect the circuit when the
relay is switched on; the circuit is connected when the relay is inactive. All of the contact forms have
combinations of NO and NC connections.

SPST-NO (Single-Pole Single-Throw, Normally-Open) relay has a single Form A contact


or make contact. These have two terminals which can be joined or disjoint including two for the coil,
such a relay has four terminals in sum in total.
SPST-NC (Single-Pole Single-Throw, Normally-Closed) relays have a single Form
B or break contact. As with an SPST-NO relay, such a relay has four terminals in total.

SPDT (Single-Pole Double-Throw) relay has a single set of Form C, break before
make or transfer contacts. That is, a general terminal connects to either of two others, never connecting
to both at the same time. Including two for the coil, such a relay has a total sum of five terminals.

DPST – Double-Pole Single-Throw relays are similar to a pair of SPST switches or relays actuated by a
single coil. Including two for the coil, this relay has a total of six terminals. The poles might be Form A
or Form B (or one of each; the designations NO and NCshould be used to resolve the ambiguousness).

DPDT – Double-Pole Double-Throw relays has two sets of Form C contacts. These are similar to two
SPDT switches or relays actuated by a single coil.

18
APPLICATIONS OF RELAY:-

Relays are used wherever it is necessary to command a high power or high voltage circuit with a low
power circuit, essentially when galvanic isolation is desired. The first application of relays was in long
telegraph lines, where the weak signal got at an intermediate station could control a contact,
regenerating the signal for re- transmission. High-voltage or high-current devices can be commanded
with small, low voltage wiring and pilots switches. Operators can be excluded from the high voltage
circuit. Low power devices such as microprocessors can drive relays to command electrical loads
beyond their direct drive capability.

Due to relays being more resistant than semiconductors to nuclear radiation, they are greatly used in
safety-critical logic, such as the control panels of radioactive waste-handling machinery.
Electromechanical protective relays are employed to detect overload and other faults on electrical lines
by opening and closing circuit breakers.

FIG 2- H125S TWO CHANNEL RELAY

19
BLUETOOTH MODULE (HC05 )

HC-05 Specification:
1. Bluetooth protocal: Bluetooth Specification v2.0+EDR Frequency: 2.4GHz ISM band
2. Modulation: GFSK(Gaussian Frequency Shift Keying) Emission power: ≤4dBm, Class 2
3. Sensitivity: ≤-84dBm at 0.1% BER
4. Speed: Asynchronous: 2.1Mbps(Max) / 160 kbps, Synchronous: 1Mbps/1Mbps Security:
Authentication and encryption
5. Profiles: Bluetooth serial port Power supply: +3.3VDC 50mA
6. Working temperature: -20 ~ +75Centigrade Dimension: 26.9mm x 13mm x 2.2

Overview
HC‐05 module is an efficient and easy to use Bluetooth SPP (Serial Port Protocol) module,aimed for
transparent wireless serial connection setup.The HC-05 Bluetooth Module can be used in a Master or
Slave configuration, making it to be a great solution for wireless communication.This serial port
bluetooth module is fully functioned to perform Bluetooth V2.0+EDR (Enhanced Data Rate)3Mbps
Modulation with whole 2.4GHz radio transceiver and baseband. It employs CSR Bluecore 04‐ External
single chip Rluetooth system with CMOS technology and AFH (Adaptive Frequency Hopping Feature).

Bluetooth Module HC-05


Bluetooth module HC05 is a MASTER/SLAVE module. the factory setting is SLAVE.
The function of the module (Master or Slave) can be configured only by AT COMMANDS.The slave
modules cannot start a connection to another Bluetooth device, but can take in connections.Master
module can start a connection to other devices.The user can use it generally for a serial port replacement
to lay a connection between MCU and GPS, PC to your project.

20
FIG 3:BLUETOOTH MODULE

Pin Description:-
The HC-05 Bluetooth Module has 6pins. They are as follows:
ENABLE:
When enable is put on LOW, the module is disabled meaning, the module will not turn on and it fails to
communicate with the module.When enable is left open or connected to 3.3V, the module is enabled i.e
the module remains on and communication also takes place continuosly.
Vcc:
Supply Voltage 3.3V to 5V
GND:
Ground pin
TXD & RXD:
These two pins works as an UART interface for communication
STATE:
It acts as a status indicator unit.When the module is not connected or paired with any other bluetooth
device,The signal automatically goes Low.At this low state,the led flashes continuously which shows
that the module is not connected with other device.When this module is connected to/paired with other
bluetooth device,the signal goes High.At this high state,the led blinks with a constantantly with some
delay say for example 2s delay

21
BUTTON SWITCH:
This is needed to switch the module into AT command mode.To allow AT command mode,press the
button switch for a bit of time.With the help of AT commands,the user can alter the parameters of this
module

FIG 4:PIN DESCRIPTION OF BLUETOOTH MODULE

Wifi module:

The ESP8266 WiFi Module is a self sustained SOC with combined TCP/IP protocol stack that can give
any microcontroller allowance to your WiFi network. The ESP8266 is worthy of either hosting an
application or offloading all WiFi networking functionalities from other application processor.
Each ESP8266 module is already pre-programmed with an AT command set firmware, which means
that, you can simply attach this up to your Arduino device and get about as much WiFi-ability like a
WiFi Shield The ESP8266 module is an extremely cost effective board.

FIG 5:-ESP8266 WIFI MODULE


22
FIG 6:-ESP8266 WIFI MODULE PIN DIAGRAM

LIST OF AT COMMANDS USED FOR ESP8266

Commands Description Set/Execute Parameters


restart the
AT+RST module – –
1= Sta, 2= AP,
AT+CWMODE wifi mode AT+CWMODE=<mode> 3=both
ssid = ssid, pwd =
AT+CWJAP join the AP AT+ CWJAP =<ssid>,<pwd> wifi password
AT+CWLAP list the AP AT+CWLAP
AT+CWQAP quit the AP AT+CWQAP
set the ssid, pwd, chl =
parameters of channel, ecn =
AT+ CWSAP AP AT+ CWSAP= <ssid>,<pwd>,<chl>, <ecn> encryption
get the
AT+ connection
CIPSTATUS status AT+ CIPSTATUS
set up TCP or 1)single connection (+CIPMUX=0) id = 0-4, type =
AT+CIPSTART UDP AT+CIPSTART= <type>,<addr>,<port>; 2) TCP/UDP, addr =
23
Commands Description Set/Execute Parameters
connection multiple connection (+CIPMUX=1) IP address, port=
AT+CIPSTART= <id><type>,<addr>, <port> port
1)single connection(+CIPMUX=0)
AT+CIPSEND=<length>; 2) multiple
connection (+CIPMUX=1) AT+CIPSEND=
AT+CIPSEND send data <id>,<length>
close TCP or
UDP
AT+CIPCLOSE connection AT+CIPCLOSE=<id> or AT+CIPCLOSE
AT+CIFSR Get IP address AT+CIFSR
0 for single
set mutiple connection 1 for
AT+ CIPMUX connection AT+ CIPMUX=<mode> mutiple connection

TABLE 1:-ESP8266 WIFI MODULE AT COMMANDS SHEET

24
CHAPTER 6 DESIGN BLOCK DIAGRAM

FIG 7:PIN BLOCK DIAGRAM OF DESIGN PROJECT

25
CHAPTER 7 DESIGN PROJECT COMBINED MODULE

FIG 8: DESIGN PROJECT COMBINED MODULE

FIG 9: DESIGN PROJECT COMBINED MODULE

26
CHAPTER 8 PROGRAMMING LOGIC DEVELOPED AND CODE
FOR THE PROJECT

#include<SoftwareSerial.h>
SoftwareSerial bluetooth(12,13);
SoftwareSerial esp(3,4);
#define SSID "Redmi Note 8 Pro"
#define PASS "qwertyuiop"
int a,b;
String sendAT(String command, const int timeout){
String response = "";
esp.print(command);
long int current_time = millis();
while(millis()-current_time < timeout){
while(esp.available()){
char c = esp.read();
response += c;
}

}
Serial.print(response);
return response;
}

void setup() {
// put your setup code here, to run once:
bluetooth.begin(9600);
Serial.begin(9600);
esp.begin(9600);

sendAT("AT\r\n",1000);
sendAT("AT+CWMODE=1\r\n",1000);
sendAT("AT+CWJAP=\""SSID"\",\""PASS"\"\r\n",2000);
27
while(!esp.find("OK")){

}
sendAT("AT+CIFSR\r\n",1000);
sendAT("AT+CIPMUX=0\r\n",1000);

pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
Serial.println("trying to control electrical devices with Bluetooth");
}
Void loop() {
// put your main code here, to run repeatedly:
bluetooth.listen();
if(bluetooth.available()){
char bt=bluetooth.read();
switch (bt){
case 'A':
digitalWrite(9,LOW);
a=0;
break;
case 'a':
digitalWrite(9,HIGH);
a=1;
break;
case 'B':
digitalWrite(8,LOW);
b=0;
break;
case 'b':
digitalWrite(8,HIGH);
b=1;
break;
}
String A = String(a);
String B = String(b);
updateTS(A,B);
28
}
}

void updateTS(String A, String B)


{
esp.listen();
Serial.println("");
sendAT("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",80\r\n",1000);
Stringcmd="GET/update?key=9HMSVN83R0RKYSF2&field1="+A+"&field2="+B+"\r\n";
String cmdlen = String(cmd.length());
sendAT("AT+CIPSEND="+cmdlen+"\r\n",2000);
esp.print(cmd);
Serial.println("");
sendAT("AT+CIPCLOSE\r\n",2000);
Serial.println("");
}

29
REFERENCES

1. Mamata Khatu, Neethu Kaimal, Pratik Jadhav and Syedali Adnan “Implementation of
Internet of Things for Home Automation”, International Journal of Emerging Engineering
Research and Technology , Volume 3, Issue 2, February 2015 .

2. Wireless Sensor Networks: Concepts, Applications, Experimentation and Analysis. 2016.


p. 108. ISBN 9811004129. The use of standardized, with open standards over proprietary
protocols provides the industry with the freedom to choose between suppliers with guaranteed
interoperability. Standardized solutions usually have a much longer lifespan than proprietary
solutions.

3. B.Murali Krishna, V.Narasimha Nayak, K.Ravi Kishore Reddy, B.Rakesh, P.Manoj


Kumar and N.Sandhya “Bluetooth based Wireless home automation system using FPGA” ,
Journal of Theoretical and Applied Information Technology,31st July 2015,Vol-77 No.3.

30
APPENDIX-A

Here are some pictures of Diary maintained during training period.

31
32
33
34
PLAGIARISM REPORT

CONSENT REPORT FROM FACULTY MENTOR

All the asked suggestions have been duly followed and implemented.

35

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy