Home automation and simulation of presence in empty environments

Since their humble beginnings at the dawn of the 20 Century until contemporary age, automation and control systems have grown exponentially in both complexity and importance. Its relevance on human activities, be they mundane tasks or crucial processes, is self-evident. Among its many utilities, automated systems acquire a noble mission when put in service to protect life and property from aggressors of any kind. This paper discusses how home automation components can be utilized to implement an alternative domestic security strategy that consists in simulating the presence of an individual in an empty environment in the absence of its owner in order dissuade potential trespassing criminals, once they would feel highly discouraged to carry the criminal act should they believe the property is occupied.


Origins of automation
Oxford Dictionaries defines automation as "The use or introduction of automatic equipment in a manufacturing or other process or facility" [1].Hence, the main advantage brought by the employment of automated systems lies in the fact that the machines which compose them possess the capability of verifying their own performance and correct processes' missteps without human intervention, in the large majority of cases.Given such scenario, pre-programmed and self-correcting machines can complete their tasks at a much faster rate when compared with manual or non-automated labor.
Earlier occurrences of automated devices include the invention of float-valves to regulate liquid flow in oillamps, wine dispensers and water tanks in primal Greek and Arabic communities, as well as the fabrication of the Ktesibios water-clock in ancient Alexandria [2].Greek temples from the Hellenistic period employed selfanimated mechanical devices denominated as "automata" shaped like humans and animals as part of their liturgical activities [2].By the 17 th Century, Cornelis Drebbel conceived a closed loop control system to operate a furnace, thus creating an archaic thermostat [2].
The first instance of an automatized process in an industrial environment retraces to the late 1920s when Toyota Industries founder, Sakichi Toyoda developed a weaving machine capable of identifying mechanical malfunctions and cease its operation until the problem was solved, thus giving birth to toyotism and inaugurating the era of the "third Industrial Revolution" [3].Since then, the world witnessed an expansion in the use of automated systems that are no longer restrict to factories' production lines but span through multiple commercial, governmental, academic, agricultural, medical and domestic applications [4][5][6][7][8][9].

Automation as security tool
It is an unfortunate fact that densely-populated human societies will invariably be confronted with acts of delinquency perpetrated by criminals, in higher or lowers degrees.However, the use of automated systems as allies of security can help attenuate the lethality and losses brought by criminal acts.Recent security innovations present in the domestic security automation industry include, among many others, smart locks that can be opened via smartphone, wireless video monitoring cameras that can be remotely accessed by the user, sensors kits that are able to notify the owner of invasions or domestic accidents, communication systems that notify constabulary authorities of invasions and criminal acts and even special sensors and devices that cater to specific pet necessities, all these allied with digital displays that give the proprietor complete control over home appliances and security devices in operation.[10,11].
It is noteworthy to mention that advanced home security systems are often expensive and complex.This paper presents an alternative strategy for implementing a system that uses simple home appliances devices whose operation is coordinated by a Programmable Logic Controller (PLC) that will activate appliances at arbitrary times in order to simulate the presence of the owner in an empty residential environment.

Simulation of presence
Professionals from insurance and home protection markets warn and agree that the probability of home invasion occurrences grow a significant lot in vacation periods when families travel and temporarily leave their residences unoccupied, stimulating intruders to carry criminal acts such as invasion and theft.In a Brazilian context, Diuri explains that the number of home theft incidents increases about 30% at the beginning of the year, mostly from December to January, when school vacation time arrives and families start their touristic voyages [12].In the same context, Davini addresses the fact that lawbreakers are often looking for situations where they can minimize their risks to conduct illegal acts with minimum effort, thus vacant residences present an easy and temptating target [13].
With the knowledge that the invasion of an occupied property is generally declined by delinquents, it is patent that simulating the presence of individuals in an empty residential environment holds the potential to decrease the probabilities of the same occurs.Silva, Campos and Lima Filho argue there is a new trend among automation developers that involves mastering the control of electroelectronic appliances in pre-programmed dates during temporal lengths can be used as a tool to increase the security of a precinct, and such systems would have the function of simulating the presence of people in the said precinct to strengthen the security of an environment [14].The following section will describe the authors' proposed presence simulation system as well as its implementation and the details on how the components interact with each other.

System components
The automated system was envisioned as a set of electroelectronic appliances wirelessly connected through Xbee modules to a Raspberry Pi 2 single-board computer.The said appliances include one incandescent light bulb, one audio speaker connected to an Arduino Uno R3 board to play .mp3audio files and a motion sensor to alert the user of possible trespasses.A schematic diagram of the components is shown in Figure 1.A comprehensive list of all components employed in the construction of the system follows:

User Interface
The Android smartphone functions as the interface between the user and the Raspberry Pi 2 board.Through an app developed in MIT AppInventor website, all operations of the system can be controlled by pressing the buttons with the icons that represent the functions they will activate.When the buttons are pressed, the smartphone communicates with the Raspberry Pi 2 board, which in turn will then activate the components via Xbee wireless communication.The functions present in the app are: turning the light bulb on/off, activating the music player (with play/stop/pause and forward/backward buttons), activating the motion sensor (it will notify the user when it detects an intruder) and starting "simulation mode", where the user inputs an initial and final time during which the presence simulation will take place (the light bulb will be on and the Arduino R3 board will start a playlist of songs that will be heard through the speaker).A capture of the interface's initial screen can be seen in Figure 2.

