Report On Home Monitoring System Using IoT

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

Home Monitoring System using IOT

PROJECT REPORT
OF PROJECT-I (EC-707)

BACHELOR OF TECHNOLOGY
Electronics and Communication Engineering
SUBMITTED BY

Ajij Mohammad (18bt010402)

Ashish Thakur (18bt010416)

Diksha Thakur (18bt010419)

Tushar Parmar (18bt010457)

SUPERVISOR

Er. Aditi Mahajan

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING, J.N.G.EC, SUNDERNAGAR, MANDI (H.P.)
PIN-175018

Department of Electronics & Communication Engineering


Jawaharlal Nehru Govt. Engineering College
Sundernagar -175018 (HP), INDIA

1|Page
CERTIFICATE

We hereby certify that the work which is being presented in the B.Tech. Project entitled “Home
Monitoring System using IoT”, in partial fulfilment of the award of the Bachelor of
Technology in Electronics & Communication Engineering and submitted to the Department
of Electronics & Communication Engineering of Jawaharlal Nehru Govt. Engineering College,
Sundernagar, HP, is an authentic record of our own work carried out during a period from
October,2021 to January,2022 under the supervision of Er. Aditi Mahajan , Assistant
Professor, E&CE Department.

The matter presented in this project has not been submitted by us for the award of any other
degree elsewhere.

Signature of Candidates

Ajij Mohammad (18bt010402)

Ashish Thakur (18bt010416)

Diksha Thakur (18bt010419)

Tushar Parmar (18bt010457)

This is to certify that the above statement made by the candidate is correct to the best of my
knowledge.
Signature of Project Guide
Date: Er. Aditi Mahajan
Assistant Professor
Department of E&CE

Signature of Signature of Project Coordinator


Prof. Himanshu Monga Dr. Vicky Kumar
Head/OIC of the Department Assistant Professor
Department of E&CE Department of E&CE
JNGEC, Sundernagar

2|Page
ACKNOWLEDGEMENT

We express sincere gratitude to our guide Er. Aditi Mahajan Department of Electronics &
communication engineering at JNGEC College Sundernagar, for their valuable guidance,
proper advice and constant encouragement during the course.

We are deeply indebted to our parents for their inspiration and ever encouraging moral support,
which enabled us to pursue our studies. We are also thankful to the entire faculty and staff
members of Electronics & Communication Engineering Department for their direct–indirect
help and cooperation.

3|Page
TABLE INDEX

CONTENTS PAGE NO.

Abstract 6

Motivation 7

CHAPTER 1-Introduction 8

CHAPTER 2- Literature View Simulation 9-11

2.1 IOT 9
2.2 Smart Home Security 9
2.3 Cameras And Monitoring 9
2.4 Home Automation Protocols 10-11

CHAPTER 3-Existing Systems 12-14

CHAPTER 4- Components Required 15-18

4.1 Hardware Components 15-17


4.1.1 Arduino Uno 15
4.1.2 PIR Sensor 16
4.1.3 ESP32-CAM 16-17
4.1.4 TTL Programmer 17
4.2 Software Required 18
4.2.1 Arduino IDE 18
4.2.2 Language 18

4|Page
CHAPTER 5- Project Methodology 19-20

5.1 The Planning Stage 19

5.2 Problem Statement 19

5.3 Objective of The Proposal 19-20

CHAPTER 6 – Implementation and Output 21-32

ADVANTAGES 33

DISADVANTAGES 34

CONCLUSION 35

REFERENCES 36

5|Page
ABSTRACT

The system is about remotely managed Door monitoring and SMS alerting through
Smart Phone and receiving captured images of visitors at Door as Email alert. The
design and development of a home security system, based on human motion detection
and remotely monitoring technology, to confirm visitors. A PIR motion sensor and
Camera module are used to detect motion and capture images respectively to make the
security system alive as someone visits home. When visitor motion is detected at Door,
the Camera module interfaced to Arduino Uno captures images, saves it on system and
sends it as email alert via TCP/IP. The concerned authority can control the system and
view images of the camera module through Smart mobile Phone.

6|Page
MOTIVATION

Home surveillance is a major concern in this day and age as with the rapid increase in the
technology around us. There is a need to get updated with new possibilities to make our lives
better and easy.

