Design and Development of a House-Mobile Security System

The objective of this work is to design, develop and implement an alarm system that triggers the alarm and alerts the owner via a mobile text message if the house has been opened or an attempt has been made to open it illegally. The system will also feature two different forms of activation/deactivation and will automatically open or close the door for the user. The advantages of this house-mobile security system (HMSS) are its high security level, robustness, low cost and ease of use (uncomplicated) and that there is no distance limitation for contact. The system integrates different sensors via a microcontroller, which is the brain of the system, in order to avoid the problem of false alarms sent by other alarm monitoring systems to “Alarm Receiving Centers” or Police departments. The HMSS is useful in homes, small businesses, offices, warehouses, etc.


Introduction
The importance of home security has greatly increased in recent years.Let us consider the issue of security around our town of Ciudad Juarez, Mexico.Many houses are burgled mainly by means of illegal entry by force, such as breaking a window or slashing a screen or by entering through an unlocked door or an open window.Consequently, we have seen a trend in the increasing need for home security systems.Early studies have shown that burglaries seldom occur in places where an efficient, secure home security system has been installed [1].
Safety alarms are electronic alarms designed to alert the user of a specific danger.Sensors are connected to a control unit via low-voltage wiring or a narrowband radio frequency (RF) signal which is used to interact with a response device.The most common security sensors are used to indicate the opening of a door or window or to detect motion via passive infrared (PIR).Alarm systems often use wireless techniques for a faster and more economical installation.Some systems serve a single purpose of burglar or fire protection.Systems range from small, self-contained noisemakers, to complicated, multizoned systems with color-coded computer monitor outputs.
Today, home security system manufacturers and alarm monitoring services offer a variety of ways for users to monitor their home's security system even when users are away from their home on vacation or simply away because of work.Modern alarm systems can notify owners of changes in their alarm system status by paging them.While these innovations are certainly useful and offer more peace of mind about home security, they are not the most exciting technologies used in many home security systems.
Many alarm monitoring services now allow users to access their home security system online via the Internet [2][3][4].They can check the status of their system, and even view video in their home if they have installed surveillance cameras [5][6][7].Very advanced alarm systems even allow users to change security codes, lockout security codes and arm or disarm the security system via a web interface.However, there is a new and very popular trend emerging in home security system monitoringmobile devices and telephones.
The integration of the mobile phone and a surveillance system becomes more meaningful so that people can monitor the security of their properties anytime, anywhere.People can access and manipulate uploaded pictures directly by Wireless Application Protocol (WAP) via a mobile phone [8].They can use a gateway to enable the control of consumer electronics devices connected to the home network from a mobile phone; the gateway intermediates are wired between the home network and a wireless communication network using Home Audio Video interoperability (HAVi) and WAP specification, respectively [9].Recently, a video clip system has developed a way to transfer the video stream to a mobile phone through Ethernet from PCs [10].A new kind of wireless image system provides users with the image information by means of a multimedia message service (MMS) [11].
In this work, a practical house-mobile security system (HMSS) is designed and implemented.But why design a home security system when there are already a number of security systems widely available?While it is true that there are some high-quality security systems available, as mentioned earlier, a majority of homeowners, especially in Ciudad Juarez, simply cannot afford to pay for a professional security system.In addition, many homeowners may not feel the need to actually invest in those expensive security systems.On the other hand, most inexpensive home security devices and components are nothing more than cheap and ineffective noise makers.In such systems, false alarms are very frequent and many urbanites tend to ignore alarms rather than investigate, i.e., there may be no response at all.The aim of this work is to fill this gap by presenting a system with a high security level and a low cost.The HMSS solves the problem related to the false alarms found in other systems by integrating different sensors into one unique system.This system is planned to work at a high security level, and is robust, low-cost, uncomplicated, and has no distance limitation.The system is designed to avoid the entry of possible intruders into the house and to alert the owner via a mobile phone text message.It is inexpensive and useful in homes, small businesses, offices, warehouses, etc.

System Design
The House Mobile Security System (HMSS) consists of mechanical, electrical, and electronic components, which are integrated to complete the system design, as follows.

Vibration Sensor
An AK-CGQ-type vibration detector alarm sensor is mounted on barriers and used to detect an attack on the structure itself (door/window).This vibration sensor works based on an unstable mechanical configuration that forms part of the electrical circuit.When movement or vibration occurs, the unstable portion of the circuit moves and breaks the current flow, which produces an alarm.The technology of the sensor varies and can be sensitive to different levels of vibration.The suitable sensitivity of the sensor must be correctly selected based on the working environment as they are best suited to different types of structures and configurations.Figure 1 shows the vibration sensor and its detailed characteristics are presented in Table 1.

