Low-Cost Compact Theft-Detection System Using MPU-6050 and Blynk IoT Platform
Low-Cost Compact Theft-Detection System Using MPU-6050 and Blynk IoT Platform
-
Mr. Atharva Karnik Ms. Diksha Adke Prof. Pushkar Sathe
Dept. of Electronics and Dept. of Electronics and Dept. of Electronics and
Telecommunication Telecommunication Telecommunication
SIES Graduate School of Technology, Nerul SIES Graduate School of Technology, Nerul SIES Graduate School of Technology, Nerul
Navi Mumbai, India Navi Mumbai, India Navi Mumbai, India
[email protected] [email protected] [email protected]
2020 IEEE Bombay Section Signature Conference (IBSSC) | 978-1-7281-8993-2/20/$31.00 ©2020 IEEE | DOI: 10.1109/IBSSC51096.2020.9332214
Abstract The system explained in this paper provides a the use of IoT devices can be seen in Fig. 2. Mobile phones
compact smart surveillance system. Recent years have seen the are widely used gadget in the world. Hence there are many
Internet of Things (IoT) dominating in various fields of appli- mobile applications such as Blynk [7], NETPIT which
cations. With devices getting smarter and insurgence of 5G support Internet of Things (IoT). We used Blynk mobile
technology, the connectivity of people with devices is increas- application to acquire updates on real time movement of the
ing. Smarter surveillance systems are more reliable and acces- door. This system mainly focuses on making a low cost
sible. A gyroscope is a MEM sensor which detects angular dis- product with portability and practical application. The porta-
turbances. The principle is to detect opening or knockdown of bility feature focuses on the device being easy to remove and
the door physically or by a gas cutter. The system is connected implement anywhere as and when required. As per the initia-
to the user via Wi-Fi using ESP8266. Being a system with a low tive taken by Government of India to convert cities into
form factor, this system can be implemented on doors, shops,
smart cities, this system plays a crucial role of smart surveil-
cars, etc. An alarm system is included in the system to alert the
neighbors as well as to send a notification to the user via Blynk
lance.
mobile application. The proposed system is a portable smart
home solution for theft detection. The code for this system is
available here:
https://github.com/atharvakarnik/TheftDetectionMPU.git
Keywords Theft Detection System(TDS); Internet of Things
(IoT); Smart home management system; Smart homes; IoT in
Security & Surveillance; MPU-6050; NodeMCU; Gyroscope
I. INTRODUCTION
Robbery is one of the rapidly increasing threats
worldwide. With advancements in technology, tools to
bypass security measures are also advancing. To prevent
lockpicking, advanced 7-lever, 8-lever locks were developed.
Yet, these locks were brute-forced using powerful
mechanical tools. In recent years, mechanical tools are
getting replaced by electromechanical, chemical tools which Fig. 2. Increase in IoT devices over the years
reduced time and noise during robbery. The nation-wise data
about robbery cases in Europe for year 2017 can be seen in
the Fig. 1.
II. LITURATURE SURVEY
Mamun et al. [1] have used GSM module,
microcontroller, DTMF decoder, vibration sensor, auto
dialler to detect the vehicle intrusion. If the thief tries to do
any malicious activity with the vehicle, the owner will get a
phone call and owner can lock the engine using a password.
Engine will be started again only if the owner sends the
password. As per the surveys conducted on Raspberry pi
and NodeMCU [2][11][15], NodeMCU is a better choice
when task is repetitive but updating code is possible in
Raspberry pi only. Serikul et al. [3] have designed a smart
capsule to monitor real time humidity in the paddy bags
stored at different locations within a warehouse. Blynk
mobile application was used for keeping a track of data
generated from humidity sensor. When capsule is offline,
supervisor will get message via blynk app.
Fig. 1. Robbery cases in Europe in year 2017
Bohara et al. [4] have proposed the smart managing of
More and more smart home management systems are electricity throughout the day which will lead in decreasing
developing [3][4][5][6][13][16][17] to counter this problem. the robberies related to it. They have designed a smart home
In these systems, the concept of Internet of Things (IoT) is system which will do regular home chores at the fixed time
used to make devices smart and connected. The increment in every day. This will avoid peak load hours in the city. The
113
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:24:34 UTC from IEEE Xplore. Restrictions apply.
smart home system implemented by David et al. [5] monitors special functions are supported on it. The block diagram of
environmental and security conditions using various sensors. NodeMCU can be seen in the Fig. 4.
The main system consist of 3 sub home automation systems
and one server. The communication between systems and NodeMCU is a software that comes installed in
server is established using MTTQ protocol. It stores ESP8266, and it uses the Lua programming language but the
generated data on cloud using Thingspeak application. ESP8266 that comes with NodeMCU can also be
reprogrammed via the Arduino IDE. The board has a built-in
Several smart surveillance systems have been designed voltage regulator and the user can power up the module
[5][6][16] comprising of PIR sensor which detects the using the mini USB socket or the Vin pin. Uploading code to
motion of any object, body. Saranu et al. developed a system
[6] using a camera having an in-built CMOS image sensor no need for an FTDI programmer, as it comes with a USB-
and sensitive microphone which is used to record the video. to-Serial converter built-in.
This captured data will be sent to
system uses a solenoid valve to secrete chloroform if any
unwanted movement happens.
114
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:24:34 UTC from IEEE Xplore. Restrictions apply.
motion-based use cases are provided on-chip, reducing fur- b. Arduino IDE
ther overall power consumption.
The Arduino Integrated Development Environment (IDE)
c. Siren: is an open-source application software [10] that is used to
write programming codes for microcontrollers in the Ar-
It is an electromechanical apparatus for generating alarm duino family. It is a cross-platform IDE which is compatible
signals. Acoustic signals are used to issue forecasts, alerts with Windows, macOS and Linux operating system. Arduino
and deactivations. The siren used in this solution works at IDE can be used to execute programs for various microcon-
120mA current and has operating voltage range as 10.5V - trollers, not limited to Arduino MCU. The programming
13.5V DC. Operating temperature range is -10°C - +50°C. language used to write instructions for the microcontroller is
At 12V, the output sound pressure level is 105 dB at 1 meter. Embedded-C.
Thus, it has the capability to be heard across walls for raising
SOS signals.
Fig. 6. Siren
Fig. 8. Arduino IDE
B. Software Description:
a. Blynk IV. METHODOLOGY
Blynk is an IoT platform [7] that supports both iOS and Till now, theft detection systems have been using laser
Android. As seen in the Fig. 7 it can compatibly work with sensors. When the beam of laser is obstructed, the alarm goes
many types of microcontrollers such as NodeMCU off. This kind of apparatus is however very expensive and
ESP8266, Arduino, Raspberry Pi, and ESP32 over the hard to implement. It is not even feasible to implement it
Internet. It consists of three major components: anywhere. Recently in 2018, Saranu et al. published a paper
[6] about theft detection using PIR (Passive Infrared) sensor.
i. The Blynk application, which is used to control a However, it consumes much power and it is prone to raising
device and display data on widgets . false alarm. Also, once implemented, it is hard to relocate
ii. The Blynk server, which is a cloud service and reinstall it anywhere else i.e. it lacks the portability.
responsible for all communications between Hence to overcome these issues, we have designed a new
smartphones and things. system with changes in the hardware. A system which is
iii. Blynk libraries, which include various widgets such easy to install and shift anywhere as and when required.
as control buttons, display formats, notifications,
This system uses a gyroscope sensor (MPU-6050) of
and time management, which enable a device to GY-521 architecture. The sensor is able to detect any
send the data obtained from a sensor to be displayed angular/linear acceleration. This sensor is connected with
on a mobile application in an effective and ESP8266 (NodeMCU) via I2C (Inter-Integrated Circuit) bus.
convenient way. Thus, when the door undergoes any physical change
(movement or even breakdown), the sensor easily detects the
movement. It is followed by the sensor giving excitation
signal to the ESP8266. The ESP8266 module, having Wi-Fi
capability can send the notification directly to the owner
using Blynk mobile IoT application. It also sends signal to
the burglar alarm which notifies the neighbourhood that theft
is underway. The GY-521 board has an embedded ambient
temperature sensor. Thus, any anomaly in temperature in
case of thieves using a gas cutter can also be detected. All
this functionality is achieved in a minimalistic design of very
few components. This makes our design compact, portable
and easy to modify. In addition to that, dedicated functionali-
ty modules (discussed in future scope) can also be connected
to increase the overall performance of the system.
Software tools used : Arduino IDE, ESP8266 libraries,
Fig. 7. Blynk IoT application flow and Blynk libraries and application.
115
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:24:34 UTC from IEEE Xplore. Restrictions apply.
Steps to install ESP8266 and Blynk libraries on Arduino
IDE :
To proceed using Blynk library with ESP8266, we need
(Skip to step 4. If Arduino IDE is already installed, step to import BlynkSimpleESP8266.h library. As we are
8. If ESP8266 library is already installed) working with internet connection through Wi-Fi, we also
need ESP8266WiFi.h library as well. For I2C connection of
1. Go to MPU-6050 and NodeMCU, we require Wire library.
2. Choose the installation link according to your OS After compilation and uploading the code, the Serial Monitor
(supports Windows, Macintosh, Linux) will show 7 variables viz, Ax, Ay, Az (acceleration in x, y, z
direction resp.), T (ambient temperature in °C) and Gx, Gy,
3. Proceed with installation Gz (angular acceleration in x, y, z direction resp.). The in-
4. formation flow of the system can be seen in the Fig. 9.
5. Enter There have been multiple instances [18][19] where at-
https://arduino.esp8266.com/stable/package_esp82 tackers tried to invade property by means of sharp objects to
66com_index.json Additional Board cut the door, powerful mechanical tools to break the lock,
Manager URLs . and in some cases, they have used gas-cutters to break-in
silently. Metal doors and locks prove to be ineffective
6. Open Board Manager menu from Tools > Board against gas cutters, thus creating vulnerability. This system
Menu and find esp8266 platform. presented in Fig.9. provides a reliable solution against such
7. Select the latest version from drop-down box and potential theft attacks. The system is enabled with a tempera-
click Install button. ture sensor capable of measuring up to 85° C. Thus, it can
easily detect rise in temperature above general ambient con-
8. - ditions. The data is constantly fed to microcontroller. The
microcontroller, ESP8266, is connected to internet via Wi-Fi.
The name of downloaded file will be Thus, when the sensor data crosses threshold value, notifica-
Blynk_Release_vXX.zip (vXX specifies the version tion is sent to owner via Blynk mobile application. The mi-
of library). crocontroller also initiates the siren which has 105dB output.
9. Unzip the file. There will be 2 folders in the archive Thus, anyone nearby the theft location can hear the alarm
and act accordingly.
10. Copy both the folders to the Arduino IDE folder V. FLOWCHART
where the IDE is installed on computer and restart The Fig.10. describes the flow of tasks performed by our
Arduino IDE. surveillance system. The algorithm starts by acquiring the
sensor data first from the MPU-6050 sensor. The micropro-
cessor, ESP8266 then processes the data. Two separate deci-
sions are taken based on the threshold for temperature and
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:24:34 UTC from IEEE Xplore. Restrictions apply.
threshold for angular displacement. If the values appear to be ambient temperature unlike PIR sensor which has the ability
within the permissible limit, the control jumps back to read- to sense only the variations in temperature. Thus, being
ing the next data again. Any acquired value above pre-set compact, power-saving and functionally efficient, GY-521 is
threshold limit is translated as a malicious activity by the a better choice for smart systems. The one thing it lacks is,
microcontroller. It then sends excitation signal to the siren measuring the attributes from a distance. PIR sensor is
and sends mobile notification to the owner via Blynk appli- capable of getting input from wide area while GY-521 can
cation. only measure data from where it is mounted.
Instead of a fixed installation like [6][16][17], we The Fig. 11 shows the notification received on an android
mounted the system on the door itself. Thus, any mobile phone when the system detected anomalies. Fig. 12.
disturbances came across by the door (like opening, knock- reveals the output of GY-521 sensor on Serial Plotter of Ar-
down, cutting, etc.) can be directly picked up by the MPU- duino IDE.
6050 sensor. Being a compact system, it can be easily
implemented on the door along with microcontroller.
Depending upon the orientation of mounting of Gyroscope
module, vector component of motion must be chosen cor-
rectly. In our case, we chose to monitor the angular dis-
placement in y-direction derived from the linear acceleration
in x and z direction and taking its trigonometric inverse tan-
gent function. The sensitivity of gyroscope was set to
±250°/sec. We set the threshold of angular displacement to
±60°.
This threshold was chosen experimentally to minimize
false alarm due to effect of wind or other small disturbances.
Thus, whenever the angular displacement in y-direction
exceeded 60°, the ESP module issued excitation signal. At
the moment of excitation signal, the notification was sent to
ALERT! The door has been
opened! Similarly, the threshold for temperature-surge was
chosen as 60°C. Above this threshold limit, a notification
would get delivered to the user stating- a-
. These notifications can be seen in the Fig. Fig. 11. Notification received on mobile
11. At the same instant, a siren included in the system would
start buzzing to inform neighbours that theft is underway.
The output of the system on the serial plotter can be seen
from Fig. 12.
VI. COMPARISION WITH EXISTING SYSTEM
The below Table.1. shows a brief comparison between
the existing theft-detection systems using PIR sensor [6] and
the gyroscope sensor used in our solution. For a fair compar-
117
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:24:34 UTC from IEEE Xplore. Restrictions apply.
render thieves unconscious, messaging the nearest police Cities Conference (ISC2), Wuxi, 2017, pp. 1-5, doi:
station about the scenario, etc. 10.1109/ISC2.2017.8090790.
[14] V. D. Vaidya and P. Vishwakarma, "A Comparative
This system may be implemented in automobile Analysis on Smart Home System to Control, Monitor
applications with suitable modifications in parameters. GPS and Secure Home, based on technologies like GSM,
module can be tagged along the system which may yield IOT, Bluetooth and PIC Microcontroller with ZigBee
Modulation," 2018 International Conference on Smart
real-time location update of the vehicle over cloud. This may City and Emerging Technology (ICSCET), Mumbai,
significantly increase recovery rate in the case of 2018, pp. 1-4, doi: 10.1109/ICSCET.2018.8537381.
automobile-thefts. By using extension of GPS enabled sys- [15]
tem to our proposed system, the owner will be able to track Arduino, Raspberry Pi and ESP8266 as IoT
the real-time location of the automobile. Develo Vol:8, No.5 (2017)
[16] R. R. Ragade, "Embedded home surveillance system
VIII. CONCLUSION with pyroelectric infrared sensor using GSM," 2017 1st
International Conference on Intelligent Systems and
The project has implemented a smart home system which Information Management (ICISIM), Aurangabad, 2017,
is able to sense any type of physical, chemical intrusion in pp. 321-324, doi: 10.1109/ICISIM.2017.8122192
the house. The system is not only smaller and lighter than [17] Aditya, M. Sharma and S. Chand Gupta, "An Internet of
existing solutions [3][4][5][6][13][16][17] but also provides Things Based Smart Surveillance and Monitoring
key feature of portability i.e. it can be removed and imple- System using Arduino," 2018 International Conference
mented anywhere according The user on Advances in Computing and Communication
Engineering (ICACCE), Paris, 2018, pp. 428-433, doi:
is able to get the notification on the mobile phone. The 10.1109/ICACCE.2018.8441725
bulgur alarm is used to alert people in the vicinity. The [18]
power requirement of the system is very less, enabling it to , BangloreMirror, 25th Jan. 2020,
function for longer duration. https://bangaloremirror.indiatimes.com/bangalore/crime
/rs-3-cr-ruby-was-a-stone-after-
IX. REFERENCES all/articleshow/73565093.cms
[1] K.A. Mamun and Z. Ashraf, Anti-theft vehicle security [19] th
system with preventive action , 2015 2nd Asia- Pacific Feb. 2020,
World Congress on Computer Sciences and https://timesofindia.indiatimes.com/city/bengaluru/karn
Engineering (PWC on CSE), 2-4 Dec. 2015 ataka-burglars-who-used-hydraulic-cutter-to-enter-
houses-held/articleshow/73977156.cms
[2] Anuradha Patel , Dr. P. Devaki , Survey on NodeMCU
and Raspberry pi: IoT ,International Research Journal
of Engineering and Technology (IRJET), Volume: 06
Issue: 4 | Apr 2019
[3] Peerasak Serikul,Nitigan Nakjuatong,Nuttapun
Nakpong, Smart Farm Monitoring via the Blynk IoT
Platform ;Case Study: Humidity Monitoring and Data
Recording,2018 Sixteenth International Conference on
ICT and Knowledge Engineering
[4] Bharat Boharaand Sunil Maharjan, Bibek Raj Shrestha,
IoT Based Smart Home Using Blynk Framework ,
ZERONE SCHOLAR, VOL. 1, NO. 1, NOVEMBER
2016
[5] David Nettikadan and Subodh Raj M.S., Smart
Community Monitoring System using Thingspeak IoT
Plaform , International Journal of Applied Engineering
Research ISSN 0973-4562 Volume 13, Number 17
(2018)
[6] P. N. Saranu, G. Abirami, S. Sivakumar, K. M.
Ramesh, U. Arul and J. Seetha, "Theft Detection
System using PIR Sensor," 2018 4th International
Conference on Electrical Energy Systems (ICEES),
Chennai, 2018, pp. 656-660.
[7] https://docs.blynk.cc/
[8] https://invensense.tdk.com/products/motion-tracking/6-
axis/mpu-6050/
[9] https://cdn-learn.adafruit.com/downloads/pdf/pir-
passive-infrared-proximity-motion-sensor.pdf
[10] https://www.arduino.cc/reference/en/
[11] Ooko, Samson. (2019). A Comparison of Arduino,
Raspberry Pi and ESP8266 Boards
[12] O. E. Amestica, P. E. Melin, C. R. Duran-Faundez and
G. R. Lagos, "An Experimental Comparison of Arduino
IDE Compatible Platforms for Digital Control and Data
Acquisition Applications," 2019 IEEE CHILEAN
Conference on Electrical, Electronics Engineering,
Information and Communication Technologies
(CHILECON), Valparaiso, Chile, 2019, pp. 1-6, doi:
10.1109/CHILECON47746.2019.8986865.
[13] X. Mao, K. Li, Z. Zhang and J. Liang, "Design and
implementation of a new smart home control system
based on internet of things," 2017 International Smart
118
Authorized licensed use limited to: Institut Teknologi Sepuluh Nopember. Downloaded on November 15,2024 at 02:24:34 UTC from IEEE Xplore. Restrictions apply.