Some cases and situations exhibit the need for home monitoring. So, we set out to discover a
solution to this problem of home monitoring. Through this we can not only find solution to a
problem with kids and pet’s security at home but also a chance of burglary and stranger’s
unusual activities.

To overcome this problem, we are designing and prototyping a system to keep an eye on people
visiting home in owner’s presence and in absence too. This system is used in other applications
like theft monitoring. The device can monitor the field all the time. In this way, this system
helps in home monitoring. The system consists of Arduino, which is the brain of the system,
the PIR sensor, ESP32-CAM, and buzzer. The PIR sensor detects motion then gives input to
the Arduino. Arduino gives output to the ESP32-CAM and buzzer. The ESP32-CAM can be
activated and sends information to the user through web Interface and the application. The user
can see the video streaming on the PC screen or any other display. The buzzer can emit a high-
volume signal indicating that “there is an alert at the home”.

Keywords: Arduino, Application, ESP32-CAM, PIR sensor, Web Interface.

7|Page
CHAPTER 1

INTRODUCTION

In recent years, many thinks are happened in our daily life related to home security like robbery,
unwanted entrance happened, stealing. So, security issues have grown so dramatically that need
to control and secure residential and commercial area. The concept of home automation has
been around since the late 1970s. But with the time people’s expectations have changed a lot
to the simple house into smart. They want smart home to do many services automatically. So,
then this idea become a home automation system. The system is about remotely managed Door
monitoring and SMS alerting through Smart Phone and receiving captured images of visitors
at Door as Email alert. The design and development of a home security system, based on human
motion detection and remotely monitoring technology, to confirm visitors. A PIR motion
sensor and Camera module are used to detect motion and capture images respectively to make
the security system alive as someone visits home. When visitor motion is detected at Door, the
Camera module interfaced to Arduino Uno captures images, saves it on system and sends it as
email alert via TCP/IP. The concerned authority can control the system and view images of the
camera module through Smart mobile Phone.

8|Page
CHAPTER 2

LITERATURE SURVEY

A. IOT
IoT has had a significant impact on home security in 2016 more than ever. According to Google
Trends, at its peak, over 75% more people searched for ‘smart home’ in 2016 than
comparatively in 2015 worldwide.

IoT for home innovation and security allows people to control their locks, lights, radios, heating
and camera security all from their phone, so you can monitor how safe your house is from just
about anywhere in the world. And there are some key devices that have impacted the rise in
awareness of, and desire to have, a smart home in 2016.

B. Smart Home Security

Smart home security has been key to people making their homes smarter, with over 90% of
consumers saying that security is one of the top reasons to purchase a smart home system.

Smart locks have surged in popularity in 2016, with innovative solutions where you can access
your house via a pin should you ever forget your keys, or unlocking your door using your
phone, which also provides a live record of when the door has been locked or unlocked.

C. Cameras and Monitoring

Manything revolutionised the smart security space in 2015 with the launch of its, still in beta,
Manything 4 app, which turns old unused smartphones and tablets into sophisticated video
monitoring cameras. The app itself is free and comes with live streaming and motion detection
for one camera free of charge. For cloud storage, and multiple cameras, paid subscriptions are
required. Manythings can also integrate with If This Then That (IFTTT), a service that triggers
an email or text alert when a specified event occurs.

9|Page
At the end of 2015, iSmartAlarm team announced their newest development – Spot. Spot
introduced innovative features such as sound recognition (the ability to notify users when
carbon monoxide and smoke alarm sirens are detected) and time-lapse custom videos. With the
ability to set up in 3 minutes and an affordable price tag, this clever device, with wall mounting
and twistable, turnable, expandable legs, can capture any angle of a home and made full home
monitoring a practical reality.

According to Business Insider, the number of smart home devices shipped is expected to grow
from 193 million in 2020 to 250 million in 2025.

D. Home Automation Protocols

One of the most important parts of building a home automation product is to think about
protocols, protocols that your device would use to communicate to gateways, servers, and
sensors. A few years ago, the only way to do so was by either using Bluetooth, wifi or GSM.
But due to added expenses on cellular sim cards, and low performance of Wifi, most such
solutions didn’t work.

