Accelerometer-based glass-break detector for alarm applications

. The aim of this paper is to introduce and improve the functionality and reliability of the indoor glass-break detectors for the security application. The most vulnerable part of the house security are the windows which are fragile and very easy to overcome. The glass-break or shock detector are generally used to detect the potential intruder by vibration which is spreading through the glass. The alarm is triggered when a threshold level of the vibration is exceeded. However, the further information of the intrusion is missing. The goal of this paper is a design of a glass-break detector based on the accelerometer which can also detect the vibration in the glass panels with higher accuracy. The main advantage of the implemented accelerometer is the ability to sense several influences of the environment. The program can reliably distinguish between main influences like the rain, storm or strong wind. This function can also be used for the non-alarm application. However, the main function is still focused on the security application. The designed detector should be able to communicate with commercially made Control and Indicating Equipment via the wired connection.


Introduction
The Intruder Alarm System (IAS) became very popular in modern households where people want to protect their possession effectively. This system can be classified as technical security which replaces the less efficient physical security. The physical security is very often used in large buildings or areas where the person can control several systems; However, this manner is very inefficient and expensive in small family houses. The author [1,7] mentioned that a person stares at a screen for more than 20 minutes, his attention drops by 30%; and for periods over an hour, this drop can reach 70%. That's why the IAS is much more suitable and also more cost-effective for the small family houses. The standard IAS consists of several devices which can detect the intruder in the protected area without any person involved.
The main component of the system is called the Control and Indicating Equipment (CIE) which controls the whole security system, and it also controls all connected devices called alarm detectors. It also provides external communication with the Alarm Receiving Center (ARC) which can dispatch security forces immediately when the alarm is triggered. The modern systems are usually extended by the non-alarm applications which are controlled by the CIE. The author in [2] claimed that the IAS which is extended by the other application is called the Integrated Alarm System. It means that the other applications must not influence the other application.
The most critical layer between the intruder and the protected possession is the housing done by the walls, windows and doors. The walls itself are unbeatable by normal force, and the intruder has only two options for how to get to the house. These options are the door and the window. Nowadays, the doors are the most secure part of the entrance to the house.
[11] On the other hand, the most vulnerable opening are the windows.
The goal of this research is to improve the technical protection of the windows against potential intruders using the accelerometer. The final detector should be able to evaluate vibration which can be created by the intruder during the breaking through. According to the author [8], every detector must be designed according to the CSN EN 50131-2-8 Alarm systems -Intrusion and hold-up alarm systems -Part 2-8: Intrusion detectors -Shock detectors.
Every alarm detector must have assigned a Degree of security. The degree depends on the element which has the lowest level of security. Each degree specifies the equipment of the expected intruder. This standard is given by the CSN EN 50113-1 Alarm systems -Intrusion systems -Part 1: General requirements. [2] Every detector has the number which specifies the maximal level of the degree where it can be applied.

Alarm detectors
The detectors can be divided into several groups according to their application. The most common aspect is the environment, where detectors are placed. Detectors can also be divided into the outdoor and indoor according to the environment. This group provides the temperature limit and the International Protection  [9] In general, every detector must be connected to the CIE which periodically evaluates the incoming signal from all connected detectors. Detectors can be connected in several ways depending on situation and environment. This connection can be divided into the analogue, and digital. According to the [4] analogue connection has the maximum amount of connected devices according to the mode. These modes are Normal Closed (NC), End of Line (EOL) and Advanced Technology Zone (ATZ). When the detector is activated, it changes the resistance of the loop, and the CIE can evaluate this event. However, this concept is outdated, and the digital connection is widely used in the alarm application. The digital connection uses one common bus for all detectors and the address system. Every detector has a unique address and direct access to the system. Digital communication can be further divided into the metallic and wireless. However, the wireless connection has several disadvantages, and in the situation with high risk of the intrusion, the wireless connection cannot be used. Detectors using wireless connection must have its power source, and the communication can be disturbed or misused by the potential intruder. The following chapter is focused on the glass-break detectors which are the main subject of this research.