Magnetic Sensor
The magnetic sensor includes two strips, one attached to the door and the other to the door frame.A relay switch, in the sensor, is connected to the strips within a wire, as shown in Figure 2. The relay switch is held down to show a "closed" circuit when the two magnetic metal strips touch each other.Once one strip moves away from the other, the circuit is opened and the switch pushes up into the signaling wire.That wire alerts the controller that the circuit is open and then the controller triggers an alarm.The magnetic sensor we used, type DS10A, selfchecks every 90 minutes and is capable of sending radio frequency (RF) signals to any home security system's base receiver.The sensor uses standard AA batteries to provide up to 1 year of operation.2 below.This motor was chosen because its speed and torque characteristics were best suited for our application.

Numeric Keypad
Normally, alarm systems are deactivated or reconfigured when authorized personnel are present.Authorization may be indicated in a number of ways, often with keys or codes used at the control panel or a remote panel near an entry.High-security alarms may require multiple codes, or a fingerprint, badge, hand-geometry, retinal scan, encrypted response generator, and other means that are deemed sufficiently secure for the purpose.Failed authorizations result in an alarm and a timed lockout to prevent "experimenting" with possible codes.In this system, we used a numeric keypad with a USB host interface, as shown in Figure 4.

Relay Receiver Board
A relay receiver board, as shown in The detailed characteristics of the relay receiver board are presented in Table 3 and details of the work are shown in Figure 6.

Power Supply
A power supply with the following features, as shown in Figure 7, is needed for our system.

Motorola C168i Model Mobile Phone
The Motorola C168i mobile phone, as shown in Figure 8, is used for receiving the alarm message.There is a possibility of sending the alarm message to more than one mobile phone.The features of our mobile phone are presented in Table 4.

Microcontroller ATMEL 168
The microcontroller is the "brain" of the entire system and provides the calculations needed to control all the actions taken.Since this microcontroller is "open hardware", there are no licensing or copyright issues [12].The microcontroller used is an Atmega 368 which comes with a development/programming board named "Arduino", as shown in Figure 9.The programming language is very similar to C but includes several libraryies that help in the control of the I/O ports, timers, and serial communication.This microcontroller was chosen because of its low price, ease of reprogramming and simple programming language, and, in addition, interrupts are available for this particular chip.Features of the microcontroller are shown in Table 5.

Housing
The last part of the design is the housing for the system.After all the mechanical, electrical, and electronic equipments were defined, the device was assembled in a firm housing to guarantee the security system and its functionality.The housing design comprises a high-resistance structure that holds the components well.The housing with the complete prototype of the integrated system is shown in Figure 10.

Software Design
As system consists of a hard ware and software, the detailed code of software code is presented in appendix.However, software of different components is presented within system operation and development section in this paper.

Testing and Validation
We considered testing to be a very important part of this work and placed emphasis on conducting it meticulously.
Several tests were carried out to validate the HMSS and its components.The tests covered both the particular elements and the overall system.Firstly all components were tested individually to demonstrate their capability of working properly.After words, the overall system is tested.Since we have three working modules, as described in the next section, we tested these modules using the black-box testing methodology, which involved sending inputs into the module, measuring the outputs and comparing them with the expected outputs.We are not concerned with what happens inside the module.
After each module was completely tested and debugged, the vibration sensor position was tested by placing it in different positions on the door.This test was carried out to determine the best sensing position for detecting vibrations or blows in the event of someone trying to open the door.We placed the sensor in three different locations, top, next to lock and center, and tested the vibration results in each case, as shown in Figure 11.The sensitivity to vibration was low when the sensor was in the next to door position.However, it was high when the sensor was in the top of door position.In the center of door position, the sensitivity was medium, as shown in Table 6.We decided to place the vibration sensor in the center position so that the sensor will detect when someone is trying to open the door and avoid the false alarm in the top position, e.g., a visitor knocking on the door or windy days, or the lower sensitivity in the next to lock position.Figure 12 shows the final positions of the vibration and magnetic sensors attached to the door.

