An Improved Microcontroller Based Automated Home Using GSM Phone

DOI: http://dx.doi.org/10.24018/ejece.2020.4.4.171 Vol 4 | Issue 4 | August 2020 1 Abstract — The advancements in technology in the world tend to make life for humans better. As time progresses, new technologies as well as improvement of existing technologies consistently given birth to a better, comfortable, safe and more secured way of living. One of these technologies which fosters better living in recent times is the smart home technology. This enables house owners to interact with their home. It brings about stress-free and risk-free means of controlling household system. This paper presents the utilisation of cheap and opensource materials in the development of a Short Messaging Service (SMS-based) smart home system. These materials include the Arduino microcontroller, SIM800l GSM module, electric relay, and some basic electronic components. Objectoriented system analysis and design (OOAD) was adopted as the development methodology for the research. Upon testing, the system was able to receive commands via SMS in order to turn on and off of Alternating Current (AC) appliances at home. Also, the system sends acknowledgement message to the sender to confirm if the command was carried out or not. It could check if the command it received was sent from the house owner’s phone or not. If command was from the house owner’s phone, the command is honored but if not, it is discarded. This is a feature that enables the home appliances not to be controlled by unauthorized persons.


I. INTRODUCTION
The world's advancement being accompanied by the evolution of technology has always tend to make life easier for people in their home, offices shops, even on the road as well as in their cars. One of the technologies which the evolution of technology in this advancing world has brought is the smart ability of operation of gadgets, which a major is the smart operation of household appliances. The smart home technology attempts to make the home as safe as possible as well easy to operate electrical appliances in the home [1], [2]. The intention of making the home a risk-free environment with an easier method of control for all ages is what gave birth to the smart home technology. The manual dummy operations of home appliances have been faced with a major risk of electrocution which has cost the lives of several and has also left many injured. This paper presents the design of an SMS based control of home appliances (it can also be called SMS based smart home). As we all know, the conventional method of controlling home appliances requires users to interact directly with the switch, this in a way exposes them to contact with high voltage AC. The partial to total exposure to high voltage AC has in several cases led to death, in other to remedy this issue the SMS control of home appliances which isolates the user or operator from getting close to the AC voltage is proposed.

II. LITERATURE REVIEW
Several works have been done on smart home system which aimed at solving one major issue or the other systems like; the Bluetooth Based Home Automation System designed by [3] provided full functionality to remotely control home appliances via wireless communication between the Arduino BT and cell phone using Bluetooth technology. This is a low-cost home automation system that is cell phone based, secure, and flexible. Some electrical appliances at home are connected to the Arduino Bluetooth (BT) circuit board. The communication between the Arduino BT circuit board and the cell phone is wireless. The Arduino BT board has a range of 10 to 100 meters, 3 Mbps data rate and 2.4 GHz bandwidth. With little modifications, more devices can be added into the system. One thing worthy of note is that the cellphone script is written in Python programming language; this make it portable and can run on any Symbian Operating System phone but failed to support Java based application.
According to the research work carried out by [4] on ZigBee based wireless home automation system, three main modules were used -(central controller module, appliance controller module and handheld microphone module). The central controller module and the handheld microphone module employed the ZigBee protocol and are based on personal computer (PC) respectively. In this system, RF ZigBee modules was used to established wireless network due to cost efficiency and low power consumption and the Microsoft speech Application Programming Interface (API) was also used as a voice recognition application. Voice commands, with different accents, of 35 male and female were used to test this system. A total of 1225 voice commands were recorded, that is, 35 voice commands from each and the system correctly responded to 79.8% of them. The accuracy of this system was blamed on surrounding noise, speaker accent and speed. The accuracy of this system is tied to 40 metres. Recognition system is accurate, when the line of sight transmission is clear, up to 80 metres.
The research carried out in [5] unraveled how ATMEGA168 microcontroller was used to remotely manage security lights through Short Message Service (SMS) from a smartphone anywhere outside the home. A smartphone is configured to transmit SMS signal to a home-based GSM modem. The GSM Modem then sends the received SMS to an ATMEGA168 microcontroller. The Microcontroller When the process is completed, the microcontroller then sends signal to the GSM modem which reciprocates and ship back a reply to the cell phone through SMS. The work presented in this paper, unlike the related works reviewed in literature, is able to receive SMS command and also send an acknowledgement once the command has been implemented. In addition, it also performs a validity check on the phone number that sent the command to see if it belongs to the house owner or not. If it belongs to the owner, the command is carried out but if it doesn't, the command is discarded.

III. DESIGN FRAMEWORK/ARCHITECTURE
Having considered the nature of the system which is centred on the coordinated interactivity of cyberphysical systems (over a network) in order to achieve certain desired operations, Object Oriented Analysis and Design (OOAD) was applied in the analysis and design of the system [6,7]. In this case, the cohesiveness, interoperability, and modularity of each of the components (as well as the entire system) were determined all aimed at achieving scalability, encapsulation, ease of maintenance, code reusability, polymorphism, etcfeatures important for the development of quality computer and electronic systems [6,7,8] and [9]. However, it is important to note that unified modelling language (UML) [10] symbol representation patterns were applied in this OOAD.

