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

arduino based security

The document outlines the design and implementation of a security system utilizing microcontrollers, focusing on unauthorized entry detection, environmental monitoring, and remote access via a web server. It details the selection of various sensors, communication protocols, and the architecture of the system, including a master controller and control panel. The system is designed for both smart homes and larger facilities, allowing for real-time monitoring and control through a web interface.
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)
8 views

arduino based security

The document outlines the design and implementation of a security system utilizing microcontrollers, focusing on unauthorized entry detection, environmental monitoring, and remote access via a web server. It details the selection of various sensors, communication protocols, and the architecture of the system, including a master controller and control panel. The system is designed for both smart homes and larger facilities, allowing for real-time monitoring and control through a web interface.
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/ 4

Security System Based on Microcontrollers

Ing. Tomáš Pawlenka Doc. Ing. Jaromír Škuta, Ph.D


Department of Control Systems and Instrumentation Department of Control Systems and Instrumentation
VŠB-TU Ostrava VŠB-TU Ostrava
Ostrava, Czech Republic Ostrava, Czech Republic
[email protected] [email protected]

Abstract - The article describes design and realization of Unauthorized entry can be detected by motion sensors or
security system based on single-chip microcontrollers. System magnetic contacts that can guard the opening of doors and
includes sensor modules for unauthorized entrance detection windows. As an additional event within the building, a fire
based on magnetic contact, measuring carbon monoxide level, can be considered, which can be watched by temperature
movement detection and measuring temperature and humidity.
sensors or smoke detectors and another event like cracked
System also includes control unit, control panel and
development board Arduino with ethernet interface connected water pipes, which can be indicated by humidity sensors.
for web server implementation. Furthermore, the security system should include elements to
collect and process data about the measured values and states
Keywords - Microcontroller, Security system, Intelligent and provide them to the main control element which
sensors, Smart home processes and evaluates the alarm states of all data. These
elements will be the single chip microcomputers. It will be
I. INTRODUCTION necessary to select specific types according to selected
criteria.
In today’s world, the automation is growing increasingly
not only in industry area, but also in homes. These homes are The development of security system require introduction
called smart and the main advantage is security system with to these single chip microcontrollers, their architecture, type
wide spectrum of sensors to detection movement, series, technical parameters, and the possibilities of
temperature, smoke, vibration, broken glass or for example programming [2].
mechanical changes like opening doors or windows. The use
of security systems is not limited to smart homes only, but Modern security systems are also capable of providing the
also to various industrial and public objects. data to a user remotely using mobile technology. For this
purpose, the web server could be created.
The global market offers whole range of security systems
from different companies. The most common use is relating As a motion detector was chosen a passive infrared
to the already mentioned smart homes. Today, smart homes detector PIR labelled as SB00322A-1 with logic output. An
do not include security system only, but also different types of intelligent MQ-9 sensor with analogue output was selected to
actuators to control some smart home elements. detect gas and carbon monoxide. Additionally, the DHT11
module has been selected with a digital output for temperature
Commercial security systems are offered as wired, and humidity measurement, and the P-MK472 magnetic
wireless or mixed. The wired connection can be further contact can be used for door and window monitoring.
divided into the direct connection of the sensors to the control
unit via the I/O interface or they can be connected to each Since the security system contains a main microprocessor
other and to the unit via a bus. Each of these methods has its that will communicate with microcontrollers processing data
own advantages and choice depends only on the customer's from individual sensors, it will be Master - Slave
priorities [1]. communication. Communications should also not be limited
by distance. The supervised object may not only be a
This article deals with design and implementation of own household but also a large object. These criteria meet the RS-
security system using commonly available features like PIC 485 fieldbus and will be used for communication between
series microcontrollers or Arduino development boards as PIC microprocessors.
elements to process and evaluate data from sensors.
The security system structure can be divided into several
levels - data measurement, data acquisition, data processing
II. SECURITY SYSTEM DESIGN and control, and remote access and data visualization.
The first step in the design of the security system is to
clarify what the security system should contain. The main At the lowest level of measurement are individual system
elements of the security system are the sensors. The system sensors that provide data either analogue or digital to
should ensure not only unauthorized access into the guarded microprocessors at the data collection level. The measurement
object but should also monitor events within that object. level sensor and the microprocessor at the data acquisition