Glass-break detectors
The glass-break detectors are used to detect breaking through the window into the protected room or area. It can be constructed in two different forms. The first one is based on the vibration and the second on the sound and is called acoustic glass-break detector.
The contact detector usually has the shock sensor which can detect the vibration. According to the author [3], the contact glass-break detector employed aluminum foil conductors mounted on the inner surface of glass enclosures and sounded an alarm when the physical event of glass breaking broke the conducting path. In this case, the detector must be mounted right on the glass to obtain sufficient transmission of the vibration. The active device is the piezoelectric sensor having crystal tuned to resonance frequency between 40 and 12 kHz. The sensor ignores the environmental noises in the protected area. The detector must be installed physically on the window and it means that it always be visible to the residents however, it is also visible for potential the intruder and it can act as prevention. The disadvantage is the fact that the detector must be connected by metallic cable and every window must have its own detector. The passive contact glass-break detector can detect intrusion even the alarm foil is applied to the window.

Accelerometer
According to mention information, the detector should be composed of the accelerometer which is used for the scanning. The author [5] mentioned that the accelerometer is a device that measures acceleration, which is the rate of change of the velocity of an object. Generally, accelerometers contain capacitive plates internally by changing capacitance and the acceleration can be determined. The modern accelerometers have built-in Digital Motion Processor (DMP) which lower system power consumption by allowing the system processor to read the sensor data in bursts and then enter a low-power mode as the microcontroller collects more data. Accelerometers with a digital interface can either communicate over Serial Peripheral Interface (SPI) or Two-Wire Interface (TWI) communication protocols. Using these interfaces, the accelerometer can be connected to the main microcontroller.
Most accelerometers will have a selectable range of forces they can measure. These ranges can vary from ±1g up to ±250g. Typically, the lowest the range, the more sensitive the readings will be from the accelerometer. For example, to measure small vibrations using a small-range accelerometer will provide more detailed data than using a 250g range. For the purposes of this research, the smallest possible range is applied. The DPM periodically evaluates the actual state of the accelerometer, and it can send these data to the main microcontroller. These data are already converted to a suitable format of the decimal number which is suitable for further evaluation. Accelerometers can measure acceleration on one, two, or three axes. The DMP produces current acceleration in given direction.

Hardware design
The main component of the detector is the main microcontroller which receives the data from the sensor and also provides communication with the CIE. The microcontroller should have the interface which is compatible with the accelerometer. For the experimental testing, the ATmega328P was chosen as the main microcontroller. According to the author [6], the chip is equipped with 14 I/O pins. Some of these pins support PWM, analogue inputs and/or connecting of a 16 MHz crystal. It also has the TWI for the communication with the accelerometer. The mentioned microcontroller is designed by the Atmel corporation which also provides the programming software called Atmel Studio. The open-source platform called Arduino can also program the microcontrollers from Atmel. Both platforms have features for the successful testing.
The accelerometer for the experiment was chosen the MPU-6050 which is cost-effective and very easy to control. The output of the accelerometer has 6-bit Analog to Digital Converters (ADC) for digitizing the actual state, and these values can be transmitted via the TWI to the main microcontroller. The whole devices should be embedded into a single compact casing for easy placing on the window. It means that the Printed Circuit Board (PCB) must be created. The connection between the ATmega328P and the MPU-6050 using mentioned TWI which uses two wires SDA and SCL. Both wires must be pulled up by the additional resistors to the operating voltage. Here comes the problem with the voltage levels. The ATmega328P operates at 5 V, but the MPU-6050 operates at 3.3 V. Usually the voltage converter is used. However, the accelerometer is 5 V sensitive. That means the MPU-6050 can receive data at 5 V without any damage. Due to different voltages on the PCB, the voltage converted was used.