A few years ago, the only way to do so was by either using Bluetooth, wifi or GSM. But due
to added expenses on cellular sim cards, and low performance of Wifi, most such solutions
didn’t work.

Bluetooth survived and later evolved as Bluetooth Smart or Bluetooth low energy. This helped
bring a lot of connectivity in the “mobile server powered economy”, in this essentially your
phone would act as a middleware to fetch data from BLE powered sensors and sent it over to
the internet.

When looking at the major home automation protocols, the following tops the list:

• Bluetooth low energy or Bluetooth Smart: Wireless protocol with mesh capabilities,
security, data encryption algorithms and much more. Ideal for IoT-based products for
smart homes.

10 | P a g e
• Zigbee: Low cost, mesh networked and low power radio frequency-based protocol for
IoT. Different Zigbee versions don’t talk to each other.
• X10: A legacy protocol that utilizes powerline wiring for signalling and control
• Insteon: Communicates with devices both wirelessly and with wires
• Z-wave: Specializes in home automation with an emphasis on security
• WIFI: Needs no explanation
• UPB: Uses existing power lines installed in a home, reduces costs
• Thread: A royalty-free protocol for smart home automation, uses a 6lowpan
• ANT: An ultra-low power protocol helping developers build low-powered sensors with
a mesh distribution capability.
• 6lowpan

11 | P a g e
CHAPTER 3

EXISTING SYSTEMS

A. Intelligent acoustic and vibration recognition/alert

Systems for security breaching detection, close proximity danger identification, and perimeter
protection. Growing focus on the perimeter security of national properties, both at home and
abroad, has facilitated the development of technologies capable of detecting possible threats,
such as people or vehicles approaching them. One area of interest is the integration of many
different sensors, each with its own distinct modalities and detection ranges, to create a flexible
and robust device. They propose a device based on three security sensors that have been
demonstrated to provide security threat detection and classification. These sensors namely are
acoustic, seismic, and vibration sensors. For the detection and reporting of sequential
approaching incidents, such as an approaching vehicle with passengers wishing to breach a
fenced facility, the ’Smart Fence’ device based on these sensors will be particularly suitable.

B. e-KTP as the basis of home security system using Arduino UNO

During the construction of the intruder detection system, there were several systems we
encountered. The Arduino UnoR3, ESP8266 NodeMcu Wi-Fi module, alarm, Red Light
Emitting Diode (LED) and PIR Sensor are used in the’ Arduino-based Wireless Motion
Detecting System. To build this device framework, Android Studio 3.1 software was used. The
programming language used in the device application was Java. The transmission of data to
the consumer is parallel with the used alarm device. If the alarm device senses movements,
applications which have been imported to users’ smartphones may cause an alarm. A server-
based approach is used by the system so that the user is bound to the Internet. The Arduino
Uno microcontroller is used as a doormat in a door-based digital home protection system in the
’e-KTP as the basis of the home security system using Arduino Uno.

12 | P a g e
C. IoT based Intruder Detection System Using GSM

The Internet of Things (IoT) is a network of interconnected objects that can interact and share
data. The combination of software and hardware developments has allowed the development
of systems that can run remotely without the need for human interaction. Theft and burglaries
are rising at an exponential pace all over the world. Various news outlets have written on such
events, which occur while the house’s occupants are not present. Intruders will often break in
even though the occupants are present. This is a dilemma that everybody has to contend with.
The available systems are either too costly or too proprietary for a consumer to afford, or they
are forced to be loyal to a single vendor, restricting their options and preventing them from
investing in the necessary security infrastructure. The paper proposes a low-cost, scalable and
low-maintenance intruder detection system to solve these issues. The proposed device would
not act like any of the currently available protective devices, which do not warn the consumer
when an intrusion occurs.

D. Home security system using internet of things

The Internet of Things (IoT) is a network of interconnected physical objects that can interact
and exchange data without needing human interference. Since IoT permits the US to gather
info from every kind of medium, like humans, animals, vehicles, and room appliances, it’s been
formally outlined as a “Infrastructure of data Society.” By embedding electronic hardware like
sensors, software, and networking gear into any entity within the physical world which will be
a science address to permit information transmission over a network, it will become a vicinity
of the IoT framework. IoT is distinct from the Internet in that it goes beyond Internet access by
allowing ordinary artefacts with embedded circuits to interact and communicate with one
another using existing Internet infrastructure.

