Smart Garage Implementation and Design Using Whatsapp Communication Media

,


Introduction
Research into the use of Raspberry PI and Arduino on front doors has been done especially for guests whenever the owner is not home, where the guest will provide a message or voice messaging to the owner of the said house.The system is completed by an LCD (liquid crystal to display) to identify the guest, to display the voice message, and other important information regarding the house.With the LCD, the house owner can also leave messages that can be displayed should he/she please.As long as the voice message has been recorded, the Raspberry Pi camera can be used for security and to provide information such as images of guests that arrive to the house's owner [1].
The utilization of IPv6 internet protocol for house automation has started to be done with the taken object as a single network layer and all relevant aspects of house automation.All of this is as a basic knowledge that supporting infrastructure eases the development in making applications and in creating interactions with a beneficial concept for the vendor and to the user.Clearly, internet technology is an option for a solution to a automated home system [2].
Differently with a smart home system based on Raspberry Pi and android smartphone that is equipped with wireless router access that has given comfort and convenience in monitoring as well as house and environment situation control and also to raise electrical energy efficiency in accordance to the needs of the user [3].Meanwhile, according to [4] with the new standard in wireless communication with higher coverage area provide low energy consumption.
Different power patterns can be created by wireless and mobile data communication.The use of maximal sparse linear arrays has been done to create a new approach [5] to the synthesis of shaped patterns.Here, the Compressive Sensing (CS) theory is used with optimization in parameters that may affect the CS performance.The initial constraints may be fulfilled by different power patterns.Several other applications of interest can use the same procedure.Examples include the design of factorable pattern in the shaped zone or onedimensional simple reconfigurable array.Radiation performance that is near the ultimate physical limitation is achieved in such a scenario.Moreover, based on [6], the rigorous delay specification, made the performance results on the communications scheme difficult to achieve.Here, a fast deterministic procedure is presented to fulfill the requirements of fixed power pattern and directivity by implementing the feeds' size as a degree of freedom of the problem.As a result, different field levels are produced on their aperture even though the feeds have the same power but different sizes.A smaller field will produce a larger field level on its aperture [7].
By taking advantage of the rapid development in electronical and telecommunication technology, added to the use of Raspberry Pi, Arduino, and wireless routers as well as motor drivers, we are design and implementation a Home Automation system that uses a androidbased smartphone.The purpose in this research is using an android smartphone with WhatsApp which can be implemented to help drivers open and close garage doors without having to come into physical contact with it.
The Raspberry Pi and the transmitter component, as Single Board Computer (SBC) or local server, and the microcontroller will be able to communicate, or to exchange data with each other, through a wireless communication.In this paper we are design and implementation system, we used a wireless and mobile data communication as the communication media.the Single Board Computer will be placed inside a house and the microcontroller will be placed near the garage door.When the SBC receives data from the user, the SBC will communicate with the microcontroller and data will be processed by the microcontroller.

Research Method
In an effort to implementation smart garage as part of Internet of Things, the research methodology steps begin from the system design that includes Raspberry Pi, Access Point, Arduino and smart phone and End devices.Then the second step is realization that consist of source code and prototyte design.The third step is performance test with attention of distance, protocol, words length and connection type.The final step is results analysis with several parameter performances like as delay, CPU load and response time.The research methodology is as shown in Figure 1.