The main experiment
Before the main experiment, the new devices from the manufacturer must be first tested due to the physical connection. This test should find any of the errors which can be caused by the machine production and soldering. The following test is focused on the power distribution which is done with the laboratory power supply with overcurrent protection. The power supply can protect the components against the damage in case of faulty components or faulty connections. All mentioned steps were done before the programming, and the model seems to operate properly.
After the electronic check, the microcontroller can be connected via the SPI and after it can be programmed. The microcontroller does not need any boot-loader due to the Atmel studio. However, the microcontroller can also be programmed by the data wires that are connected to the terminal. These pins can be used as a Universal Asynchronous Receiver-Transmitter (UART) interface. Due to this fact, the detector can theoretically be programmed from the CIE.
The program itself is structured into the three main parts. The first part is automatically executed when the microcontroller is connected to the power supply. In this part, the microcontroller tests the connection with the accelerometer, and it also sent the request to the CIE. When the accelerometer and respond from the CIE are available, the detector switches in the armed state, and automatically in the second part of the program. The second part is periodically receiving the data from the accelerometer and evaluates it. This process is independent of other events in the microcontroller. The latest one replaces the result of the evaluation. The third part is responsible for the responding message to the CIE. When the CIE send the request, the microcontroller has to interrupt actual process and send actual state to the CIE. According to the [4], there are only four states which can occur: Serenity, Alarm, Failure and Sabotage. Each state is evaluated by the CIE. The standard format of the message is the number of the detector and the number which is representing the actual state.

Recognition of the Influence
After success calibration of the accelerometer, the data represent the real-time acceleration in a given direction.
The idle state is represented by the zero and the other numbers representing the tiny movement of the glass is the window. This deflection can be measured and evaluated by the microcontroller. However, the instantaneous value is not very useful. As mentioned before, there are several phenomena which can be caused by different reasons.
The system should be protected against false alarms using the verification. The program should consider the whole wave of the shock because different phenomena have a different waveform. This function can improve the reliability of the system. When the vibration is detected the system starts recording the waveform, and after a given time the waveform is compared with the saved samples which consist of different phenomena. It means that all possible influences must be simulated and then saved in the microcontroller. These simulations can be found in the following chapters.

Raining
The first influence of the environment is the raining which can create the vibration. This influence has a random wave, and it can be very easily detected. The waveform of the typical rain can be found in the following figure. The function responsible for this evaluation can also be used for the hailstorm. The hailstorm has a similar waveform as normal rain with some little peaks which are in the range of 25 g. This function is not very useful for the IAS, but it can be used for the integrated systems. For example, when the detector detects rain, the system can automatically close the window to prevent flooding. In general, the raining produces only small peaks which are caused by the drops falling on the window. Even the huge hail cannot produce enough energy to trigger the alarm. The next usual influence is the strong wind. The wind can create the specific vibration which can be erroneously evaluated as the alarm. The waveform of the strong wind can be found in the following figure. These vibrations are very easy to recognize. Every force produced by the wind has almost every time the same waveform. The frequency of the wave depends on the dimension and the type of the window. Due to this problem, there must be calibration of levels on each window.

Very strong impact
The most important kind of the influence is the strong impact. This impact can be caused by the intruder, or it can be caused by the other unexpected thing. The system should be able to measure the force and based on the templates decide if the window is in the threat. The typical waveform of the strong impact is in the following figure. The determining is not based on the waveform but it is also based on the maximal level of the acceleration. If the acceleration excesses the threshold level, the detector should trigger the alarm signal.

Real-time operation
To prove reliable operation of the theoretical part, the detector was mounted on the window. The terminal was connected to the computer which is able to process, evaluates and visualize the incoming data. The most important issue is the waveform comparison. In the realtime operation, all evaluations are done inside of the microcontroller. Due to the testing procedure, all data are mirrored onto the computer where the data can be visualized.
The incoming signal from the accelerometer is recorded and evaluated every 3 second. This pattern allows to very precisely exploring the incoming signal. The main program it focused on the pattern of the force. From the pattern can be evaluated the reason of the force. Obtain information can be used in other non-alarm application. There can be some influence which cannot match from any simulated scenario. Furthermore, this problem must be solved. In case of the unknown influence, the detector has the threshold value of the vibration. When this level is exceeded, the alarm is automatically triggered. The detector uses the wired connection for the alarm triggering due to the highest degree of Security mentioned before.