E. Theft Detection System using PIR Sensor

13 | P a g e
The world has changed drastically as a result of technological advances. Because in the rapid
advancement of technology, the next century would be more comfortable. The Internet of
Things (IoT) is a new technology that is gaining traction in the real world. This technology has
a promising future in making the whole system smart. The development was the smart
surveillance system. There were lots of inventions developed in the field of IoT and the most
recognized one was the smart surveillance system development. There were lots of
advancements in wireless technologies such as domain, cloud and many other technologies
which were included in the system to show something new.

F. IoT based Smart Home Surveillance and Automation

Since monitoring and surveillance 24 hours a day, seven days a week is difficult to manage
manually, protection at living species has become important for current lifestyles. One of the
best options is to use the latest technologies in IoT applications. We can get information about
security risks, damage warnings and danger alerts, as well as additional controls over home
appliances for comfort, automation and home surveillance by using IoT.

14 | P a g e
CHAPTER 4

COMPONENTS REQUIRED

4.1 Hardware Required

4.1.1 Arduino uno

Arduino/Genuino Uno is a
microcontroller board based on the
ATmega328P (datasheet). It has 14
digital input/output pins (of which 6
can be used as PWM outputs), 6 analog
inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP
header and a reset button. It contains
everything needed to support the microcontroller; simply connect it to a computer with a USB
cable or power it with a AC-to-DC adapter or battery to get started. You can tinker with your
UNO without worrying too much about doing something wrong, worst case scenario you can
replace the chip for a few dollars and start over again.

"Uno" means one in Italian and was chosen to mark the release of Arduino Software (IDE)
1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of
Arduino, now evolved to newer releases. The Uno board is the first in a series of USB Arduino
boards, and the reference model for the Arduino platform; for an extensive list of current, past
or outdated boards see the Arduino index of boards.

15 | P a g e
4.1.2 PIR sensor

A passive infrared sensor is an electronic sensor that


measures infrared light radiating from objects. PIR
sensors mostly used in PIR-based motion detectors. Also,
it used in security alarms and automatic lighting
applications. The below image shows a typical pin
configuration of the PIR sensor, which is quite simple to
understand the pinouts. The PIR sensor consist of 3 pins,

• Pin1 corresponds to the drain terminal of the


device, which connected to the positive supply 5V DC.
• Pin2 corresponds to the source terminal of the device, which connects to the ground
terminal via a 100K or 47K resistor. The Pin2 is the output pin of the sensor.
• The pin 2 of the sensor carries the detected IR signal to an amplifier from the Pin3 of
the sensor connected to the ground.

4.1.3 ESP32-CAM

The ESP32-CAM is a full-featured


microcontroller that also has an integrated
video camera and microSD card socket. It’s
inexpensive and easy to use, and is perfect
for IoT devices requiring a camera with
advanced functions like image tracking and
recognition.

The ESP32-CAM module has fewer I/O pins


than the previous ESP-32 module we looked
at. Many of the GPIO pins are used internally
for the camera and the microSD card port.

Another thing missing from the ESP32-CAM module is a USB port. In order to program this
device, you’ll need to make use of an FTDI adapter. This will be described further on in this
article.

16 | P a g e
Here is the pinout of the ESP32-CAM Module:

4.1.4 TTL Programmer

Most laptops and desktops no longer


have serial ports, but many development
boards require a serial port for debugging,
console interface, or even software
download. The serial ports on development
boards usually provide “logic level” signals
rather than RS-232 serial port signals.

This means that there’s no easy way to


connect a development board to a laptop. The
USB to TTL converter solves this problem by providing a serial port connection between a
host computer and a development board, with the correct interfaces and signal levels for each.
Details below.

A TTL Signal is a kind of hardware interface standard based on the electrical properties of TTL
(Transistor-Transistor Logic).

For a TTL input this means that anything below 0.8 volts is a “zero” and anything above 2.4
volts is a “one,” and that it presents a load of less than 1.6ma to the driving circuit.

A TTL output can typically drive ten TTL inputs, and still maintain the correct voltage levels
for “zero” and “one.”