978-1-5386-4762-2/18/$31.00 ©2018 IEEE

344
level together form a sensor module that is adapted to provide To implement the RS-485 fieldbus, the integrated circuit
data to the control unit via the RS-485 fieldbus, which forms LTC485, which is a low-voltage receiver for the RS-422 / RS-
the interface between the data acquisition level and the data 485 buses, must be integrated into the circuit. To program the
processing and control level. The control unit processes these microcomputers of the security system, the MikroC PRO for
data and evaluates the alarm states. Additionally, this data PIC development environment was used, which has an RS-
provides to the control panels, which are on the same level, 485 communication library implemented. This library has a
and to the web server, which is level above. However, control clearly defined protocol for communication.
panels are not used only to receive data, but also send data
The communication begins by sending the start byte.
containing various commands back to the control unit. The
Another byte contains the target address of the device to
communication interface between the control unit and the
which the data is sent. The next byte contains information
web server is made up of the serial line RS-232 and TTL
about whether Master or Slave data is being sent. It also
logic.
contains information about changing the data and address in
case of equivalency with the start byte or stop byte.
Specifically, XOR with a value of 1 is performed in the case
of equality. In the next step, the data is sent in 3 bytes,
followed by a byte with the CRC checksum. Finally, a stop
byte is sent [3].

Fig. 1. Hierarchical structure of security system

This solution is suitable for smaller complexes or


households, since RS-485 can hold up to 32 devices without
a repeater. For larger applications, this design could be used
as one subsystem of many, but the RS-232 and TTL
interfaces would be replaced with another RS-485 bus, to
which the control units of all subsystems and the web server
would be connected. Fig. 3. RS-485 bus communication protocol [3]

PIC18F46K80 was selected as the master controller


processor. The master controller's role is to require data from
the sensor modules on the RS-485 industrial bus to process
these data and then evaluate the alarm states. It is also
designed to send the processed data to the control panel and to
the web server device to provide data to a user. From the
control panel and the web server receives commands to the
security activation or deactivation and from the control panel,
it also receives messages that contain a new password if it had
been changed by a user.
In addition to the control microprocessor, the master
Fig. 2. Extensive application controller also includes an RS-485 fieldbus interface for
communication with other sensor modules and the control
III. REALIZATION OF THE SECURITY SYSTEM panel, RS-232 interface for sending data to the Arduino web
server, LED indication to display incoming data, transmitting
The security system includes a master controller with a data, a faulty packet or the timeout for message reception. It
PIC18F46K80 microprocessor to collect and process data also includes a piezoelectric siren that represent an alarm
from other PIC16F88 and PIC12F1840 microprocessors that indication and connection for wires from the Arduino
are directly connected to the sensors. It also includes a development board.
PIC18F452 microprocessor control panel. For all these
microprocessors, it is necessary to create programs to ensure For the master controller, an external watchdog timer
the reliable communication between them. based on TS555CN circuit could by designed to monitor the
operation of the control unit. In the case of the control unit

345
stuck, the watchdog timer is capable to restart the unit during sends the data request to the first address. If the data transfer
93 milliseconds. is successful, the data is stored, the address is incremented,
and the data request is sent to the new address. If the transfer
Before making the algorithm, it is necessary to sense that
fails, the request is sent back to the same address. If the
the security system is based on the measurement values in
transmission fails twice, the address is incremented and the
real time. Therefore, the algorithm must run in a loop and
data is sent to the new address and at the same time the alarm
must under no circumstances stop. The master control loop
is triggered due to a sensor failure. The next part of the
should be as short as possible for the time and must not
program includes data monitoring in case of active security. If
contain any delays.
the one of values exceed the limit value, an alarm is triggered.
The last important step in the program is to send data to
Arduino web server.
As the control panel microprocessor was selected
PIC18F452. The aim of the control panel is communication
with a user through the keypad and the alphanumeric LCD
display. User can watch not only measured values of the
security system, but also activate or deactivate the system.
User also can change the brightness of the LCD or change the
activation password. These functions are accessible after
entering the password.
The user interface is displayed on the LCD and controlled
by the keypad and divided into sections, which resemble a
tree structure.