System design
The initial stage of this research is the design phase or system design.At this stage, used several important components, such as: Raspberry Pi, Access Point, and Arduino.Raspberry Pi is a small single-board computer that can be used to run computer programs similar to a computer.On the Raspberry Pi, we can configure anything according to our needs.This eases users in doing configuration and in controlling it [8].Raspberry Pi serves as a server to receive commands from Whatsapp.Access Point serves to transmit information obtained from Raspberry Pi to Arduino.
Arduino Uno is a microcontroller-based board at Atmega328.This series has 14 digital input/output pins (where 6 pins can be used as a PWM output), 6 analog inputs, 16 MHz crystal ocillators, USB connection, and an electrical jack reset button.These pins has all that is needed to support a microcontroller.It only requires to be connected to a computer through the USB cable or the power source can be obtained from a power source through an AC-DC adaptor or also a battery [9].Arduino serves to receive commands from Raspberry Pi for later executed directly by motor driver.
Motor Driver L298 N is a driver module that uses a ST L298N chip that can control two motors simultaneously [10].NRF24LO1 wireless module is a wireless communication module that uses the 2.4 GHz band.This module uses the SPI interface to communicate and runs on a voltage of 5V [11].In this design, motor drivers are used as modules to drive DC motors and smartphones as executing commands through the WhatsApp application.

Realization
In the realization stage, prototypes of system designs have been made.In addition, also configure the system and create the source code.In Raspberry Pi, the authors make the source code for the process of receiving messages WhatsApp for the next sent to Arduino as a command.Meanwhile, the Arduino generated source code to receive commands from Raspberry Pi, to then be executed by motor drivers it is described in the block diagram of the system as in Figure 2.
Detailed process description of Figure 2, started by smartphones or user devices (laptops, gatgets) that can connect to the internet and can send messages determined by the number of words sent according to need, at least one word such as opening or closing.Besides, it takes the server whatsapp as a container of the number of messages made by the user.Local Server through Access Point can communicate with other subsystems that is smart controller device, where Raspberry Pi function as interface that runs programs both for configuration and control needs like a computer.So every message that comes from the smartphone by Raspberry Pi will be processed and then will be forwarded to Arduino Uno R3 via wireless module media that is NRF24LO1.Power supply 220V AC through power module distribute power especially 9 volt DC voltage on Arduino Controller.The existence of motor drivers in order to move the wheels on the smart wheel in accordance with the Arduino Controller command either to open or close the garage door.In the source code for message delivery WhatsApp to Raspberry Pi serves as an interface with WhatsApp server, process handles ACK, initialization layer, process to start the program and process for message delivery.While the source code for message reception WhatsApp to Raspberry Pi serves as a process to check messages received from WhatsApp and then save them into variables including the process to handle ACK, to then do the process of decrypt from received messages.In the source code of the process of sending data from Raspberry Pi to Arduino there is a command that can set the payload to be sent, the channel to be used, the length of CRC and Data Rate to be used.

Performance test
At the performance test stage, several system testing schemes are performed.In the distance testing scheme, measurements are made in several distance samples to determine how much effect of distance to the system.In the connection type test scheme, the comparison between the use of WiFi with the use of Mobile Data and its effect on the delay.In the word length test scheme, measurements of the number of characters in words sent in some samples are taken.In order to measure how much resources used by the system.In the protocol testing scheme, comparisons of MQTT protocols and HTTP protocols are used to determine which protocols are most efficient in the use of IoT.

Results and Analysis
In the analysis stage, analyzed the change of distance to the value of delay that occurs, protocol usage, connection type and character length analysis of Raspberry Pi resource usage.

Delay measurement
Delay measurement will performed through different media, that are wireless communication media and mobile data communication media.

Using a wireless communication media
During the first measurement, the authors used a wireless communication medium in the form of a wireless router that is under one network that is used by yowsup service.A smartphone that had WhatsApp installed is connected to a wireless router inside a home under the assumption that the signal from the wireless router can reach the smartphone.Figure 3. Delay measurement vs distance by using wireless communication medium Figure 3 shows the result of delay measurement with wireshark software and by using a stopwatch towards the change in distance in meters.This measurement had the purpose to see how fast the response from Raspberry Pi is as the controller towards a smartphone user who provides messages to it.From the figure, it can be observed that up to 15 meters, the delay is relatively constant at around 6 to 7 seconds.The delay in measuring by stopwatch is larger than the result from wireshark.The delay will continue to increase at distances above 15 meters closer to 8 seconds.Using a wireless communication medium through a wireless router, the 1111 signal received by the smartphone will increasingly decrease if the distance is more than 15 meters and will affect the performance of the system.