Light Bulb
The light bulb is connected to an electric relay switch which in turn is connected to the Xbee module.As soon as the user press the light bulb icon on the app, the Raspberry Pi 2 board will send a wireless signal to the receiving Xbee module connecting to the lamp, opening the relay switch thus letting the current from the energy grid flow into the lamp, turning it on.When the button is pressed again, the same communication occurs but the relay switch will interrupt the current and the lamp turn off instead.Fig. 2. Capture of the app's initial screen.From top to bottom, left to right: the title: "Security System", the light bulb activation button, the music player icon, the alarm activation button, which reads: "Alarm System Deactivated", an IP camera button for future system expansions, the icon for programming the initial and final moments of the simulation of presence and a last tile with information that reads: "Beginning", "End", "Time", "Activate Vibration".

Music Player
The music player of the proposed system was envisioned as an Arduino UNO R3 board that is connected to a speaker and plays .mp3files through an Adafruit Music Maker Arduino shield.The music files are stored in a 2GB microSD card.The Arduino board is connected to a Xbee module that will receive signals coming from the Raspberry Pi 2 board.When the user press the buttons of the music player icon as well as its functions (play, pause, forward, et cetera) on the app, the Raspberry Pi 2 board will send signals to the receiving Xbee module connected to the Arduino board which is programmed to execute the music player functions according to the signals received.
The signals arrive in the receiving Xbee module as 3-bit packets that will be interpreted by the Arduino board, each combination of bits corresponding to one different operation mode.These include: the previously mentioned "simulation mode", where the Arduino board will command the Adafruit Music Maker shield to execute all of the .mp3files in a row, the "music player mode", where the Arduino board will be set to read the bit packets as codes for the buttons being pressed (play, stop, pause, forward and backward buttons) and the "intimidation mode", where the music player starts executing a fearsome audio file in order to demoralize the trespasser in case an invasion actually takes place."Intimidation mode" shall be further explained in the next subsection.
Due to the low values of current coming out from the TRS audio jack present in the Adafruit Music Maker Arduino shield, it is unwise to connect it directly to the speaker, once the signal amplitude would be too low to produce audible sounds.Therefore, an audio amplifier was included between the Adafruit shield and the speaker to boost the audio signals.

Motion Sensor
Likewise connected to the Raspberry Pi 2 board via Xbee module, one motion sensor was added to the system so it can detect the presence of incoming invaders.If the motion sensor icon is pressed by the operator on the app start screen, it will activate the sensor and its function: should the simulation fail to reach its purpose and the criminal individual decide to persist with the intrusion, the motion will send a signal to the Raspberry board once it detects movement.Raspberry will, in turn, send a message to the user's smartphone through an internet connection notifying him/her that an invasion is taking place.It will also force the system to go into "Intimidation mode", in which all activities of presence simulation or music reproduction are interrupted so a loud and frightful audio file can be executed.This is a last resort to alert nearby neighbours that the property is being invaded as well as to make the lawbreaker realize that his presence has been noticed.

Further System Technicalities
The programming software utilized in the coding of the Raspberry Pi 2 board was Python IDLE 2.0, with Python as the programming language.The software used for compilating the Arduino codes was Arduino IDE, which uses a variant of C/C++ for its functions.The Android smartphone application was developed through an opensource code from MIT AppInventor website [15].
An Arduino Mini board was added between the motion sensor and its respective Xbee module to avoid complications regarding frame multiprocessing given that "Intimidation mode" requires constant communication between the sensor and the Raspberry board.
A hard-plastic case and 9 V batteries were used to encapsulate the motion sensor and provide it with electricity.The Arduino UNO R3 board, which acted as the music player, was also encased and was powered by the common electric grid.
The Xbee modules follow a mesh network topology and have a sensitivity of -102 dBm, therefore the components attached to the Xbee can be spaced apart up to 90 meters (considering no obstacles) from the Raspberry Pi 2 board, which acts as the system's PLC.There is, naturally, a delay time between the pressing of the icons on the smartphone app and the execution of the said function, which amounts to approximately 1 or 2 seconds, depending on the selected icon.

Conclusion
The contribution that advances in automation, fuelled by the pursuit of new ways to increase productivity, brought to all spheres of mankind's lifestyle is undeniable.This paper, focus on one of automation's many fields that experience ongoing expansion: residential security.
As unfortunate as the reality of property breaching might be, there are many devices and systems that are capable to mitigate the number of criminal invasions.This is a niche that has acquired significant relevance and manufacturers' attention, particularly in developing countries that often face challenges like burglary and property vandalism [16].Thus, creative ways of dealing with the aforementioned issues emerge as an answer to attend necessities of home protection and monitoring.
The system presented on this paper was designed, tested and assembled in Mackenzie Presbyterian University's facilities by the authors as a Course Conclusion Work and functioned exactly as described.The modular nature of the proposed system allows it to be expanded by adding more components (those include but are not limited to temperature sensors, gas sensors, glass break detectors, IP cameras, et cetera) to be controlled by the Raspberry Pi 2 board via Xbee connection in order to improve monitoring, if the consumer so desires.For future developments, functionality such as contacting the city's police department once criminal activity is detected is greatly recommended.
In sum, this paper has presented the construction an automated system that explores psychological warfare against criminal intruders and holds the potential to reduce home trespassing in empty environments by making use of presence simulation, deceiving lawbreakers in a non-confrontational, nonviolent fashion.

Fig. 1 .
Fig. 1.Schematic diagram of the proposed system and its main components.Black arrows indicate the direction of the information traffic.