Fig. 5. User interface structure

IV. DESIGN OF THE WEB SERVER INTERFACE


The modern security system should allow user to watch
the data using mobile technologies or control the system
remotely. For that, the security system can be connected to
the LAN network. User could have an overview of the
security system events outside the guarded object assuming
the VPN connection.
For watching measured values and states is necessary to
create the web server. For that, Arduino ethernet shield,
which communicates with development board Arduino UNO
Fig. 4. Simplified algorithm diagram
via SPI interface, can be used.
The main program cycle should consist of a systematic The aim of the web server is security system data
transmission of data requests to all sensor modules on the bus visualization. These data represent for example the sensor
and further include the part to be performed when the security values and states or alarm conditions. Within the remote
system is not activated and the part to be performed when control, it will be the aim to activate or deactivate the
activated. security after entering the password.
The program starts with initialization, and then reads the To creation the web server through the ethernet shield is
password from the EEPROM, after which it immediately used, as was mentioned, the Arduino UNO development

346
board, which receives the data from the control unit and deactivate the security system a four-digit password must be
provide them via the web server to the connected client. For entered to textbox and confirmed by the button. Web app is
the control unit communication with Arduino UNO board is responsive. It adapts according to device resolution and it is
designed serial line RS-232. To speed-up the activation and readable also on mobile phones and tablets.
the deactivation, there are separate signals wired to the
control unit, which represent HIGH or LOW logic level.

Fig. 6. Block diagram of the web server realization

The web server realization includes the creation of a


program for the development board Arduino UNO and in Fig. 8. Final laboratory model of the security system
creation of the web page, which is necessary to upload on the
SD card on the ethernet shield. To the creation of the web
server were chosen technologies like HTML5, CSS and V. CONCLUSION
AJAX. The paper describes design and realization of own
security system based on microcontrollers with possibility to
AJAX (Asynchronous JavaScript and XML) is
remote access using a web server. During the project, the
technology, which allows to monitor the web server data
design of the system structure was created, which also
without refresh the web page in the web browser. It uses the
included the choice of communication technology and
combination of the built-in XMLHttpRequest web browser
individual components with design of wiring diagrams. In
object on demand data from the web server, JavaScript, and
the next phase, the designed parts were built, and the
HTML DOM [4].
laboratory model was assembled and then all components
have been programmed to ensure seamless communication
between them.
ACKNOWLEDGMENT
This work was supported by the Research and
Development in the Area of Machine and Process Control
SP2018/123 and by the European Regional Development
Fund in the Research Centre of Advanced Mechatronic
Systems project, project number CZ.02.1.01/0.0/0.0/16_019
/0000867 within the Operational Programme Research,
Development and Education.

REFERENCES
[1] KŘEČEK, Stanislav. Příručka zabezpečovací techniky. Vyd. 2.
[S.l.: s.n.], 2003. ISBN 8090293824.
Fig. 7. Final web application [2] HRBÁČEK, J. 2004. Moderní učebnice programování
mikrokontrolérů PIC. Praha. Nakladatelství BEN – technická
literatura. 96 s. ISBN 80-7300-136-5.
To creation of the web page was used mark-up language [3] MikroElektronika [online]. Bělehrad: MikroElektronika, 1998
in HTML5 version and its design was edited using CSS [cit. 2017-02-01]. Dostupné z: https://www.mikroe.com/
technology. The final web application is divided into three [4] W3Schools Online Web Tutorials [online]. W3.CSS, c1999-2017
boxes. The first monitors sensor values and states, the second [cit. 2017-04-14]. Dostupné z: https://www.w3schools.com/
is used for activation or deactivation security, and the last
one is used for watching alarm conditions. To activate or

347

You might also like