System Operation and Development
The system operation interface is shown in Figure 13 and the system operation flowchart is presented in Figure 14.As shown in Figure 14, the system contains three different modules.In Module 1, the system will send a message to the user's mobile when someone attempts to open the door or when the door has already been opened without the correct password on the keypad or signal by remote control.
In Module 2, the system will lock or unlock the door via remote control.In Module 3, the system will lock or unlock the door by entering a 4 digit password.In short, the door will be opened normally in 2 ways: with the correct password entered on the keypad or with the remote control.It is important to note that it is not necessary to activate both of the systems to unlock the door.The three system operation modules are summarized in Table 7 and then discussed in detail.When the system detects that the door is opened, message 2 will be sent by the magnetic sensor, "Your door is already opened"; in addition, the magnetic sensor will trigger an alarm signal.
The program enables interaction between the microcontroller and the mobile phone and sending the messages in Module 1 is presented in Table 8 with brief explanations for each command.This program sets specific commands for the Motorola C168i, however, it should work with other phones or only need minor changes.
For the vibration sensor, which is an analog input to the controller, we defined the correct parameter as the value of "40".So, if the signal of the sensor is larger or equal to 40, the message will be sent and the program will be as follows.#define PHONE_SERIAL_SPEED 4800 Delay after sending a serial command.It seems the phone needs a moment to process the last command: #define PHONE_DELAY_AFTER_SENDING_COMMAND_VALUE 500 Resets the phone: #define PHONE_RESET_COMMAND "AT*SWRESET" Puts the phone into SMS texting mode, which makes it possible to end messages: s #define PHONE_SET_SMS_TXT_MODE_COMMAND "AT+CMGF=1" Command used to send a message #define PHONE_SEND_MSG "AT + CMGS= 1" Turns OFF the phone's transmitter #define PHONE_TURN_OFF_COMMAND "AT+CFUN=0" Turns ON the phone's transmitter The correct command "AT+CFUN=1" does not work on this phone, o just reset s #define PHONE_TURN_ON_COMMAND "AT*SWRESET" This command will return the battery status (0-100) #define PHONE_BATT_CHARGE_CHECK_COMMAND "AT+CBC" T his command returns the signal strength (0 -30) #define PHONE_SIGNAL_STRENGTH_CHECK_COMMAND "AT+CSQ" Once the settings have been established, the program only needs a simple instruction to have a parameter for both sensors to send the essage.m S erial.println("sending message1"); SSerial2Mobile phone = SSerial2Mobile (RXpin, TXpin); phone.sendTxt("+526561808205", "Someone is attempting to open your door"); delay (8000); a = HIGH;} This value was carefully defined because we just want to sense rough movements or aggressive knocks on the door to avoid false alarms, for example when somebody knocks normally the door.In addition, the program defined a variable to allow a message to be sent only in a determinate time.This is to avoid sending several messages for each second during which somebody is trying to open the door.
For the magnetic sensor, the structure of the program was easier since the magnetic sensor gives a digital input and therefore we just needed to define the text to send the message where the program is as follows: buttonState2 = digitalRead (senialMagnetico); delay (200); if (buttonState2 == LOW) {mensaje2();} In the magnetic sensor, once the message has been sent, we apply some delay for sending a new message.This is because if somebody gets into the house, he/she will probably leave the door open and, therefore, without message delaying, the message would be sent over and over again.Since the remote signal is only 1 or 0 (HIGH or LOW), the controller will have an instruction to do nothing before the first "1" given by the user, meaning that the alarm has been activated and then keeps working to detect the next deactivation and so on.With this signal, the remote control will activate the mechanism that opens the door, as shown in Figure 16.The different conditions for the remote signals are:   During the programming of the microcontroller to acquire the signal from the keypad, we faced some problems with the ports since the controller could not detect the signal from the PS/2 converter because we had a USB numeric keypad.Therefore, we had to design one using common circuits such as flip-flops and a relay to read the password from the keypad.

Cases Magnetic Sensor Remote Signal
In a very high-security system demand, HMSS is designed to be flexible to implement multiple codes, fingerprints, badge, hand-geometry, retinal scan, encrypted response generator, and other means that are deemed sufficiently secure for the purpose.
We improved our HMSS by adding a small buzzer that gives different sound signals when different actions are occurring in the program; specifically, when the program is started, when the door is opened and when the door is closed.We used musical chords to implement these sounds.
Although the HMSS is tested within the range of Cuidad Juarez city (area of 2 million populations), we expect that it will work for larger range (no distance limitation) based on the system monitoring-mobile devices and telephones technology.The integration of the mobile phone and a surveillance system becomes more meaningful so that people can examine the security of their properties anytime, anywhere.
The cost of different components of HMSS and the whole cost of the system is summarized in Table 10.Compared with other systems, the total cost of our system is very low, about 110 USD excluding the mobile phone.By this low cost, high security level, robust, and uncomplicated design system, many homeowners, especially in Ciudad Juarez, may be come to a decision to invest in the security systems.Currently, as mentioned earlier, a majority of homeowners, especially in Ciudad Juarez, cannot afford to pay for a professional expensive security system and they are unconvinced with currently ineffective low cost systems; however, with our new system, we wish we succeeded to provide their needs.

