Web based Home Automation System Prototype using Raspberry Pi
F. I. Sangkop, G. C. Rorimpandey, V. P. Rantung, C. P. C. Munaiseche,
G. W. Tombiling, J. P. A. Runtuwene and P. T. D. Rompas
Informatics Engineering, Universitas Negeri Manado,North Sulawesi, Indonesia
{ivan.sangkop, gladlycrorimpandey, vivirantung, cindymunaiseche, gwtombiling, julyeta.par,
Keywords: Web Based, Home Automation System, Prototype, Raspberry PI
Abstract: Progress in the field of technology has grown very rapidly, especially related to Internet of Things (IoT)
where the development of smart home automation system can be found in our daily life. Electronic devices
such as lights in the house are generally controlled manually, which the homeowner often forget to turn off
while going out and resulting in excessive use of electrical energy. The development of a web-based home
automation system prototype using the raspberry pi can provide a solution to remotely control an electronic
device. The method used to develop the system is prototyping model to built, tested and refined repeatedly
until a final prototype is achieved. The result of this research is a prototype will simulate 4 electric outlets
using 4 lamps, and the raspberry pi will work as the web server enabling the user to be able to remotely
control the electronic device and minimize excessive use of electrical energy.
1 INTRODUCTION
The rapid development of technology has influence
many aspect of daily activities and has become an
integrated part of people’s lives. Home Automation
System (HAS) is growing faster and it requires
extensive development to be implemented as a smart
home. The purpose of home automation is to makes
living in the house more enjoyable or productive by
applying intelligence to make it happen. Home
automation can be seen as a collection of open
source software, consumer hardware and a few line
of code that makes them interact. Different
technologies and programming languages can be
used to finish the tasks. The communication
protocols will be essential in home automation and
has been the first step toward true technology
integration. Wide variety of options are available for
HAS such as GSM based HAS, Bluetooth based
HAS, Phone based HAS, Zigbee based HAS,
Wireless Control System and Mixed Type (Satish et
al., 2015). Data source will provide information and
the software and process are necessary to combine
everything into a unified technology. Typical sensor
that’s been used in HAS modelling involved infrared
remote, Bluetooth and GSM. While infrared and
Bluetooth has a range issue, the GSM can be used
worldwide to control HAS from anywhere. The key
advantage of system is if control circuit fails then
manual switching option of traditional method is
available (Shinde et al., 2017).
The priority for developing a HAS is to have an
automatic or controlled appliances and equipment in
the vicinity. Specialized system comes with higher
price tag, while cheaper solution can be made based
on mini computer system such as Raspberry Pi and
Java ME 8 (Rostyslav et al., 2015). The Raspberry
Pi provision of GPIO makes it capable of running
several services at once, expanded easily, and better
update. With a number of specific modules that are
available for expansion to be implemented in a low
of new projects (Goodwin, 2013).
Another development on the concept of smart
home is by using PIC16F887 as the microcontroller
and integrates it with GSM to provide the smart
automated house system with the desired baud rate
of 9600 bps. The proposed prototype then will be
implemented and tested with maximum of four loads
and shows the accuracy of 98% (Teymourzadeh et
al., 2013). HAS was developed using open source
software technology for computer based
applications. The huge number of data collected
needs efficient data storage mechanisms for
continuous monitoring. (Suryadevara and
Mukhopadhyay, 2015).
292
Sangkop, F., Rorimpandey, G., Rantung, V., Munaiseche, C., Tombiling, G., Runtuwene, J. and Rompas, P.
Web based Home Automation System Prototype using Raspberry Pi.
DOI: 10.5220/0009010002920297
In Proceedings of the 7th Engineering International Conference on Education, Concept and Application on Green Technology (EIC 2018), pages 292-297
ISBN: 978-989-758-411-4
Copyright
c
2020 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
The lack of monitoring in the use of electronic
devices has an impact on excessive use of electrical
energy and increasing electricity bills. The
fundamental of building an automation system for an
office or home is to acquire an efficient and
economical use of the electricity. The use of wireless
technologies provide several advantages such as
reduced installation costs, internet connectivity,
scalable and expandable (Gunge and Yalagi, 2016).
HAS using Raspberry pi and Internet of Things
technology are suitable for real time monitoring and
for controlling the home appliances remotely. It also
provide extra layer of security and protection, can be
employed in many places. (Pavithra and Ranjith,
2015).
Most homeowner are not efficient in operating
various electronic equipment in daily life. For
example the lights in a room that are no longer used
but still on and homeowners often forgot to turn off
electronic devices that has not been used when
leaving. To help reduce the negligence use of these
electronic devices, this research will overview the
implementation of a Raspberry Pi Mini PC as a
controller through the PHP programming language
to make it easier for homeowners to control
electronic equipment.
2 PROPOSED SYSTEM
Prototyping model will be used to develop the
system and it is a system development model that
will assist developer and other stakeholder to better
understand what is to be built when the requirement
are fuzzy. The constructed prototype constructed is
deployed and evaluated by stakeholders. Prototype
serves as a mechanism to identify software
requirements (Pressman, 2011) as shown in Figure
1.
Figure 1: Prototyping paradigm (Pressman, 2010).
SWOT analysis (Strength, Weakness,
Opportunities and Threats) is the process of
formulating a strategy to find strategic solution
between external opportunities and internal strengths
while paying attention to external threats and
internal weaknesses. One way to conclude the
strategic factors is to combine external strategic
factors with internal strategic factors into a summary
analysis of strategic factors. Based on the SWOT
analysis in Table 1, a Web-based Prototype Home
Automation System using Raspberry Pi will be built.
It will simulate the lights controlling as a solution in
dealing with problems that occur in current situation
of homeowner.
Table 1: SWOT analysis.
Internal
External
Strength:
The configuration
and ease of use of
the control
system.
Weakness:
The existing
control system is
still less efficient
because the
control distance
is limited.
Opportunity:
Security is
more
trustworthy,
still widely
used by the
community.
S-O Strategy:
Develop a control
system that is
easy to use and
safe, develop a
system that can
attract people's
interest.
W-O Strategy:
Develop an
electrical control
system that can
be accessed
anywhere and
anytime.
Threat:
The use of
electrical
energy is not
controlled.
S-T Strategy:
Building a control
system that is
easy to use and
can minimize
errors in
controlling and
using electrical
energy.
W-T Strategy:
Develop a
control system
that is not limited
to distance that
can minimize the
use of
uncontrolled
electrical energy.
Figure 2: Architecture of proposed HAS.
Web based Home Automation System Prototype using Raspberry Pi
293
From Figure 2, it can be seen that a PC or
smartphone is the device that will be used to access
the system website page so that it can control
electricity on simulated devices with 4 lights via the
internet. The power supply is a device that provides
a voltage source to Raspberry Pi.
Raspberry Pi in this system is used as a Web
Server and the controller for electrical devices
through Relay Module. To enable the control of
Relay Module on Raspberry Pi, there is a GPIO Pin
that can be used for communication with other
devices and on this system there are 4 pins that will
be used as output pins, namely GPIO 18, GPIO 23,
GPIO 24, and GPIO 25. Raspberry Pi used in this
system is the Raspberry Pi B model.
Relay is an electronic switch that can be
controlled by providing logic value 0 or 1 which in
the construction of this system, the input is obtained
from Raspberry Pi GPIO pins. The relay used in the
design of this system is the DT-I / O Quad Relay
Board from Innovative Electronics. Relay on this
system is used to control electrical devices that can
be directly connected via a jumper cable to the
Raspberry Pi mini pc.
3 SYSTEM DESIGN
The work flow from the Home Automation
Prototype will be described on system design. To be
able to control the electrical devices in this system
simulated with lights, first the user must log on the
web page, after that the system will check the user's
login data whether it is correct or not. If the login
user data is not suitable then the user cannot enter
the system to control the lights, so the user must re-
login with the appropriate username and password.
After logging in correctly, the user can choose the
light mode such as ON or OFF mode on the web
page. The system will then change the GPIO status
value 1 or 0 on Raspberry Pi based on the light mode
selected by the user on the web page, if the GPIO
status is 1 then the system will turn on the light, and
if the GPIO status is 0 then the system will turn off
the light. The user will receive light status
information on the web page, and then the user can
logout to exit the system control web page.
Website interface design is designed to make it
easier for users to interact with the system. The
website created only has 2 pages, which is the login
page and the control page. The website that will be
created is also a responsive website that can adjust
the size of the website based on the size of each
screen that accesses this system. Figure 3 and 4 is
the website design that will be created. The mock-up
is created using the Balsamiq Mock-up 3
application.
Figure 3: Login page design.
Figure 4: Control page design.
Figure 5 shows how the configuration of
hardware and software components used in this
system. Based on the system architecture design,
there are 4 hardware components that are configured
to be implemented in this system, namely
pc/smartphone, raspberry pi, relays, and lights.
Figure 5: HAS Deployment diagram.
Users can access the Prototype Home
Automation System interface by using a PC or
smartphone that has a web browser application
installed. Raspberry Pi is a tool that will be used as a
server in this system, there are three applications
installed on Raspberry Pi so that it can be used for
controlling lights. The applications are Apache2,
EIC 2018 - The 7th Engineering International Conference (EIC), Engineering International Conference on Education, Concept and
Application on Green Technology
294
Dataplicity, and WiringPi. A PC or smartphone can
connect to Raspberry Pi via HTTP (Hypertext
Transfer Protocol). Relay is a tool used as a
magnetic switch to turn on or turn off the lights.
Relay relies heavily on Raspberry Pi to run.
4 IMPLEMENTATION
Based on the design of the user interface prototype
that has been designed, the next stage is to
implement the web based application using PHP and
HTML that can be accessed online where the
devices can be controlled and monitored remotely.
Rostylav et al., (2015) developed a HAS using Java
ME with various sensors and only works offline.
Figure 6: Login page (version 1).
The initial version of login page as shown in
Figure 6 will require the users to enter a username
and password to enter the next page. The status of all
lights will be visible, showing whether it is turned
On or Off as shown in control page Figure 7.
Figure 7: Control page (version 1).
When the user clicks the On/Off button, the
button and icon will change colour, which indicates
that the button is active. Options menu in the sidebar
will be highlighted when the cursor is directed at
each option for both elements. On control page the
user can choose the light mode, which is On/Off as
provided in the table, there are 4 lights that can be
controlled. Users will be transferred to the login
page when clicking on the logout button. The HAS
website is accessible through a web browser and it
will communicate with the Raspberry Pi mini pc
using a number of supporting software namely
WiringPi, PHP5, Apache, and Dataplicity which are
configured on Raspberry Pi. Sweta and Dinesha
(2016) implement HAS that support voice command
but accessed by using an IP address and can only be
used with android smartphone.
Figure 8: Login page (version 2).
Figure 9: Control page (version 2).
Web based Home Automation System Prototype using Raspberry Pi
295
Users then evaluate the website user interface
and based on their feedback, some changes has been
made in the interface design as shown in Figure 8
and Figure 9. The HAS consists of Raspberry Pi as
the central control of all hardware that has been used
in this system. The result of this research in the form
of hardware is an electrical device control system
using the Raspberry Pi as a control centre for
electrical devices that receives commands from the
website and forwards commands to the relay module
to turn on or off the electrical device. Teymourzadeh
et al., (2013) investigates the potential of HAS based
on SMS technology and microcontroller.
Figure 10 shows the electronic circuit of
raspberry pi home automation system hardware that
is implemented in prototype form. Connected
directly to the power source and forwarded to the
relay module and electrical devices which in the
system prototype is implemented in the form of a
lamp so that it can be controlled through the system.
Figure 10: HAS hardware prototype.
Server response testing is to test the response
speed of the server to process commands from user
turning on a lamp, and the test process applied to all
four lights using the internet network at different
times, namely at night and morning. Based on the
data in Table 2, the average response time from the
server to be able to turn on a lamp is 1.7 seconds. So
it can be concluded that the main factor that
influences the performance of the system is the
internet network, if the internet network is slow, the
process carried out by the server to receive data
becomes slow.
Table 2: Server response testing.
Night Morning
Lamp 1
02.15 sec 01.71 sec
Lamp 2
01.97 sec 01.25 sec
Lamp 3
01.71 sec 01.45 sec
Lamp 4
02.55 sec 01.25 sec
5 CONCLUSIONS
Based on the design and results of the tests that have
been carried out, the proposed home automation
system prototype is able to remotely control the
electronic device and minimize excessive use of
electrical energy. In this case, it is made using 4
lights as a simulation of electronic devices,
raspberry pi which functions as a server, and a relay
module that functions as a magnetic switch. The user
interface in this system can be accessed using a PC
or smartphone. Prototype of web-based home
automation system using raspberry pi allows users to
be able to control electronic devices without being
limited by distance using the internet network.
For future works, it is expected to be developed
and improved by adding various sensors in the
system, using scheduling to turn on/off electronic
devices, measuring the use of electrical energy, etc.
REFERENCES
Goodwin, S. 2013. Smart Home Automation with Linux
and Raspberry Pi. Springer. New York, 2
nd
edition.
Gunge, V., Yalagi, P., 2016. Smart Home Automation: A
Literature Review. International Journal of Computer
Applications, Vol 2016 (1), pp 6-10
Pavithra, D., Ranjith, B., 2015. IoT based Monitoring and
Control System for Home Automation, Proceedings of
2015 Global Conference on Communication
Technologies. IEEE., pp 169-173
Pressman, R., 2010. Software Engineering: a Practitioner
Approach 7
th
edition. McGraw-Hill. New York.
Rostyslav, K., Tkatchenko, S., Golovatsyy R. 2015.
Features Home Automation System Development
Based Raspberry Pi Using Java ME SDK. CADSM.
13th Int. Conf. Experience of Designing and
Application of CAD Systems in Microelectronics
(CADSM). Lviv.
Satish, P., Naveen H., Naren, K., Vidyalakshimi, S.,
Angel, S. 2015. Home Automation System – A Study.
International Journal of Computer Applications, Vol
116(11), pp 11-18
Shinde, A., Kanade, S., Jugale, N., Gurav, A., Vatti, R.,
Patwardhan., 2017. Smart Home Automation System
using IR, Bluetooth, GSM and Android, 2017 Fourth
International Conference on Image Information
Processing. IEEE.
Suryadevara, N.K., Mukhopadhyay, S.C., 2015. Smart
Homes: Design, Implementation and Issues. Springer.
Switzerland., Vol 14, pp 1-9
Sweta, P., Dinesha, H., 2016. Implementation of Home
Automation through Internet of Things, Journal of
Network Communications and Emerging
Technologies (JNCET), Vol 6(12), pp 1-6
EIC 2018 - The 7th Engineering International Conference (EIC), Engineering International Conference on Education, Concept and
Application on Green Technology
296
Teymourzadeh, R., Ahmed, S.A., Chan, K.W., Hoong,
M.V., 2013. Smart GSM Based Home Automation
System, 2013 IEEE Conference on Systems, Process
& Control. IEEE., pp 306-309
Web based Home Automation System Prototype using Raspberry Pi
297