IoT Based Anti-Theft Detection and Alarm System Using NodeMCU and Blynk Application

Page 1

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 09 Issue: 08 | Aug 2022 www.irjet.net p-ISSN:2395-0072

IoT Based Anti-Theft Detection and Alarm System Using NodeMCU and Blynk Application

6

1,2,4,5Department of Physics, Pathein University, Pathein, Myanmar 6Department of Mathematics, Pathein University, Pathein, Myanmar 3Department of Physics, Taunggoke University, Taunggoke, Myanmar ***

Abstract - The purpose of building this system is to prevent the loss of property due to theft that we face in our daily lives. This system includes NodeMCU with Esp8266 Wi-Fi module based on microcontroller, PIR sensor to use the motion detection, ultrasonic sensor to know the distance from the obstacles, buzzer to use the alarm system, Blynk application to use the reporting message and light bulb to illuminate around the environments. When sensor detected the movement of objects, sends a message to phone, lights up the bulb, and then alert alarm because Esp8226 Wi-Fi module is connected to Blynk application. The problems found with existing systems were that they can only identify the intruder after the theft, or cannot distinguish between human and non-human objects. So, this system will be essential for every building because it is not just easy to use but is also inexpensive.

Keywords: NodeMCU,IoT,Blynkapplication,PIRsensor, Ultrasonicsensor.

1. INTRODUCTION

In our country, there has been the loss of property every year due to thieves and strangers. Therefore, security is very important [1]. This system is intended to provide security in unsafe places. This is because it is to prevent the loss of important documents and property in offices, departments, classrooms, homes and buildings etc. The key to security is IoT system [2]. The Internet of Things (IoT) describes physical objects (or groups of such objects) with sensors, processing ability, software, and other technologies that connect and exchange data with other devices and systems over the Internet or other communicationsnetworks[3].Internetofthingshasbeen consideredamisnomerbecausedevicesdonotneedtobe connected to the public internet, they only need to be connected to a network and be individually addressable [4]. Traditional fields of embedded systems, wireless sensor networks, control systems, automation (including home and building automation), independently and collectively enable the Internet of things [5]. In the consumer market, IoT technology is most synonymous with products pertaining to the concept of the "smart

buildings", including devices and appliances (such as lighting fixtures, thermostats, home security systems, cameras, and other home appliances) [6]. Nowadays, people are creating everything using IoT system because of the advancement of IT technology [7]. The block diagramofanti-theftdetectionandalarmsystemisshown inFig1.

Fig-1: Blockdiagramofanti-theftdetectionandalarm system

2. METHODOLOGY

Basically, the design and development of this system are divided into two main parts: hardware architecture and software details. In the hardware architecture, the design of the circuit was constructed and the prototype of the system was built. While in the software development, the wholecompleteprototypewasoperatedviaprogramming codes.

2.1 Hardware Architecture

NodeMCU

NodeMCU is an open-source development board and firmware based in the widely used ESP8266 - 12E WiFi module as shown in Fig 2. It allows to program the ESP8266 WiFi module with the simple and powerful LUA

©
Certified Journal | Page2068
2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008
Zin Min Htike1, Ko Ko Aung2 , Shwe Khine Pyone3, Khin Sandar Lin4 , Kyaw Saw Win5, Naung Naung Power Supply
PIRSensor Ultrasonic
Sensor
AC220V NodeMCU Buzzer LEDs Relay LCD Message Blynk
Application
Bulb

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 09 Issue: 08 | Aug 2022 www.irjet.net p-ISSN:2395-0072

programminglanguageorArduinoIDE[8].Withjustafew lines of code can establish a WiFi connection and define input/outputpinsaccordingtoneedsexactlylikearduino, turningyourESP8266intoawebserverandalotmore.It is the WiFi equivalent of ethernet module [9]. With its USB-TTL, the nodeMCU Dev board supports directly flashing from USB port. It combines features of WIFI accesspoint and station + microcontroller. These features make the NodeMCU extremly powerful tool for Wifi networking. It can be used as access point and/or NodeMCU Blynk application Relay Bulb Buzzer LCD Message Power Supply IR sensor PIR sensor 9V battery station,hostawebserverorconnecttointernettofetchor uploaddata[10].

Blynk Application

BlynkwasdesignedfortheInternetofThingsasshownin Fig 4. It can control hardware remotely, it can display sensor data, it can store data, visualize it and do many other cool things. There are three major components in theplatform:

Blynk App - allows to create amazing interfaces forresearchesusingvariouswidgets.

Blynk Server - responsible for all the communications between the smartphone and hardware. Our Blynk Cloud can be used or your private Blynk server is locally run. It’s opensource, could easily handle thousands of devices andcanevenbelaunchedonaNodeMCU.

Blynk Libraries - for all the popular hardware platforms-enablecommunicationwiththeserver and process all the incoming and outcoming commands.

Internet of things