A. Object-Oriented System Modelling
For the purpose of analysis, the SMS-based smart home system has the following basic functionalities; 1. User uses mobile device to remotely transmit command(s) via SMS communication to AC appliance(s) at home.
2. AC appliance receives commands (via the SIM 800I module attached to it) in order to power ON or OFF.
3. AC appliance ascertains that received command is from the actual occupant of the home (via the firmware program running on the Arduino microcontroller). 4. AC appliance carries out operation (ON or OFF) based on received command from user by using the firmware running on the microcontroller. 5. AC appliance acknowledges execution of command or not to the user mobile the device via SMS (through the SIM 800I GSM module), and finally.
6. User is notified of the status of the home. Taking a critical look at the operations of the system, the major objects (with their respective attributes and operations) that make up the entire system at this level are as thus:  From the conceptual class diagram, it could be seen that the system is in actual sense, a typical client-server architecture where the client (user mobile in this cases) consistently requests for the services of the server (AC appliance in this respect). The server therefore offers services to the client. A user mobile will send command to one or many GSM module -depending on the number of AC appliances a user has at home. An AC appliance is composed of at least, a GSM Module for interacting with the client via SMS, and a Microcontroller for processing commands and monitoring its status. At every point in time, a GSM module receives signal from one and only one mobile phone. It then relays the signal (command) to one and only one microcontroller. The status of an AC appliance is reported back to the processor which then conveys it to the GSM module before acknowledgment is then communicated across to the user mobile.

B. Electronic Components Interoperation
One of the major reasons for the development of SMS based control of home appliances is the ability to have full control of appliances from a remote location. With this technology an individual can easily turn off and on appliances in the home from anywhere in the world the diagram below shows the various components that makes up the design and how they function.  The diagram above shows in functional block how the different components of the system communicates, the directional arrows shows the direction in which signal or power flows. The system is powered by 3.7 volts direct current (DC) supply, the DC supply powers the GSM module and the Arduino board directly. The GSM module serves as both an input as well as output device, it collects command data via SMS sent from house owner's phone number and sends it to the Arduino nano board which is the processing unit of the system. The Arduino microcontroller board evaluates the data received from the GSM module and implements instruction based on the received data. Relay 1, 2 and 3, are powered by the Arduino board and is controlled by the board via its digital pins.

C. System Schematics
The diagram below shows how the hardware components of the system were connected together to achieve the desired result. The relays have one end of their coils' terminal connected to pin 4, 5 and 6 of the Arduino board and the other to the ground terminal of the circuit. The GSM module TX and RX terminals are connected to pin 2 and 3 of the Arduino, it's positive and negative terminals are connected to the battery positive and negative terminal of the circuit. the D1 is used for power detection and it's connected to pin A0 of the Arduino. The charger is used to charge the battery as well as works with the diode for power detection.

IV. OBTAINED RESULTS
Having considered how speed of execution of commands as well as security of the system is important the system, these factors constituted the key parameter indices (KPIs) upon which the developed prototype system was tested. Speed in this context referred to the responsiveness of the AC appliances in executing commands received from the user mobile device, while security referred to the sensitivity of the system to intrusion into the home. For the purpose of testing, it is important to note that three AC devices (lighting point, fan, and socket outlet) were tested thrice, and results obtained presented in Table 1, and analyzed graphically in Fig. 8 below. The data generated were based on the class of GSM module used. For this research work, the SIM800L GSM module was used. From the test, it was observed that it took an average of 5.2 seconds for a successful delivery of the SMS Command report from the GSM phone used while the AC devices responded in an average time of 2 seconds; almost immediately as the devices received the SMS command. The use of SMS command to control AC devices at home was achieved with the connection between the Arduino Nano, the SIM800L GSM module and relay modules. The SIM800L GSM module is connected to a configured serial port on the Arduino Nano that uses digital pins 3 and 4 of the microcontroller board. The Arduino board controls the GSM module upon startup of the system and sets it to SMS mode using AT command. Upon startup of the system, it takes about 10 seconds for the GSM module to connect to the service provider and less than 20 seconds for it to be fully configured for SMS communication.

V. CONCLUSION
In conclusion, the work presented in this paper makes it possible for individuals to remotely control their household appliances from a remote location and also enables them to know if the control command they issued was carried out. The following are the findings of this research work: One issue which has not been brought into consideration in the SMS based smart home system is the issue of the home knowing if it is the house owner that is issuing the command or not, the system designed in this paper gives a solution to that problem as it is able to validate the sender's phone number if it belongs to the house owner or not. In addition, the system sends acknowledgement message to the sender to confirm if the command was carried out or not.