Software evaluation
This chapter contains the evaluating threshold levels which can proceed the incoming data from the accelerometer and it can distinguish between mentioned influences. There are two main variables incoming to the system. The first one is the amplitude of the signal and the second one is the frequency. The maximal level of the amplitude is 200g, everything above this level causes the destruction of the glass and the alarm is triggered immediately. When the amplitude is lower, then the frequency is considered. The frequency is based on the type of distortion.
The first one is raining. This kind of influence has very small amplitude up to 20 g in both direction and the frequency is varying between the 15 and 50 Hz. The frequency is based on the intensity of the rain. The second one is the wind. This influence has a typical frequency between the 5 and 10 Hz depending on the dimensions of the glass frame. The maximal amplitude during the wind is typically 25 and 75 g depending on the force on the window, however, it never exceeds the 100 g. The last one is hitting the window by the object. This force is based only on the amplitude which is exceeding the 100 g is a single short event. In this case, the window is not broken, but there is a big amount of controlled force on the window which is not related to a The incoming signal is analyzed by the main microcontroller which measures two main components needed for the evaluation. The first one is the amplitude which is obtained by the 8-bit ADC. The function calculates the highest number of converted signal and is stores that value for further evaluation. The frequency needed to have some additional component which is called IC74LS14 as a Schmitt trigger. This IC smooth the frequency into rectangular patter and it is more suitable for the microcontroller. The program uses f=1/T formula to calculate the frequency. These two elements are periodically calculated and then passes through the evaluation function. The threshold values are mentioned in the Tab. 1.

Testing results
To prove flawless function all scenarios must be tested on the designed glass-break detector. Special laboratory in Tomas Bata University in Zlin at Faculty of Applied Informatics was created according to the standard CSN CLC/TS 50131-2-7-2: Alarm systems -Intrusion and hold-up systems -Part 2-7-2: Intrusion detectors -Glass break detectors (passive).
The main purpose of the Glass-break detector is to trigger the alarm when the threshold level is exceeded. In this case, only a strong impact without breaking the glass is considered. All mentioned conditions were fulfilled and the main test was done 20-times using 10 models of the glass-break detectors.
Every impact produces the force which is equal to range roughly between 100 and 200 g. This force has proceeded through the program which triggers the alarm. Designed Glass-break detector did not fail during the 20 repetitions and it passed the standard testing sequence. Only five of ten tested detectors are listed in this paper. Other detectors have very similar features.

Conclusion
The main aim of this research was to design and create the glass-break detector using the accelerometer. The detector is constructed according to several standards such as CSN EN 50131-2-8 Alarm systems -Intrusion and hold-up alarm systems -Part 2-8: Intrusion detectors -Shock detectors and the EN 61000-4 Electromagnetic compatibility (EMC) -Part 4: Testing and measurement techniques. These standards guarantee reliable functionality in different environments. The detector also has all necessary function like other detectors on the market.
The main active element for the detection is the accelerometer MPU-6050 which is very reliable and cost-effective. Incoming data are evaluated by the microcontroller ATmega328P. The evaluation is done using the patterns of waveforms which can be created by the environment or intruder. Different scenarios and practical testing can be found in the previous chapters. Testing in the real-time operation proved the flawless and reliable functionality.
The main test was done according to the standard CSN CLC/TS 50131-2-7-2 which proved that the designed detector is qualified for use in alarm applications. The further research can be focused on the not only on the windows but this design can be applied in the other parts of the IAS such as wall or doors. Furthermore, the detector can be extended by the wireless communication, but it will no longer be in the highest level of the security.