17 | P a g e
4.2 Software Required

4.2.1 Arduino IDE

Arduino IDE is an open-source software, designed by Arduino.cc and mainly


used for writing, compiling & uploading code to almost all Arduino Modules.

It is an official Arduino software, making code compilation too easy that even
a common person with no prior technical knowledge can get their feet wet with the
learning process. It is available for all operating systems i.e., MAC, Windows, Linux
and runs on the Java Platform that comes with inbuilt functions and commands that
play a vital role in debugging, editing and compiling the code.

A range of Arduino modules available including Arduino Uno, Arduino Mega,


Arduino Leonardo, Arduino Micro and many more. Each of them contains a
microcontroller on the board that is actually programmed and accepts the information
in the form of code. The main code, also known as a sketch, created on the IDE platform
will ultimately generate a Hex File which is then transferred and uploaded in the
controller on the board.

The IDE environment mainly contains two basic parts: Editor and Compiler
where former is used for writing the required code and later is used for compiling and
uploading the code into the given Arduino Module. This environment supports both C
and C++ languages.

4.2.2 Language

The programming language used in this project is embedded C. It is general purpose


programming language we are using for Arduino for programming. The main steps
involved in software implementation of Arduino are: Verify, Upload, New, Open, Save
and Serial.

Coding is the crucial part of this project. The first part is a code for ESP32-CAM. This
code requires to insert network credentials to make the connection between the system
and the network. Creating an IP address is necessarily for the program to run.

18 | P a g e
CHAPTER 5

PROJECT METHODOLOGY

5.1 The Planning Stage

During the planning phase, we identified the steps necessary for us to accomplish the
objectives of the current study. At this initial stage, we ensured that both the strategic and
technical plans were properly formulated. This would ensure that the other phases of the
proposed methodology were properly carried out in an organized and standard manner.

5.1 Problem Statement

The problem that we consider here is to provide an application-based IoT system for
the users by installing the application, the users can have access to his/her home. They should
be able to watch who visits home in presence and absence both.

5.2 Objectives of the proposal


The objective of our project is to develop the safety monitoring system to keep an eye
on kids, pets and stranger activities in the house. The system should be able to detect the
unusual movement. The users must be able to watch the surveillance through user-interface
(application, web-interface). We assume that the system should consists of following elements
such as Arduino, buzzer, ESP 32, web cameras and web interface

PIR sensor and camera provide information to the Arduino. Through the
web interface, the Arduino communicates with the users, which can monitor their homes 24/7.
We adopt the following principles to our system:

• It monitors a field for a movement.


• If there is any unusual movement, it activates a camera and alarms the user.

19 | P a g e
• Web interface facilitates the communication between the users and the system.
• The system monitors the house 24/7.

Block diagram of home monitoring system

20 | P a g e
CHAPTER 6

IMPLEMENTATION AND OUTPUT

6.1 Circuit Diagram is as shown below:

21 | P a g e
6.2 Start the Arduino IDE and select the correct COM-port.

6.3 Select the ESP32 Wrover Module board:

22 | P a g e
6.4 use the following settings:

6.5 Upload the code to the ESP32 with icon

// ESP32 Cam Motion Alert | Send Image to Telegram

// Enter your WiFi ssid and password

const char* ssid = "---------"; //WIFI SSID

const char* password = "---------"; //WIFI password

String token = "-----------------------------";

String chat_id = "-------";

#include <WiFi.h>

#include <WiFiClientSecure.h>

#include "soc/soc.h"

23 | P a g e
#include "soc/rtc_cntl_reg.h"

#include "esp_camera.h"

//CAMERA_MODEL_AI_THINKER

#define PWDN_GPIO_NUM 32

#define RESET_GPIO_NUM -1

#define XCLK_GPIO_NUM 0

#define SIOD_GPIO_NUM 26

#define SIOC_GPIO_NUM 27

#define Y9_GPIO_NUM 35

#define Y8_GPIO_NUM 34

#define Y7_GPIO_NUM 39

#define Y6_GPIO_NUM 36

#define Y5_GPIO_NUM 21

#define Y4_GPIO_NUM 19

#define Y3_GPIO_NUM 18