The internet of things, or IoT, is a system of interrelated computing devices, mechanical and digital machines, objects that are provided with unique identifiers (UIDs) and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction as shown in Fig 3. A thing in the internet of things can be a person with a heart monitor implant, an automically anti-theft detection and alarm system, an automobile that has built-in sensors to alert the driver when tire pressure is low or any other natural or manmadeobjectthatcanbeassignedanInternetProtocol(IP) address and is able to transfer data over a network. Increasingly, organizations in a variety of industries are using IoT to operate more efficiently, better understand customers to deliver enhancedcustomerservice,improve decision-making and increase the value of the business [11].

Every time it is pressed a Button in the Blynk app, the message travels to space the Blynk Cloud, where it magically finds its way to hardware. It works the same in the opposite direction and everything happens in a Blynk ofaneye.

Fig-3: InternetofThings

PIR Sensor

Fig-4: BlynkApplication

PIR sensors allow to sense motion, almost always used to detect whether a human has moved in or out of the sensors range as shown in Fig 5. They are small, inexpensive, low-power, easy to use and don't wear out. For that reason, they are commonly found in appliances and gadgets used in homes or businesses. They are often referredtoasPIR,"PassiveInfrared","Pyroelectric",or"IR motion"sensors.PIRsarebasicallymadeofapyroelectric

2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page2069

©
Fig-2: NodeMCU

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 09 Issue: 08 | Aug 2022 www.irjet.net p-ISSN:2395-0072

sensor (which you can see below as the round metal can witha rectangularcrystal inthecenter),whichcandetect levels of infrared radiation. Everything emits some lowlevel radiation, and the hotter something is, the more radiation is emitted. The sensor in a motion detector is actually split in two halves. The reason for that is that someoneislookingtodetectmotion(change)notaverage IR levels.The two halvesare wired upso thattheycancel each other out. If one half sees more or less IR radiation thantheother,theoutputwillswinghighorlow.

softwarelibrarywhichprovidescommoninputandoutput procedures for wiring projects. It requires only two basic functions that is for starting the sketch and the main program loop. They are compiled and linked with a program stub main() into an executable cyclic executive program. Then, it employs the program to convert the executable code into a text file in hexadecimal encoding. That is text file is loaded into the microcontroller by a loaderprogramintheboard'sfirmware.

Fig-5: PIRSensor

Ultrasonic Sensor

Anultrasonicsensorisanelectronicdevicethatmeasures the distance of target object by emitting ultrasonic sound waves, and converts the reflected sound into an electrical signal as shown in Fig 6. Ultrasonic waves travel faster than the speed of audible sound (i.e the sound that humans can hear). Ultrasonic sensors have two main components:thetransmitter(whichemitsthesoundusing piezoelectriccrystals)andthereceiver(whichencounters thesoundafter ithastravelledtoandfrom the target). In ordertocalculatethedistancebetweenthesensorandthe object, the sensor measures the time it takes between the emission of the sound by the transmitter to its contact withthereceiver.

Fig-6: UltrasonicSensor

Arduino IDE

The Arduino IDE supports the languages C using special rules of code structuring as shown in Fig 7. It supplies a

Fig-7: ArduinoIDE

2.2 Software Architecture

In this work, the program is written in NodeMCU Lua program language. It must use Arduino software (IDE) version (1.8.19). This software is an open software. The codewillbewrittenonthissoftwareanditwillbeupload toNodeMCUboard.TheNodeMCUboardalwayschangeto adapttonewneedsandchallengesandit’soffersimple8bit boards to product for IoT applications, wearable, 3D printing and embedded environment. The program of microcontroller reads the program and sends the data to theindicatorLCDdisplayandBlynkapplication.Blynkisa platform with ios and android applications to control NodeMCU, Arduino, Rasberry Pi and the others over the internet. After connecting microcontroller USB via into computer,itwillchooseandport.Thenitwillcompileand uploadtheprogram.Theflowchartofthesystemisshown inFig8.

© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page2070

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 09 Issue: 08 | Aug 2022 www.irjet.net p-ISSN:2395-0072

and the bulb will also light in this time. The completed circuitofthesystemisshowninFig9.

Fig-8: Flowchartofthesystem

3. OPERATING SYSTEM

This system includes NodeMCU Esp8266 Wi-Fi module, PIR sensor, Ultrasonic sensor, LCD, Buzzer, Blynk application,relayandbulb. NodeMCUisa boardbased on the microcontroller with the Wi-Fi module. The microcontroller will be commanded using Lua programming language. The Lua programming language must be written in Arduino IDE and then command the microcontroller on the NodeMCU. In this system, PIR sensor is used to detect the movement. PIR sensors have ranges of up to 3.3 meters (10 feet), and then Ultrasonic sensors are good for detection between 2cm-400cm (13 feet). In this work, Blynk application is used to send notificationsonthephone whenthe movementoccurs. At thesametime,existenceofthemovementswillbenotified aswellontheLCDdisplay,evenifanotificationmessageis not received due to phone error. The buzzer will alert alarm as soon as the motion is detected. The Bulb connectedtorelayisusedtodetectthemovementatnight. The operating voltage of the NodeMCU is 3.3V, but the input voltage must be supplied between 4.4V and 10V. Therefore,5Vpowersupplymustbesetuptoprovidethe required voltage. As soon as the sensors detect the movements, the data are sent to the microcontroller on the NodeMCU. The notification message is sent on the phone by the Blynk application after the microcontroller had registered the movements, and then the buzzer will also sound alarm and LCD also displays the movements,

