FACTA UNIVERSITATIS Series: Electronics and Energetics Vol. 29, N o 3, September 2016, pp. 451 - 460 DOI: 10.2298/FUEE1603451D A SMART HOME SYSTEM BASED ON SENSOR TECHNOLOGY Boban Davidović 1 , Aleksandra Labus 2 1 Vaimo Norge AS, Oslo, Norway 2 Faculty of Organizational Sciences, University of Belgrade, Serbia Abstract. This paper presents a new approach to utilize technology in a practical and meaningful manner within a smart home system that can be widely deployed into residential settings. In the modern world, people are rapidly turning to technology as a fast and cost-effective way of improving quality of daily living. This primary goal is to address the needs of the end user by employing networked low-power sensors sensitive to the environment, so it can be altered to their liking. The proposed system consists of following steps: direct environment sensing, collecting and analyzing data and then allowing user to customize the settings and initiate specific commands. This research will present the design and implementation of a practical and simple smart home system, which can be further extended. The system is based on: group of sensors, Raspberry Pi device as a server system and Bluetooth as a communication protocol. These devices can be easily controlled via user-friendly interface for Android phones. The main advantage of the proposed system is that it is a sensible, secure and easily configurable system that provides end users with a neat home automation solution. Key words: Smart home, Android, Raspberry PI, Bluetooth, Sensor technology 1. INTRODUCTION Smart home itself does not means smart when the home is built friendly to the environment, how space it uses, or using solar power and recycling waste water, but what makes it smart is the interactive technologies that it contains [1]. A smart home is called "intelligent", because its computer systems can monitor many aspects of daily life [2]. The concept of the smart home is a promising and cost-effective way of improving home care for the elderly and the disabled in a non-obtrusive way, allowing greater independence, maintaining good health and preventing social isolation [3]. Smart home consists of home appliances, sensors, actuators and data processors and analyzers [4]. Home automation of appliances can be either wired or wireless [5]. In this paper model of smart home based on Raspberry PI and Android device is suggested. Mobile application has been developed in order to manage smart home behaviour. The main contribution of this paper is that it presents easy to implement, Received June 12, 2015, received in revised form September 13, 2015 Corresponding author: Boban Davidović Vaimo Norge AS, 0484 Oslo, Norway, Nydalsveien 12 (e-mail: bobanbobanboban87@gmail.com) 452 B. DAVIDOVIĆ, A. LABUS flexible and scalable solution for making a smart home environment. Smart home system presented in this paper is based on mobile device, because of constant growth of smartphones and tablets usage. 2. LITERATURE REVIEW Smart home is defined as a home that has programmable electronic controls and sensors that regulate heating, cooling, ventilation, lighting, and appliance and equipment operation in a way that responds to interior climate conditions in order to conserve energy [6][7]. Smart homes use home automation technologies to provide homeowners with intelligent feedback and information by monitoring many aspects of a home on daily basis [8]. Main elements of smart home [9][10]: 1. Internal network – wire, cable, wireless. 2. Intelligent control – gateway to manage the systems. 3. Home automation – products within the homes and links to services and systems outside the home. The range of different smart home technologies available is expanding rapidly along with developments in computer controls and sensors [11]. Smart homes present exciting opportunities to change the way we live and work, and to reduce energy consumption at the same time [12]. There are already various implementations of smart homes. Most of the implementations use wireless technologies for communication between home appliances and main unit [13]. The main problem that people are trying to solve in smart home is how to make a home that will help people to automate regular daily activities [14]. For example, like adjusting home temperature, ensuring that home has enough daily light and make home secure. Lead with this idea, people developed smart homes based on different technologies [15]: 1) Smart home based on custom microcontroller and mobile application [16]. Smart home system is using Bluetooth for communication between mobile application and system. It depends on the controller that it is using. Some microcontrollers are used more than others, which makes those smart home systems more flexible. 2) Smart home based on a custom microcontroller and computer [17]. Smart home system is using Bluetooth for communication between appliances. It is based on a computer as entry point for communication between user and smart home system. Computer is connected using wire to the microcontroller. 3) Smart home based on Arduino and mobile application [18]. Smart home system is using Bluetooth for communication between mobile application and Arduino. This system is flexible and scalable. Limitation of this system is Bluetooth range. 4) Smart home based on a computer [19]. Smart home system is using Wi-Fi for communication between appliances and main computer. Main computer is communicating with appliances through microcontroller. Main advantage of this system is that unlimited number of appliances can be connected to it. Some of the solutions mentioned above use Bluetooth for communication between main computer / microcontroller and appliances. Also, some of the solutions are based on remote control using mobile phone, which also use Bluetooth for communication between mobile and main computer. Smart homes today offer similar functionality to the end user. That functionality is based on the following [20]: A Smart Home System Based on Sensor Technology 453 1) Integration with smart appliances. 2) Integration with sensors for tracking conditions in smart home. 3) Single point of control for the whole smart home. 4) Remote control of smart home [21]. In the research the authors [22] analyzed smart home system based on ATmega microcontroller and Bluetooth technology. This system is based on two main parts. First part is mobile application based on Android platform. Second part of the system is an electronic circuit board that is used for controlling. First usage scenario is when Android application is used for communication with an electronic circuit board using Bluetooth as communication channel. Android application required for usage in this system can be downloaded free of a charge from Google Play (Android application market). Electronic circuit board consists of a microcontroller, a Bluetooth module, relay driver IC along with relays which are used to switch electrical loads on the circuit and to switch power supply. Android application sends a command which is received by Bluetooth module and forwarded using USART serial interface to the microcontroller that performs necessary actions. The microcontroller that is used in this system is ATMEL's ATmega 128, high performance and low power RISC architecture based 8-bit MCU. The operating voltage of this microcontroller is 5V. Voltage regulator (LM78055) is used to get the desired voltage on this device [22]. The main advantage of this system is that it is system that is easy to use and setup. The most important disadvantage of this system is that it is limited to Bluetooth usage, so, it has limitation of Bluetooth range. In another research the authors [23] analyzed Android based smart home system based on Bluetooth and Arduino. This system is based on Arduino micro web server as the main controller. It suggests usage of mobile application based on the Android OS. It uses Bluetooth and RESTful based web services as interoperable layer. This home automation system is feature rich and it enables some advanced features, as user authentication, Bluetooth and Internet connectivity, security, fire system with siren and email alerts and automated control of home appliances. The main controller is Arduino micro web server that contains Arduino Mega 2560 device and Arduino Ethernet Shield. It also includes other hardware, such as the siren nRF24L01+ radio module, which is used in order to communicate and coordinate actions with the other sensor nodes within the environment and the Bluetooth module. The system base usage is to control security and surveillance, door locks, gate control, fire detection and intrusion detection with alarm and notifications. It also allows user authentication for accessing the smart home system, it provides smart energy management and home environment control [23]. The main advantage of this system is that it is flexible and scalable solution, because it is based on Arduino. The most important disadvantage of this system is that it is limited to Bluetooth usage, so, it has limitation of Bluetooth range. This paper shows a project for monitoring, tracking and analyzing a smart home. These values can be read on Android mobile device and via website that reads the values from the cloud. All smart appliances are connected to the same network, using Wi-Fi router and are communicating with main computer in the system – which is Raspberry PI device. All sensors are connected directly to the Raspberry PI device, and Raspberry PI device is collecting all information from sensors and is sending that information to the cloud, using existing Wi-Fi network. That means that the values on the cloud will show real time stats, which are collected on the sensors. Also, the same information is sent to Android mobile device. User is able to monitor different factors read in the system, like: temperature, humidity, amount of light, smoke density, etc. This gives user a clear picture, how are the conditions in the smart home. If user in the radius of 100m from the server, 454 B. DAVIDOVIĆ, A. LABUS user is able to send commands to the Raspberry PI device directly via mobile phone. If user is not within 100m, user can use mobile to send commands to the Raspberry PI device, and that communication is done via cloud (which is communicating to the Raspberry PI device). 3. MODEL OF SMART HOME SYSTEM BASED ON RASPBERRY PI AND ANDROID DEVICES This paper presents the model of smart home system based on Raspberry PI and Android device. The system is designed to be scalable and easy to setup and extend. It is based on powerful Raspberry PI microcomputer. It includes sensors for listening of the environment and appliances that are controlled via Android device. Fig. 1 Model of smart home system based on Raspberry PI and Android device. There are six main parts of the system (as shown on Fig. 1): 1. Group of connected sensors. 2. Raspberry Pi device that acts as a server system. 3. Android device as a remote client. 4. Wi-Fi router as device which communicates to the cloud. 5. Smart home appliances. 6. Cloud server which is used for storing data for analyses. 3.1. Components and technologies In the ever-changing technology trends a few components are being used in an attempt to make a more efficient, powerful and user-friendly smart home system. The components and technologies used for development of this smart home system are: A Smart Home System Based on Sensor Technology 455 1. Raspberry PI. 2. Android. 3. Bluetooth. 4. Sensors. The Raspberry PI is a small, barebones computer developed by The Raspberry Pi Foundation, a UK charity, with the intention of providing low-cost computers and free software to students. The allure of the Raspberry Pi comes from a combination of this powerful device’s small size and affordable price and that makes it perfect for use in developing countries and pretty much every institution that has a need for a low cost programming solution. Raspberry is fully programmable and it acts as the core of our home automation system. It communicates with sensors that collect the data [24]. Android is a mobile operating system (OS) currently developed by Google. It is used worldwide in majority of smartphones and tablets on the market today. It allows users access to Google services (YouTube, Google Search, Google Maps, Gmail, etc.) and offers a tremendous amount of apps, which make it so popular. It is primarily designed for touchscreen input, but it has also been used in game consoles, regular PCs, digital cameras and other new age technology. Nowadays, mobile phones usually are using Android operating systems [25]. Bluetooth technology is considered to be more practical inside smart home system than other technologies for a few reasons. The main advantage is that it tends to be cheaper since it's widely used for quite some time. Bluetooth also tends to works faster in practice than other technologies because it doesn't have to go through a hub so the commands can be executed without any kind of lag. It also has higher data bandwidth than ZigBee and Z- Wave (though lower than Wi-Fi), allowing Bluetooth-enabled products to do more than simply flip a switch or report movement [26]. The new version of the technology will utilize mesh networking, meaning that one Bluetooth radio can extend the distance it communicates by using the nearest other Bluetooth radio. That would allow to users to just put a few Bluetooth smart bulbs in his house and get a house-wide coverage. And Bluetooth LE, which stands for “low energy,” is a newest version that uses very little power in comparison to Wi-Fi. This is very important for devices such as portable light switches and door locks because they don't have ready access to a power outlet. The home automations system starts with sensors, devices that detect and respond to some type of input from the physical environment. They can sense things like window and door contact, the presence of person (for lighting control, heating, security), movement, humidity, temperature etc. Sensors used in our example include generic, light, motion, sound, humidity and temperature. It's possible to add more sensors, but even with just these the system is very universal, flexible and versatile. For example, temperature + humidity sensor can be used as a plant monitor to let the end user know when it needs water, as a leak detector in the bathroom or even be placed on clothesline to send an alert when the laundry is done drying. Then, couple the temperature sensing with light and the results can be a light-based alarm that sends user a notification when the sun rises, or even a security system that will alert when a light comes on while there's nobody home. And a simple temperature and motion sensing can be used as a baby monitor, fridge or window alarm. There is a plethora of potential uses and it is perfectly customizable. 456 B. DAVIDOVIĆ, A. LABUS 3.2. Example of scenario and response procedures The main purpose of a proposed home automation system is to be able to read values from sensors within smart home and send commands in order to customize those values, tailoring them to the end user's specific needs. That way, this system will help in providing better living environment for the user, and will help user to make his stay in his home more comfortable. Raspberry PI device is used to control flow between mobile device and sensors (and connected actuators). For our system we used model B, which works on 700 MHz ARM processor and 512 MB RAM. Raspbian OS is used on Raspberry PI and the server running on Raspberry PI device is written in Python - since Raspberry PI has Python already installed on it. Our server contains few separate threads: 1. Thread for direct communication with sensors and for collecting data. 2. Thread for communication with mobile device for sending data. 3. Thread for communication with mobile device for receiving orders. 4. Thread for sending orders to connected smart home appliances (communication via local Wi-Fi network). 5. Thread for sending data to the Cloud. Fig. 2 Main screen of Android application that is used to control smart home. Android application contains following functionality (Android application is shown on Fig. 2 and Fig. 3): 1. Pairing with Raspberry PI server (via Bluetooth protocol). 2. Sending commands to Raspberry PI server. 3. Receiving data from Raspberry PI server. 4. Receiving data from smart home appliances. 5. Sending data to smart home appliances. 6. Sending data to the Cloud. A Smart Home System Based on Sensor Technology 457 Fig. 3 Reading values from sensors and sending commands to home appliances via Android application. Communication between the server (Raspberry PI) and devices (smart home appliances) is done over Wi-Fi network. It is necessary that Wi-Fi router is part of this system. All requests can be also monitored over cloud, as server is sending all information / communication details to the cloud storage. Wi-Fi is used only for communication between Raspberry PI and home appliances. For communication between mobile phone and Raspberry PI, Bluetooth protocol is used. Whenever mobile phone is in the Bluetooth reach, Android application is using Bluetooth for communication with Raspberry PI device. If mobile phone is not close to the Raspberry PI, all commands and data are sent via cloud. Raspberry PI monitors values that sensors detect in the house and sends requests to the Raspberry PI server for calling actions that will be directed to actuators connected to Raspberry PI and smart home appliances that are communicating with Raspberry PI wireless, using Wi-Fi. In this scenario, Raspberry PI is a server that handles all requests. It is used to receive information from the sensors, process that information and deliver processed data to mobile device. Also, Raspberry PI is used as a server in the other direction, when user uses mobile phone to send commands and change the environment in our smart home. This system is providing end customer with following actions:  Reading data from sensors and showing results of readings on Android device.  Sending direct commands to the actuators and smart home appliances.  Collecting reports from smart home appliances.  Processing data with Raspberry PI device and uploading it to the Cloud (via Wi-Fi).  Once collected in the Cloud, collected data can be further analyzed.  Automatic adjusting of the living environment based on the set preferences (via Android application). This system is intended to allow following features to the end users: 1. Users can monitor and track values that are read via sensors. Raspberry PI device is collecting values that are read on the sensors. These values are sent to the mobile phone and uploaded to the cloud. If mobile device is within Bluetooth 458 B. DAVIDOVIĆ, A. LABUS range from the Raspberry PI device, Bluetooth is used for communication between these two devices. If mobile device is not within Bluetooth range, then Raspberry PI is communicating with Android application via cloud. Android application is reading the real time values from sensors. 2. Users can send commands to the Raspberry PI device. Users can communicate to the home appliances and other actuators via Android application. Users are allowed to completely control smart home system only using mobile device. Because of that, user can make his home more comfortable and user can prepare his home, before he comes home. The whole communication is done via Bluetooth or cloud. The main objective of the proposed system is to allow cheap and reliable smart home system that can control and automate home appliances using Android device as a remote controller. Main advantages of proposed system, compared to other systems:  Controlling whole smart home using simple remote device. This is especially useful for large homes, where it's not necessary to check each room separately.  Savings made in adequate usage of power, as well as added efficiency and time savings.  Scalable, so it can be used to communicate to numerous devices and other types of smart environments.  Data can be monitored and controlled real-time and always available everywhere via cloud server. 4. DISCUSSION Many studies showed how using Bluetooth technology in a smart home system is optimized way of communication between home appliances and smart home controlling device. The "brain" of smart home system can be different microcontroller as it is shown in smart home system based on ATmega microcontroller [22] or Arduino microcontroller [23] or any other custom made microcontroller with Bluetooth transmitter and receiver. These systems are focused on the same topic and they are trying to solve the same problem as in this paper, and that is, how we can make easy adjustable, scalable and configurable system that will help people to feel more comfortable in their homes. The main advantage of the proposed system is that it is a flexible and scalable system, but also powerful, and easy to implement solution. Also, system is based on Raspberry PI device and there are many different sensors that can be easily connected to this system. Communication between main system that controls sensors and mobile device is secure and fast. System gives user opportunity to have history of all actions that were sent to actuators. The main focus is given on the two ways of communication between user and smart home – via Bluetooth (while person is in the Bluetooth range) and via cloud (while person is not in Bluetooth range). All communication is done via mobile phone, and it uses similar approach as described in several different studies [16][17]. We acknowledged that the proposed solution has also some limitations. The main disadvantage of the proposed system is limitation of Raspberry PI device, that has defined maximum number of directly connected sensors. This limitation can be overridden by adding extensions to Raspberry PI device, which will allow users to connect more sensors to it. The proposed system is also easier to setup and configure for small to medium size A Smart Home System Based on Sensor Technology 459 homes, because of the limitation of Bluetooth signal. This disadvantage can be overridden by setting multiple Bluetooth receivers in the smart home. 5. CONCLUSION Smart home consists of different features that are oriented to individual users of the smart environment. The range of options that can be adjusted for user is wide. Current trends in home automation includes remote mobile control, wearable devices, automated lighting, automatic temperature adjustments, energy management, mobile or email notifications, streaming media, remote video surveillance and much more [27]. Home automation systems are also perfectly useful in residential settings of elderly or disabled, where they aim to support autonomous living [28]. And, like most technologies, smart homes technology improves with age. It gets smarter, less expensive and easier to use each year. The smart home system can provide a kind of easier, ordered and effective life style to human, and must be the development tendency for future inhabitancy mode [29]. With new smart technology inventions popping up on every corner, the future of smart home is bright and rapidly expanding. At the moment of writing, one of the most advanced smart home technologies relies on Bluetooth as a communication protocol and Raspberry Pi as a server. The ease of use, safety and the seamless integration of this technology, although on a high level already, can and will be only improved with time. Some of the trends that are bound to take over the newest generation of smart homes are cloud based smart environments, even cheaper and versatile sensors, push notifications for just about anything, bigger control and more functionality. Also, it is expected that soon our homes will even be able to distinguish between family members by fingerprints, heart rate and body temperatures so they can adapt to each individual’s needs [30]. We will be able to use everyday objects as our personal helpers and they will be incorporated in our homes in a non-intrusive way. With both sensors and devices approaching free and sizes approaching invisible, we are about to enter the age of smart everything. Acknowledgement: The authors would like to thank to the Ministry of Education, Science and Technological Development, Republic of Serbia, for financial support project number 174031. REFERENCES [1] R. Harper, ''Inside The Smart Home: Ideas, Possibility and Method'', Inside the smart home, pp. 1-13, 2003. [2] B. Hamed, ''Design & Implementation of Smart House Control Using LabVIEW'', International Journal of Soft Computing and Engineering (IJSCE), Vol. 1, No. 6, January 2012. [3] B. Henkemans, A. Olivier, L. Laurence, D. Adrie, ''Aging in Place: Self-Care in Smart Home Environments'', Smart Home Systems, INTECH Open Access Publisher, pp. 105-120, February 2010. [4] H. Ghayvat, S. Mukhopadhyay, X. Gui, N. Suryadevara, ''WSN- and IOT-Based Smart Homes and Their Extension to Smart Buildings'', Sensors 2015, Vol. 15, No. 10350-10379, May 2015. [5] W.S. Lee, S. H. Hong, ''Implementation of a KNX-ZigBee gateway for home automation'', In Proceedings of the IEEE 13th International Symposium Consumer Electronics ISCE '09, pp. 545-549. [6] E. Burden, ''Illustrated Dictionary of Architecture'', The McGraw-Hill Companies, Inc., 2012. [7] W.D. Werff, X. Gui, ''A mobile-based home automation system'', In Proceedings of the 2nd International Conference Mobile Technology, Applications and Systems, 2005, pp. 1-5. 460 B. DAVIDOVIĆ, A. LABUS [8] D. Bregman, ''Smart Home Intelligence - The eHome that Learns'', International Journal of Smart Home, Vol. 4, No. 4, October 2010. [9] R. Teymourzadeh, S. A. Ahmed, K. W. Chan, M. V. Hoong, ''Smart GSM Based Home Automation System'', In Proceedings of the IEEE Conference on Systems, Process & Control, 2013, pp. 306-309. [10] R. J. Robles, T. H. Kim, ''Applications, Systems and Methods in Smart Home Technology: A Review'', International Journal of Advanced Science and Technology, Vol. 15, February 2010. [11] D. Ding, R. A. Cooper, P. F. Pasquina, L. F. Pasquina, ''Sensor technology for smart homes'', Maturitas the European Menopause Journal, Vol. 69, No. 2, pp. 131- 136, June 2011. [12] M. Xu, L. Ma, F. Xia, T. Yuan, J. Qian, M. Shao, ''Design and Implementation of a Wireless Sensor Network for Smart Homes'', In Proceedings o the Ubiquitous Intelligence & Computing and 7th International Conference on Autonomic & Trusted Computing (UIC/ATC), October 2010, pp. 239-243 [13] N. Sriskanthan, F. Tan, A. Karande, ''Bluetooth based home automation system'', Microprocessors and Microsystems, Vol.26, pp. 281-289, May 2002. [14] M. Li, H. J. Lin, ''Design and Implementation of Smart Home Control Systems Based on Wireless Sensor Networks and Power Line Communications'', Industrial Electronics, IEEE Transactions, Vol. 62, No. 7, 2014. [15] J. Xiao, R. Boutaba, ''The Design and Implementation of an Energy-Smart Home in Korea'', Journal of Computing Science and Engineering, Vol. 7, No. 3, pp. 204-210, 2013. [16] R. Piyare, M. Tazil, ''Bluetooth Based Home Automation System Using Cell Phone'', In Proceedings of the IEEE 15th International Symposium on Consumer Electronics, June 2011, pp. 192-195. [17] R. A. Ramlee, M. H. Leong, R. S. S. Singh, M. M. Ismail, M. A. Othman, H. A. Sulaiman, M. H. Misran, M. A. Said, ''Bluetooth Remote Home Automation System Using Android Application'', The International Journal of Engineering And Science (IJES), Vol. 2, No. 1, pp. 33-43, 2013. [18] M. A. L. Mowad, A. Fathy, A. Hafez, ''Smart Home Automated Control System Using Android Application and Microcontroller'', International Journal of Scientific & Engineering Research, Vol. 5, No. 5, pp. 935-939, 2014. [19] D. Yuan, S. Fang, Y. Liu, ''The design of smart home monitoring system based on WiFi electronic trash'', Journal of Software, Vol. 9, No. 2, pp. 425-428, 2014. [20] D. Retkowitz, S. Kulle, ''Dependency Management in Smart Homes'', Distributed Applications and Interoperable Systems Lecture Notes in Computer Science, Vol. 5523, No. 0302-9743, pp. 143-156, 2009. [21] Y. Zhai, X. Cheng, ''Design of smart home remote monitoring system based on embedded system'', In Proceedings of the IEEE 2nd International Conference Computing, Control and Industrial Engineering (CCIE), 2011, pp. 41-44. [22] M. Rana, R. Singh, ''Smart Homes for a better living using Bluetooth communication based on ATmega Microcontroller'', International Journal of Research in Engineering and Technology, Vol. 3, No. 6 pp. 210-213, 2014. [23] S. Kumar, S.R. Lee, ''Android Based Smart Home System with Control via Bluetooth and Internet Connectivity'', In Proceedings of the 18th IEEE International Symposium on Consumer Electronics, June 2014, pp. 1-2. [24] M. Richardson, S. Wallace, "Getting started with Raspberry PI", December 2012. [25] E. Smith, "Small Tablet Vendors Gain Ground in Q1 2015, says Strategy Analytics: Apple and Samsung led 8 percent year-on-year contraction of Tablet market" (Press release), Strategy Analytics, May 2015. [26] J. H. Shin and D. Park, ''A virtual infrastructure for large-scale wireless sensor networks'', Computer Communications, Vol. 30, No. 14-15, pp. 2853-2866, 2007. [27] P. Vigneswari, V.Indhu, R.R.Narmatha, A.Sathinisha and J.M.Subashini, ''Automated Security System using Surveillance'', International Journal of Current Engineering and Technology, Vol. 5, No. 2, pp. 882-884, 2015. [28] L. Liang, L. Huang, X. Jiang, Y. Yao, ''Design and implementation of wireless Smart-home sensor network based on ZigBee protocol'', In Proceedings of the International Conference on Communications, Circuits and Systems, ICCCAS 2008., pp. 434-438. [29] . Chana, E. Campoa, D. Est vea, . . Fourniolsa, mart homes - Current features and future perspectives'', Maturitas the European Menopause Journal, Vol. 64, No. 2, pp. 90-97, October 2009. [30] F.Adib, H. Mao, Z. Kabelac, D. Katabi, R. C. Miller, ''Smart Homes that Monitor Breathing and Heart Rate'', Massachusetts Institute of Technology – In Proceedings of the 33rd Annual ACM Conference on Human Factors in Computing Systems, 2015, pp. 837-846.