#define Y2_GPIO_NUM 5

#define VSYNC_GPIO_NUM 25

#define HREF_GPIO_NUM 23

#define PCLK_GPIO_NUM 22

int gpioPIR = 13; //PIR Motion Sensor

void setup()

WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);

24 | P a g e
Serial.begin(115200);

delay(10);

WiFi.mode(WIFI_STA);

Serial.println("");

Serial.print("Connecting to ");

Serial.println(ssid);

WiFi.begin(ssid, password);

long int StartTime=millis();

while (WiFi.status() != WL_CONNECTED)

delay(500);

if ((StartTime+10000) < millis()) break;

Serial.println("");

Serial.println("STAIP address: ");

Serial.println(WiFi.localIP());

Serial.println("");

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

Serial.println("Reset");

ledcAttachPin(4, 3);

ledcSetup(3, 5000, 8);

ledcWrite(3,10);

delay(200);

25 | P a g e
ledcWrite(3,0);

delay(200);

ledcDetachPin(3);

delay(1000);

ESP.restart();

else

ledcAttachPin(4, 3);

ledcSetup(3, 5000, 8);

for (int i=0;i<5;i++) {

ledcWrite(3,10);

delay(200);

ledcWrite(3,0);

delay(200);

ledcDetachPin(3);

camera_config_t config;

config.ledc_channel = LEDC_CHANNEL_0;

config.ledc_timer = LEDC_TIMER_0;

config.pin_d0 = Y2_GPIO_NUM;

config.pin_d1 = Y3_GPIO_NUM;

26 | P a g e
config.pin_d2 = Y4_GPIO_NUM;

config.pin_d3 = Y5_GPIO_NUM;

config.pin_d4 = Y6_GPIO_NUM;

config.pin_d5 = Y7_GPIO_NUM;

config.pin_d6 = Y8_GPIO_NUM;

config.pin_d7 = Y9_GPIO_NUM;

config.pin_xclk = XCLK_GPIO_NUM;

config.pin_pclk = PCLK_GPIO_NUM;

config.pin_vsync = VSYNC_GPIO_NUM;

config.pin_href = HREF_GPIO_NUM;

config.pin_sscb_sda = SIOD_GPIO_NUM;

config.pin_sscb_scl = SIOC_GPIO_NUM;

config.pin_pwdn = PWDN_GPIO_NUM;

config.pin_reset = RESET_GPIO_NUM;

config.xclk_freq_hz = 20000000;

config.pixel_format = PIXFORMAT_JPEG;

if(psramFound())

config.frame_size = FRAMESIZE_VGA;

config.jpeg_quality = 10; //0-63 lower number means higher quality

config.fb_count = 2;

else

27 | P a g e
{

config.frame_size = FRAMESIZE_QQVGA;

config.jpeg_quality = 12; //0-63 lower number means higher quality

config.fb_count = 1;

// camera init

esp_err_t err = esp_camera_init(&config);

if (err != ESP_OK)

Serial.printf("Camera init failed with error 0x%x", err);

delay(1000);

ESP.restart();

sensor_t * s = esp_camera_sensor_get();

s->set_framesize(s, FRAMESIZE_XGA);

void loop()

pinMode(gpioPIR, INPUT_PULLUP);

int v = digitalRead(gpioPIR);

Serial.println(v);

if (v==1)

28 | P a g e
alerts2Telegram(token, chat_id);

delay(10000);

delay(1000);

String alerts2Telegram(String token, String chat_id)

const char* myDomain = "api.telegram.org";

String getAll="", getBody = "";

camera_fb_t * fb = NULL;

fb = esp_camera_fb_get();

if(!fb)

Serial.println("Camera capture failed");

delay(1000);

ESP.restart();

return "Camera capture failed";

WiFiClientSecure client_tcp;

if (client_tcp.connect(myDomain, 443))

Serial.println("Connected to " + String(myDomain));

29 | P a g e
String head = "--India\r\nContent-Disposition: form-data; name=\"chat_id\"; \r\n\r\n" +
chat_id + "\r\n--India\r\nContent-Disposition: form-data; name=\"photo\"; filename=\"esp32-
cam.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n";

String tail = "\r\n--India--\r\n";

uint16_t imageLen = fb->len;

uint16_t extraLen = head.length() + tail.length();

uint16_t totalLen = imageLen + extraLen;

client_tcp.println("POST /bot"+token+"/sendPhoto HTTP/1.1");

client_tcp.println("Host: " + String(myDomain));

client_tcp.println("Content-Length: " + String(totalLen));

client_tcp.println("Content-Type: multipart/form-data; boundary=India");

client_tcp.println();

client_tcp.print(head);

uint8_t *fbBuf = fb->buf;

size_t fbLen = fb->len;

for (size_t n=0;n<fbLen;n=n+1024)

if (n+1024<fbLen)

client_tcp.write(fbBuf, 1024);

fbBuf += 1024;

else if (fbLen%1024>0)

30 | P a g e
{

size_t remainder = fbLen%1024;

client_tcp.write(fbBuf, remainder);

client_tcp.print(tail);

esp_camera_fb_return(fb);

int waitTime = 10000; // timeout 10 seconds

long startTime = millis();

boolean state = false;

while ((startTime + waitTime) > millis())

Serial.print(".");

delay(100);

while (client_tcp.available())

char c = client_tcp.read();

if (c == '\n')

{ if (getAll.length()==0) state=true;

getAll = ""; }

else if (c != '\r')

getAll += String(c);

if (state==true) getBody += String(c);

31 | P a g e
startTime = millis();

if (getBody.length()>0) break;

client_tcp.stop();

Serial.println(getBody);

else {

getBody = "Connection to telegram failed.";

Serial.println("Connection to telegram failed.");

return getBody;

6.6 Output can be observed using serial monitor.

32 | P a g e
ADVANTAGES
• Monitoring the field all the time. This device can monitor the house 24/7 through the
sensors used in this project. The user also can be able to monitor through the web
interface.

• Web camera is enabled, if there is any motion to detect visitors.

• Web interface is developed through which the user can have access his/her home.

• Human Intervention in the field is reduced due to the continuous presence of active
sensors in the field.

• User can take the necessary action required in case of strangers entering if the user is
away from the house.

33 | P a g e
DISADVANTAGES

• To make this extended for larger areas as now it is limited to smaller areas and to make
the application much more effective.

• We can also make face recognition and detection to know the strangers who entered
the house so that we can change the alert conditions by recognition of the faces.

34 | P a g e
CONCLUSION

Our work mainly concentrates on the application aspects of the numerous intruder system and
also points out the various involvement of technologies used to make the intruder detection
system practical for real-life application. We summarized the various systems that utilizes low-
cost components while having potential for industry standard usage. We encourage researchers
to think about home automation as one of the most critical aspects of home protection and to
develop advanced sensing technologies to detect and secure homes from professional intruders.
When it comes to the proper implementation and production of automated home protection
systems, the most important factor is security. Such a device will give everyone in the house a
sense of security and will also put their minds at ease. Sensing the correct data is essential for
correct security breach detection. False detection is very important which gets ignored in many
theft detection systems. Today data science can be used to trace a lot of information about the
security environment. IOT plays a major role in theft detection and exchanging the data over
the cloud. As we progressed IOT architecture and sensors became more budget friendly. We
can use different types of sensors such as vibration sensing accelerometer, reed switches, PIR
sensors. Data analysis on these sensor’s data can achieve highly useful data even using simple
sensing. Hence, we recommend IOT and Data analysis on sensor’s data can bring the new
heights in theft detection systems.

35 | P a g e
REFERENCES

IFTTT: https://ifttt.com/discover https://www.pocketlint.com/SmartHome/SmartHom

ESP32 : https://http://esp32.net/

NodeMCU:

https://nodemcu.readthedocs.io/en/master
https://iotbytes.wordpress.com/nodemcupinout/

IOT: https://internetofthingsagenda.techtarget.com/definit

Arduino IDE: https://www.arduino.cc/en/Guide/Environment

Wikipedia: https://www.wikipedia.org/

Research_paper:

https://www.researchgate.net/publication/307537340_Monitoring_and_Controlling_o
f_Smart_Homes_using_IoT_and_Low_Power_Wireless_Technology.

YouTube guidance: https://youtu.be/LqX9EMFSoDA

36 | P a g e

You might also like