A Proof of Concept for Home Automation System with Implementation of the Internet of Things Standards

Who does not want a home having comfortability, security, safety, and reliability? A system of interconnected devices and sensors with internet of things standards can communicate independently with less or no human interaction. With such a system, everyday tasks (e


Introduction
How to get a convenient control of our home at our fingertips through a remote controller (e.g., smartphone, iPad, laptop, and etc.) while we are either at home or out of home?How to track [1] and get an alert [2] every time someone enters into our home?How to save the money that comes from the lights left on when we are not at home?How to reduce the spending money for household appliances left on in our family's absence?How to save the wasting money that comes from the gas to drive home because we forgot to lock the door?How to get rid of the reliability on our neighbors to watch our most valued possessions or feed the plant or take care of our dog or deliver the mail at home when we are out of country?How to adjust the uncomfortable temperature at our home remotely, e.g., when we leave home in the morning with comfortable temperature but after returning we would find a sweltering or too cold home?How to get peace of our mind without worrying our home stuffs, e.g., if we turned of the lights, locked the door, oven flipped off, turned off the iron, or turned off the television?How to control a common situation -if we leave to work before our children leave for school as well as our children may run out the door to catch the bus and forget to lock the door -from our office everyday?How to make sure no unwelcome guests arrive unbeknownst to us or our family either at specific times of the day or night?How to adjust the thermostats of our home from the convenience of our office a few hours before heading home?How to get ensured that we are consuming the energy and resources merely that are necessary while we are at our home?How to make a relax mode by being able to see what is going on at home without physically being there?How to use our precious time and experience more productively and easily everyday without thinking home stuffs?A home automation system uniquely solves all of the aforementioned problems.The home automation for many years was a customary science-fiction subject.A lot of movies and books reconnoitred in theory miscellaneous technologies for decades.Aside from, today we live in the world that empowers us to build a variety of automation systems without much difficulty as compared to just a couple of years back.Figure 1 (a) exhibits a smart home with its various automated functional units.Home automation is a concept of controlling and automating everyday tasks as well as needs.This process involves centralizing the control logic for various devices and electrical components in the house ranging from light bulbs to more sophisticated devices like heating/cooling units, windows, and doors [3].The list of devices that fit in home automation sector is always growing.Gartner, a world leading information technology research company, noted that approximately 5 billion Internet of Things (IoT) devices were connected via internet in the year of 2015 without any others being included.Moreover, they predicted that about 25 billion devices will be connected by the year of 2020.It is fair to note that their prediction is among the lowest as compared to some others in the market [4].General idea of home automation is probably very old, however, first functional prototypes were started developing some half a century ago.Yet real progress in the industry has been made little over a decade back [5].With the technological revolution in the early 2000s, many IoT devices emerged promising aid in normal tasks and regularly making our lives unhurried and relaxed.According to NPD Group in 2013, 93% of households in the USA were connected with internet and owned at least one personal computer.Around 60% households owned smart-phones and tablets [6].All these numbers together with perpetually rising demand for new devices become a solid ground for home automation to be the following big thing.It is worth a mention that the European markets for home automation based systems are a bit behind than North American markets [7].
Our key effort of this paper is to bring closer the idea of taking remotely control over various independent and distinct operations throughout our living units, whether it is an apartment or a house or any other sort of a living space.The theoretical part of this topic is not something very new.In fact, almost any technological advancement in our history is driven with motives to make everyday life easier which in contrast can be very toilsome to implement.The amount of features and different aspects of the system greatly impacts the design, implementation, and hardware requirements.Consequently, this paper focuses mainly on making life easier aspect of a home automation system.At least mention or somewhat debate distinct prospects of home automation system has been discussed.In addition to different aspects of the home automation, it is notable to observe that the system design and implementation may be quite dissimilar in two special scenarios.Unambiguously, the design and implementation processes differ notably between two scenarios: (i) developing a system autonomously on the top of an existing household construction; (ii) developing a system alongside the construction and/or architecture of the household.The latter case is better, because it is free of construction obstacles.As a result, to develop a system along with the construction and/or architecture of the household is highly recommendable.In such development both design and implementation are comparatively easier to obtain.The whole development steps go smoother as we are free to choose both devices and communication protocols.To design any kind of home automation system, it is momentous to focus on hardware, software, and communication protocol.Although IoT devices or the targeted devices in the household are the crucial part of our implementation, it is not going to specify different brands or special types of devices.On the other side, the choice for hardware in our implementation is the Arduino open-source electronics platform.The control logic is driven by the Arduino ATmega2560 microcontroller.But it is important to notice that any similar architecture (e.g., Microchip PIC microcontroller) could be used to achieve the same goals.Because of the IoT and home automation popularity, numerous communication protocols are already well-established in the home automation arena.Among them Jablotron, ZigBee, and X10/Z-Wave are somewhat popular [8].Most of these protocols are proprietary communication protocols and in the scope of our implementation.It has been focused on developing a simple communication between the user and the home automation system (see Figure 1 (b)) across the network either locally or publicly.This effort requires port forwarding to be accessible.This allows us to use the ATmega2560 as the brain behind the curtains, controlling the devices that are communicating and reporting with it.On the other hand, an interface which allows the user to setup a friendly environment and also to have an overview of the whole system visually in one place.There are various ways of reaching internet from microcontroller driven system.Commonly used in embedded systems are Wireless and Bluetooth technologies.In our implementation, the Ethernet controller has been used.At different times during our development, it has been tried to use other technologies too.Notwithstanding, after one burned the ESP8266 module and couple of faulty sensors, we gave priority on the reliability of our system.But this can be reviewed in the future plans because the ESP8266 module itself is a very powerful device capable of running other devices as it has more than couple of digital I/O pins depending on the module version [9].Since our implementation is not limited by the design of the living units, it offers a lot of room for detailed and well organized smart home system.It is a POC 1 , thus it bears high potential for miscellaneous real world applications.The rest of the paper has been organized as follows.Section 2. argues the building blocks of our proposed home automation system.Section 3. confers specific technical details of our case.Section 4. consults our implementation in details.Section 5. provides brief discussion and evaluation of our achievement followed by some hints for future works.Finally, Section 6. makes conclusion.

Building Blocks of Our Home Automation System
Our home automation system is based on a microcontroller and IoT logic in accordance with Kyas [10], a renowned expert in communication technology and strategic marketing.From a technical perspective the home automation can essentially be wrapped into five building blocks [10]: (i) Devices Under Control (DUC); (ii) Sensors and actuators; (iii) The control network; (iv) The controller; and (v) Remote control devices.Taking into account these building blocks, our home automation system can be derived as shown in Figure 1 (b).
• DUC: This group of all home appliances that are affected by the home automation system, in our development this corresponds to lights and HVAC (Heating, Ventilation, Air Conditioning).
• Sensors and actuators: They are sensors that allow us to sense and monitor stuffs.For example, it usually senses by being in the room but in this case we want to be able to have the same senses remotely and even log in it for statistical data.These will be our eyes and ears even when we are not present at home.It has been used the BMP280 Temperature/Pressure/Humidity sensor along with motion detection sensor, MQ-2 Smoke/Gas detection sensor, etc. Beyond, actuators are the mechanical devices such as servo motors and dimmers have been used to control the light system.
• Control network: It provides implementation of the connection between the main controller (in our case ATmega2560) and the DUC, sensors as well as actuators.It allows to access the system remotely.
• Controller: It is essentially the brain of our home automation system.It runs core logic and IoT bundle.It has been used Atmega2560, a microcontroller from Atmel, usually found in Arduino Mega2560 microcontroller board [11].The solutions of modern home automation are typically run on embedded Linux or another operating system.Such systems are usually driven by uninterruptable power supplies, which add reliability and availability of the system [10].
• Remote control devices: In our case, this block corresponds to a HTML based control panel webpage.It is also accessible through the smart phone or a tablet.The remote control adds a whole new perspective within our home automation system.With smartphone or iPad or laptop enabled remote control, there is no need for a dedicated automation control for each device [10].Instead it is accusable to all the relevant parts of the system from one place.
Throughout the paper, it has been discussed how each of these devices communicates with the main controller and hence providing a POC for home automation system.Figure 2 gives expression to the devices and sensors organized in the house model used for our case.

Technical Details of Our Implementation
Our aim is to focus on a working home automation model with a POC.With this vein, both hardware and software based on a fictional layout of living units have been designed.It gives us feasibility and freedom in choice of the hardware, appliances/devices, and most importantly communication protocol.It simplifies couple of major features of the home automation system including the whole security aspect of the system itself.Its technical details cover both hardware and software used in our home automation system.All software technologies that were used in our development steps are open-source and free technologies.As a result, all features can be reproduced in almost any environment.

Software aspect
Aside Arduino platform, it would be expected to achieve at least the same results using Microchip PIC Microcontroller and more robust peripheral sensors and devices.Nevertheless, Arduino has shown the most flexible and feasible solution by providing excellent results for our case.

Arduino and C++ libraries
Arduino platform furnishes its own IDE (Integrated Development Environment), compiler, and basic libraries which normally translate any standard C/C++ code [12].It also gives key editor functions including software upload to the microcontroller.In our case, various open-source libraries have been used to get fully intended  functionality.Some of those include the LCD (Liquid Crystal Display) library that is very useful to quickly setup 16 × 2 (16 columns, 2 rows) LCD using inter integrated circuit (I 2 C) communication protocol.

Inter Integrated Circuit (I 2 C) bus
The I 2 C bus is a standard communication protocol, designed to be used with multiple slave and master digital devices, where master device is the device that manages the communications with one or many slaves [13].
One of the best perks of I 2 C bus communication is that it uses merely two wires.Figure 3 displays our I 2 C implementation to automate our home model.

Serial Peripheral Interface (SPI) bus
The SPI is another communication protocol that in contrast to I 2 C uses 4 wires to operate communication [14].
But it is preferred to use I 2 C protocol because it provides all what we need for our implementation with less wiring.Yet it is ended up by using RFID Card/Tag reader that uses SPI bus.The reader is very feasible too. Figure 4 depicts our implemented SPI bus.developed to be used as a remote control access to our home automation system.It is important to mention that the dashboard developed for our implementation supplies basic functionalities of a home automated system with POC.Much powerful and robust software could be developed using many of the server side scripting languages in combination with a database management system.A few of such features have been discussed further in this paper.Figure 5 displays the web page provided with details of our development demonstration.

Hardware
The brain of our home automation system is the Arduino AtMega 2560 based on Atmel's microcontroller.In addition, certain sensors and devices have been used to present full functionality of our implementation.

Arduino
Arduino is an open-source electronics platform that provides both cheap hardware and free software, combined with plethora of I/O ports and variety of available sensors ranging from cheaper to more advance as shown in Figure 6.The price, accessibility, and overall scalability made the Arduino one of the top choices for hobbyists and professional designers as well as developers [12].One of the best advantages of Arduino over similar products is the speed in the development and testing phase of any IoT based project.

Other hardware components
Other hardware parts have been used, which consist of sensors and actuators.They are mostly cheap integrated circuits and chips vastly available to buy from online.The learning path during our development is most certainly enriched by the fact that it has been used those sensors and devices.In addition, our development has helped us to understand the need to carefully read and use datasheets containing crucial information to be able to run any of those integrated circuits.

Implementation Steps
In this section, our implementation in details has been discussed.At the start of our development, certain basic features were set as a guideline.Some other features were kept in factor and applied them whenever necessary to implement.For example, it has been allowed remote light control and time/environmental information as the least of features that would be implemented in an apartment of a tall building.Controlling the lights remotely is already a great benefit, but using them in a smart way is the feature we want to achieve.

Our implemented house model
Our house model was made from wood, plastic, various wires.The LEDs were used as status lights.Figure 7 portrays our house implementation.It represents 1 kitchen, 1 bedroom, 1 living room, and 1 garage.Front of the house model hosts an LCD, keypad, and RFID card/tag reader for remote control.Every room and garage is equipped with lights.Furthermore, living room and bedroom are covered with motion detection sensors.Living room and kitchen are also equipped with temperature sensors.The kitchen has gas/smoke detection sensor, which together with motion sensors and a buzzer module provide excellent basis for an alarm system.Front door and garage doors are being automated using two servo motors.In combination with RFID card/tag and webpage they are used to open doors remotely and effortlessly.Lastly, living room is equipped with a PC cooler acting as an HVAC, at least the cooling part.

Heating, Ventilation and Air Conditioning (HVAC) control
An HVAC is a system that controls the environmental temperature, humidity, air flow and filtering.show how it can control the ambient temperature and humidity; even though there is no way to heat the air (on the contrary cooling the air works fine due to proximity of the sensor).Two LEDs have been added -the red LED to indicate when the air is cooling, whereas the blue LED to show when the air needs to be heated as per our needs.The desired ambient temperature can be set in the webpage dashboard.

Light control
The home model, as shown in Figure 7, has 4 LED strips to represent four lights used in living room, bedroom, kitchen and garage.Since Arduino provides enough digital and analog ports, we can reproduce dimming effect.Thus desirable amount of light can be adjusted for every room.The garage lights are connected through a 4channel relay and they can be controlled both manually and in combination with RFID card/tag reader, which allows us to open the doors swiftly and securely as well as welcome us with the lights up.

Security/Alarm system
As the house model is equipped with gas/smoke and motion sensors together with RFID and the keypad, they can be used to demonstrate couple of features.For example, the automatic identification with a card/tag, this can be used to trigger stuff around the house remotely.But it has been assumed that its utilization is to open front doors and garage doors with card and tag, respectively.Since the RFID cards can be programmable, different cards for various needs can be easily added.The keypad comes handy when it is needed physically.Perhaps in case the card is lost, it can be always resorted to manual control which is still part of the automated system.Two motion sensors provide constant motion detection whenever it is important to get.They have been implemented with an alarm On/Off button on the webpage.Consequently, options are available to trigger an alarm procedure in case of movement.Motion sensors, in addition, can be used to turn on lights automatically when motion is detected in the living room and bedroom areas.In addition, the gas/smoke sensors are constantly checking the gas/smoke level in the kitchen area.This is very useful, as kitchens are usually equipped with gas enabled appliances and a feature like this can prevent many unwanted situations and accidents.If the threshold value of smoke will be breached, the system will trigger an alarm sound warning anybody around of the situation.Furthermore, the system prevents any electrical failures by powering down all Arduino I/O ports, reproducing the real life effect.

Arduino implementation 4.2.1. Overview
We have followed a standard prototyping cycle for our development.For instance, Bayle [12] laid down an easy flow path.At the beginning, basic features for our implementation have written down.Based on the sensor/device availability different parts have chosen.Of course, during our development many things have been updated.Many of our starting ideas have evolved into new features altogether, e.g., the combination used for the security/alarm system.Some of them have chosen to leave for future works or completely remove if they have shown as damaging or useless.

Methodology
One of the important things for us is to get to know the environment.It has been used a couple of months and made the most of our initial goals intended to feature in our implementation.Arduino environment had been very beginner friendly for this matter.We have had experience with software development, but that was our first time to rely heavily on the hardware parts.Naturally, the first sketches of our idea included wiring and circuit prototyping.Hardware assembly included soldering and wiring the devices.One of the first decisions was heavily influenced with communication protocols choice to save some space and wiring knotting.Once all used devices were gathered, it was outlined what belonged to what in the home automation system.

AtMega 2560 Controller
The AtMega 2560 provides plenty of digital I/O, however, a dozen of them can be used as analog inputs.The Mega edition has been chosen exactly because it is Arduino microcontroller with most capabilities for the price.

W5100 Ethernet Controller to Control Network
Our first choice for control network was a Wi-Fi module that worked with Arduino giving the same features as the W5100 Ethernet network controller minus the wireless feature.In whatever manner, the module that we first worked with was faulty one, thus we had to resort to the next most feasible network controller.The W5100 provided everything what needed for our case, even though wireless technology is far better and suited for a modern home automation system.It has been tried to avoid big downgrades due to this change.A simple HTML webpage idea was born.The control network is responsible for user interface interaction or communication.The network communication flow can be seen in Figure 8.

Experimental Results
The W5100 Ethernet controller hosts a structure populated with all the exchangeable variables in the system, called LiveData found in a header file entitled localSetup.h.An example of the LiveData structure has been shown in Figure 9.When the user clicks functionality in the browser, the browser sends specific command for specific functionality.And then the network controller communicates with the controller to update the value in the main data structure to keep track of things what are changing.Finally, the controller changes the value and does what it is assigned to perform.It also sends and updates back to HTML.When the system runs, all the major communication with it can be accomplished via HTML webpage.Some minor functionality is achievable through LCD/Keypad interface.Nevertheless, it has been focused on one main communication to control the system.Arduino platform as much as any other microcontroller have many ways of communicating with the environment.Apart Wi-Fi solutions, there are various Bluetooth and radio frequency modules capable of handling almost the same though the implementation process may way.In our implementation, communication with the system is performed by handling and parsing the HTTP requests sent from and to the browser.Each of the HTML/JS elements is set to send certain commands through the response.On the other side, home automation system listens for the commands and applies them accordingly.The system also updates new values and sends all updates to the webpage such that any change can be tracked.

Our observation and/or finding
The concept of our home automation system evolved from a simple idea of having an ambient data overview considering room temperature reading and perhaps remote light control.During our development, a rough shaped idea of home automation was proposed.In the meantime, we were yet to discover the amount of applicable functions and features in such a system.Our current implemented home model proves the concept of the home automation system as well as tries to design most realistically possible demo house model able to showcase the outlined features.Of course, it goes without mentioning that we have learned quite substantial new information both practical and theoretical during our study.As the project development moved through different phases, it was possible to connect the already possessed knowledge and practice with the new information.We were gathering along the development path.When one looks at the end product of our development, one cannot help PEN Vol. 6, No. 1, April 2018, pp.95 -106 praising on the accomplished tasks along with final product.Even though our presented remotely controlled home automation system does not fall into a cutting edge technology, our intention was to show that our proposed concept is valid and very much useful.Although such system cannot be used as out of the box solution, it is worthy to note that the design and implementation should not vary drastically.The future, however, is much promising.During our development, it was tried to learn best practices and implement as much as possible within our goals and capabilities.Essentially, our main goals and objectives were achieved.It was set before designing the project development path.Importantly, it was wanted to show and cover many tasks that seem simple but when combined save a substantial amount of time.Moreover, the saving factor can also be seen from the demo itself.Without any shadow of doubt, it is easy to say that with every obstacle during the development there were couple of more other solutions and implementations.For example, the stage where we were on alert the most, when we had to resort to another network controller implementation since the Wi-Fi module ended up being faulty.This thought us to widen our view as well as try and look for a better solution around.In some cases, it ended up being better than the previously implemented results.Overall, our efforts and finding results belong to a typical POC.So our approach possesses very high potential for numerous real world applications.

Future works
We are going to mention some of possible upgrades and/or future works on our home automation system.
• Better network controller : Resorting to W5100 Ethernet controller definitely set back some of the features we wanted to use, since the module was equipped with additional 15 I/O ports.Yet we managed to downscale current desires to suite the Ethernet communication and it works decently.While this may be enough for demo purposes, we would argue that this module definitely needs to be replaced with some kind of wireless communication, either a working Wi-Fi module or some others.
• I 2 C bus : We would surely try to get all devices communicating via I 2 C bus.Just the wiring saves some space and time.It is worthy for any demo house model, as all devices are relatively close each other.
• Optimized code : We are very proud on the achievement provided that we did have neither much experience nor with the topic or the development environment.Notwithstanding, there is of course a lot of space for improvements.Our goal is to dive much more into microcontroller environment and try prototyping other useful devices not only related to home automation but to any kind of automation, e.g., an automatic watering system, an automatic dog feeder, and etc.Our code was not optimized.Code optimization [16] would give better performance in the long run.

Conclusion
A house automation system was implemented with a simple motivation of how to make use of small fragmented tasks throughout the day that one spends in home easily accessible and configurable.Miscellaneous tasks in our living units were brought into one centralized action point and functioned with remotely controlled devices e.g., smartphone, iPad, laptop, and etc.So the necessity to visit individual device involved in corresponding task was perished.Our proposed model was implemented by deeming a system alongside the architecture of the household and henceforth construction impediments were no longer affected.Our efforts and finding results were supported by a typical POC.Thus its latent utility for numerous real world applications will be exceedingly high.Better devices and sensors selection as well as code optimization would be the remarkable future works.

PEN Vol. 6 ,
Figure 1.(a) hints functional units of a smart home, whereas (b) shows building blocks of our home model.

PEN Vol. 6 ,Figure 2 .
Figure 2. The organization of devices and sensors of our automated house model.

PEN Vol. 6 ,Figure 3 .
Figure 3.The implementation of I 2 C bus for our home automation system.

Figure 4 .
Figure 4. ISPI bus used in our implementation.

PEN Vol. 6 ,Figure 7 .
Figure 7.The living unit arrangement of our implemented house model.

PEN Vol. 6 ,Figure 8 .
Figure 8.The network communication flow of our approach.

PEN Vol. 6 ,Figure 9 .
Figure 9. Live data structure of our approach.