Fig-9: Completedcircuitofthesystem

4. EXPERIMENTAL RESULTS

Three types of the organisms (human, cat, dog) are considered as an obstacle; as stated in previous section; duetotheirpopularityinmanyapplications.Theobtained results for each organism are shown in tables and figures to clearly focus on the difference of two sensors to concludethedetectionofmovements.

Table-1: ExperimentalResults(human)

Sensors Distances(cm) Detection/Nodetection PIR

50 Detect 100 Detect 150 Detect 200 Detect 250 Detect 300 Detect 350 Nodetect

Ultrasonic

60 Detect 120 Detect 180 Detect 240 Detect 300 Detect 380 Detect 402 Nodetect

© 2022,
|
| ISO 9001:2008 Certified Journal | Page2071
IRJET
Impact Factor value: 7.529
Start End Readsensorinput PIR Ultrasonic Detect NOdetect Alarmwithbuzzer ONredLED LCDdisplay SwitchonBlynk Notonebuzzer ONgreenLED LCDdisplay Yes No

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

300 Detect 350 Nodetect

Ultrasonic

Fig-10: Theconditionthatdetectedthehuman Table-2: ExperimentalResults(cat)

Sensors Distances(cm) Detection/Nodetection

60 Detect 120 Detect 180 Detect 240 Detect 300 Detect 380 Detect 402 Nodetect

50 Detect 100 Detect 150 Detect 200 Detect 250 Detect 300 Detect 350 Nodetect Ultrasonic

PIR

60 Detect 120 Detect 180 Detect 240 Detect 300 Detect 380 Detect 402 Nodetect

Fig-11: Theconditionthatdetectedthecat Table-3: ExperimentalResults(dog)

Sensors Distances(cm) Detection/Nodetection

PIR

50 Detect 100 Detect 150 Detect 200 Detect 250 Detect

Fig-12: Theconditionthatdetectedthedog

5. CONCLUSION

Theresearchonthissystemmainlyfocusedonsolvingthe security problems. It is hoped that it will help people across the country reduce theft. It has provided a novel wirelesssensingsystemforthesurveillanceanddetection of a human intruder as well as instant notification of the intrusiontopreventtheft.Thissystemissuitableforsmall personal area surveillance, i.e., offices, departments, classrooms, homes and buildings. The main advantage of the system is easy to use, low cost with high quality. New research challenges of security and privacy have arisen dueto anincreasein productsthatconnectthecyberand physical worlds. It is expected that these research problemswillbefurtherresolvedintheupcomingfuture.

ACKNOWLEDGEMENTS

I wish to express my deepest gratitude to Dr Than Tun, Rector, Pathein University for his encouragement to submit this paper. Further I wish to thank U Ko Ko Aung, Lecturer,DepartmentofPhysics,PatheinUniversityforhis valuable suggestions. I would like to thank U Khin Maung Aye, Lecturer, Department of English, Pathein University forhisencouragementtodothiswork.

REFERENCES

[1] Brown & Eric, 20 September 2016. "21 Open SourceProjectsforIoT".

Volume: 09 Issue: 08 | Aug 2022 www.irjet.net p-ISSN:2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page2072

International Research Journal of Engineering and Technology (IRJET) e-ISSN:2395-0056

Volume: 09 Issue: 08 | Aug 2022 www.irjet.net p-ISSN:2395-0072

[2] ITU, Retrieved 26 June 2015. "Internet of Things GlobalStandardsInitiative".

[3] Hendricks & Drew, Retrieved 10 August 2015. "TheTroublewiththeInternetofThings".London Datastore.GreaterLondonAuthority.

[4] NilanjanDey,AboulEllaHassanien,ChintanBhatt, AmiraAshour,SureshChandraSatapathy&Cham, 2018. “Internet of things and big data analytics towardnext-generationintelligence”.

[5] Gartner, Retrieved 3 March 2022. "Forecast: The InternetofThings,Worldwide,2013".

[6] Hu, Niu, Carrasco, Lennox & Arvin, 2022. "FaulttolerantcooperativenavigationofnetworkedUAV swarmsforforestfiremonitoring"

[7] Lennox & Arvin, 2022. "Robust formation control for networked robotic systems using Negative Imaginarydynamics".

[8] Zeroday, Retrieved 2 April 2015. "A lua based firmwareforwifisocesp8266".

[9] Hari Wiguna, Retrieved 2 April 2015. "NodeMCU LUAFirmware".

[10] Retrieved 3 June 2017. Jump up to: abSystems, Espressif. "Espressif Systems". EspressifWikiDevi. Archivedfromtheoriginalon1December2017.

[11] Gillis & Alexander, 2021. "What is internet of things(IoT)?".

©
Page2073
2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal |

Turn static files into dynamic content formats.

Create a flipbook