Conclusions
This work presents a house-mobile security system (HMSS) that is able to dial out to a preprogrammed mobile phone number and send a message when the system's sensor detector is triggered.This system is a great device that will provide a sense of security for any homeowner, small business, office, warehouse, etc.The advantages of this system are its high security level, robustness, low cost, ease of use (uncomplicated) and that there is no distance limitation for contact.The system integrates different sensors via a microcontroller to avoid the problem of false alarms sent by other alarm monitoring systems.The system will also feature two different forms of activation/deactivation and will automatically open or close the door for the user.HMSS is flexible to implement multiple codes, fingerprints, badge, handgeometry, retinal scan, and/or other means that are deemed sufficiently secure for the purpose.
alarm-Easy to install-Can be adjusted by the adjustment knob-High sensitivity to detect vibrations2.3.DC MotorThe main function is to open and close the door/window/gates for the user.The DC motor, as shown in Figure 3, provides the conversion of microcontroller signals to mechanical actions.The full detailed characteristics of the DC motor are presented in Table

Figure 5 ,
provides independently programmable control for each of the onboard relays.Relay outputs are used to automatically turn sensors and system devices On/Off.The software interface is compatible with Windows 7/Vista/XP/ME/ 2000/NT/9x and allows users to program and save an infinite number of On/Off sequences.Each relay output is capable of switching resistive loads of up to 1 Amp @ 45 Vac/70 Vdc max and has an LED to indicate its status.

Figure 5 .
Figure 5. Relay receiver board with remote control.

Figure 6 .
Figure 6.Detailed characteristics of the relay receiver board with remote control.

Figure 7 .
Figure 7. Power supply with adapter transformer.

Figure 11 .
Figure 11.Testing different positions for the vibration sensor at: (a) next to lock; (b) center, and (c) top of door.

Figure 12 .
Figure 12.Final position of vibration and magnetic sensors.Table 6. Vibration sensitivity with the sensor in 3 different locations on the door.Position Sensitivity Center Medium Next to the lock Low Top High

Figure 14 .
Figure 14.System operation flowchart.4.1.Module 1: Text Message SendingThe basic function of Module 1 is to send a message to the user's mobile device when someone is attempting to

Figure 15 .Table 8 .
Figure 15.Messages sent to mobile if (a) someone is attempting to open the door; (b) the door has already been opened.Table 8.Program interact the microcontroller with the cell phone and sending messages in Module 1 with brief explanations for each command.

4. 2 .
Module 2: Lock/Unlock the Door via Remote control This module is related to the action taken by the remote control.The remote control normally sends a signal to the main controller to activate/deactivate the alarm and also to open or close the door.It was necessary to assign variables for the different states of the door and the remote control.The signals assigned, as shown in Table 9, include four cases:  C1-Door closed, alarm not activated. C2-Door closed, alarm activated. C3-Door open, alarm not activated. C4-Door open, alarm activated, message sent.

Figure 16 .
Figure 16.Scenario of lock/unlock the door via remote control.

Table 3 . Characteristics of the relay receiver board. Characteristics Value
Resistive Load 1 A, 45 V AC/70 V DC per relay (Relay Datasheet) Relay Connections NO, NC, C (Relay FAQ) Dimensions 113 × 85 × 25 mm approx Specifications Board will accept screw terminal blocks-Key Fob Transmitter Cost 18 USD

Table 10 . Cost of HMSS (excluding the mobil phone). Component Cost in USD
The keypad is connected to the HMSS via a microcontroller, as shown in Figure13, and in turn allows the user to activate or deactivate the alarm system via a 4 digit password.The keypad, as remote control in module 2, sends a signal to the main controller to activate/deactivate the alarm and also to open or close the door.Correct authorization allows to deactivate the alarm and to open the door; however, failed authorizations result in an alarm and a timed lockout to prevent "experimenting" with possible codes.