Using mobile data communication media
In this measurement, the authors used the network connection that is in smartphones such as GSM and LTE and does not use the connection from wireless routers.There is a difference in the network used by the user and the one used by yowsup service.Figure 4 is a graph of the result of delay trials by using a mobile data communication medium.Based on the acquired result, using the wireshark software and the stopwatch as a measuring tool does not always result in an increasing delay.This means that by using mobile data, the signal recived by the smartphone will affect how fast or how slow the object's response is, in this case the motor driver wheels towards the Raspberry Pi controlled.The minimum delay is 6 seconds while the maximum is 7,5 seconds.The Measurement by stopwatch is larger than the wireshark.Therefore, by using mobile data communication medium, the delay is not linearly affected by the change in distance but is instead affected by the mobile data signal strength or power patterns reach towards the smartphone.

CPU and RAM Load Measurement
The next measurement is towards the CPU and RAM load from an idle position to a processing data sent from a smartphone.The rise in data from the smartphone is done in phases in order to acquire the CPU and RAM characteristic towards the Raspberry PI used other than to understand the load increase process experienced by the CPU and the RAM.  5 is a graph depicting the result of CPU load measurement towards the amount of data sent.In an idle condition, CPU usage is 19% while RAM usage is 32%.Meanwhile, when receiving data one word large with a length of 4 characters, CPU usage experienced a rise becoming 33% while RAM usage becomes 38%.When receiving data with 11 words that has 50 characters, CPU usage rose by1% to 32% and RAM usage stays at 38%.While receiving data 82 words long with 500 characters, CPU usage rose by 1% becoming 33% and RAM usage is 38%.When receiving data 196 words long with 1431 characters, CPU usage rose by 6% to become 39% while RAM usage stays at 38%.A signigicant rise happened why receiving data 518 words long that has 3858 characters.CPU usage rose by 7% to become 46% while RAM usage stays at 38%.This shows that when data has been sent through WhatsApp from a smartphone, there will only be a raise in load on the CPU while the RAM will not experience a rise in line with the function of RAM as a multitasking medium.

Protocol comparison between HTTP and MQTT
Figure 6 is a graph that states the comparison of response time to distance on MQTT protocol and HTTP protocol.The data were taken ten times.The data were taken at distance 1,5,10,15 and 20 meter respectively.Based on the above graph on the results of this research implementation, the HTTP protocol has a smaller reponse time value compared to the MQTT protocol.This is because the micro-controller used only communicate with 1 device.Therefore, the use of HTTP protocol is more efficient.

Conclusion
This research designed and implemented a smart garage by using WhatsApp communication media through system design, realization and performance measurement metrics.The result shows that when using a wireless communication medium, the largest delay was at 20 meters and the smallest delay was at 1 meter.When using mobile data as the communication medium, the largest delay was at 10 meters and the smallest delay was at 1 meter.The use HTTP protocol has a smaller reponse time value compared to the MQTT protocol.Therefore, the use of HTTP protocol is more efficient, and generally more familiar in implementation especially in the field of internet.
The CPU measurement result shows that the largest CPU load happened when sending data 518 words long with 3858 characters and the smallest rise in CPU load hapened when sending data 11 words long with 50 characters.During the RAM measurement, a rise in RAM usage happened only when switching from an idle condition to a running condition.After the program is running, no amount of data received affected the RAM performance.This is in line with the purpose of RAM as a media for multitasking.

Figure 4 .
Figure 4. Delay measurement vs ditance by using mobile data communication medium

Figure 5 .
Figure 5. CPU and RAM Load Characteristic with Change of Data Received

Figure 6 .
Figure 6.Response time vs distance between HTTP protocol and MQTT protocol