You are on page 1of 6

8th IEEE International Conference Humanoid, Nanotechnology, Information Technology

Communication and Control, Environment and Management (HNICEM)


The Institute of Electrical and Electronics Engineers Inc. (IEEE) Philippine Section
9-12 December 2015, Waterfront Hotel, Cebu City, Philippines

Home Automation Using Raspberry Pi through Siri


Enabled Mobile Devices
Ana Marie. D Celebre
De La Salle University
Manila City, Philippines
anacelebre@yahoo.com

Ian Benedict A. Medina


De La Salle University
Manila City, Philippines
ianbmedina@gmail.com

Adrian Neil M. Surposa


De La Salle University
Manila City, Philippines
adrian_neil190@yahoo.com

Alec Zandrae D. Dubouzet


De La Salle University
Manila City, Philippines
aleczandrae_2day@yahoo.com

Engr. Reggie C. Gustilo


De La Salle University
Manila City, Philippines
reggie.gustilo@dlsu.edu.ph

Abstract Home automation is a system that has the


technology to control devices automatically in order to convene
the desires of security, comfort and efficiency. On the other hand,
voice-based digital assistant such as Apples Siri provides a
location independent access to the Internet and local networks.
This study focuses on implementing a home automation system
through Siris capability of speech recognition and through
Raspberry Pi as a low cost control system to automate home
devices, namely the air cooler, door, lights, TV and window.
SiriProxy is installed on the Raspberry Pi as a proxy server for
Siri. By developing a SiriProxy plug-in, a set of commands for
home automation could be custom-made by the user.

Mobile communication and home automation technologies


are mature and adequate devices capable and available [5].
The existing standards for home automation and building
services define gateways to RF and IP networks [6]. Several
systems support the integration of specific mobile terminals
and smartphone applications, which can connect to home
automation systems. The disadvantage of existing systems and
applications is that the integration of smartphones is not trivial
[7]. In most cases special hardware, which matches the used
system or application, and skilled technicians are necessary
for integration and configuration purposes [7].

The system has been tested and verified through speech


recognitions accuracy tests, response latency tests and success
rate tests. A total of 34 subjects with different English accents
tested a total of 14 voice commands with a total of 390 trials. The
tests verified that the systems average latency is at 2.12 seconds
with an overall success rate at 93.3333% on at least 3 trials and
87.381% success rate on at least one trial. (Abstract)

The rest of the paper is organized as follows: Section II


provides a system overview of the system. Section III
discusses the hardware design while Section IV discusses
about the software design. The experimental results are
discussed in Section V. The paper concludes by looking at the
future research and recommendations required to make the
system more effective.

Index TermsHome Automation, Raspberry


SiriProxy, Speech Recognition. (key words)

Pi,

Siri,

I. INTRODUCTION
Rapid technological advancements were required in order
to satisfy the increasing demand for an easier and comfortable
lifestyle [1]. Home automation systems are intended to
provide convenience, energy efficiency, security and comfort
[2].
As the demand for more convenience increases,
smartphones have gradually turned into an all-purpose
portable device that can access the Internet and other local
networks [3] . Voice-based digital assistant like Apples Siri
are thriving applications to smart phone that manages to
understand and responds to spoken commands [4].

978-1-5090-0360-0/15/$31.00 2015 IEEE

II. LITERATURE REVIEW


The recent existing studies on home automation focuses on
wireless home automation that mainly focuses on addressing
the problems or power consumption, range of operation,
convinient living and cost of the whole system [8]. Zhu et al
(2010) proposed to automate ZigBee-based networks through a
voice control system. A Speaker-Independent Automatic
Speech Recognition module was used for translating voice
commands and sending it to the actuator of the system through
ZigBee network. In order for the system to work, ZigBee
modules must be used in order to control home appliances like
lights, power outlets, IR operated devices and temperature
sensors[9].

8th IEEE International Conference Humanoid, Nanotechnology, Information Technology


Communication and Control, Environment and Management (HNICEM)
The Institute of Electrical and Electronics Engineers Inc. (IEEE) Philippine Section
9-12 December 2015, Waterfront Hotel, Cebu City, Philippines

However, their system only works on ZigBee-based


networks and requires a module for each appliance to be
control by the system, thus, making it uneconomical and
limited [8]. The system's speech recognition requires a module
and lead to errors due to noise.
A solution for a more efficient speech recognition is to use
Apple's Siri. Siri is a built in application for certain iOS
devices, thus making it more accessible to use since it is
already installed on the user's mobile device [10]. Siri could
also respond to the command of the user using a natural
language making it more convenient [10]. For a more versatile
and cost efficient control system, Raspberry Pi is
recommended by the reaserches to be used as a control system
for Home Automation. Not only that it has a small size, home
devices could also be directly connected to its GPIO ports
through relays or motor drivers making the system to be costeffective and insubstantial.
Piyare and Tazil (2011) used bluetooth technology for
home automation using an Adruino board as a wireless control
system. Through a bluetooth connection, a cellphone is used to
send commands to the bluetooth antenna of the Adruino board.
Home devices are connected to the Adruino's IO ports where a
python script is programmed to control the home devices[11].
The problem to this system is that when a change must be
done to the system (to add commands or add home device), a
new program must be uploaded to the Adruino board. A
problem in using Bluetooth technology is it only allows short
range communication to the Adruino bluetooth antenna(A). To
resolve this problem, Wi-Fi technology can be used for a wider
range of connection and Raspberry Pi can be used todirectly
program and implement a command to the system when
changes are made.

Fig. 1. Overall System Diagram.

A. 8-Channel Relay Module


Three of the five appliances in this study are connected to
the RaspberryPi through an 8-channel relay module. This
appliances are the ceiling lights, air-conditioning unit and
television. Figure 2 shows how these three appliances are
connected to the relay and how this relay acts as a medium to
connect the appliances to the RaspberryPi.

III. SYSTEM OVERVIEW


Figure 1 shows how the home automation system will
operate. The five appliances, namely: window blinds, ceiling
lights, door, air-condition unit and television, are controlled
using a Siri-enabled mobile device. These appliances are
connected to the RaspberryPis GPIO pins using a relay and a
motor driver. The iOS device and the RasperryPi are
connected to the same local network.
IV. HARDWARE DESIGN
In this section, we present the hardware part of the home
automation system. This section is divided into two parts
which consists of the hardware design using an 8-channel relay
module and an L298N motor driver.
Fig. 2. Diagram of 8-Channel Relay connected to the RaspberryPi.

8th IEEE International Conference Humanoid, Nanotechnology, Information Technology


Communication and Control, Environment and Management (HNICEM)
The Institute of Electrical and Electronics Engineers Inc. (IEEE) Philippine Section
9-12 December 2015, Waterfront Hotel, Cebu City, Philippines

B. L298N Motor Driver


The L298N motor driver is used to control the motors that
are needed for the operation of the window blinds and door.
Two 24-volts DC motor are used and are connected to the
motor driver. The motor driver has 4 input pins which are
directly connected to the corresponding GPIO pin of the
RaspberryPi, 2 of these input pins are used for the operation of
a motor. A sequence of 1-0 would make the motor turn
clockwise while a sequence of 0-1 would turn the motor
counter-clockwise. By connecting the motor to the appliances
in a specific way the motion of the motor can be used to
operate the opening and closing of both the window blind and
the door. The motor driver is connected to the RaspberryPis
GPIO pins as shown in Figure 3.

(guzzoni.apple.com) for text translation and process response


corresponding to the request [12]. Speech recognition is done
through an apple server. In order for the home automation
system to use the capability of speech recognition of Siri
application, a proxy server must be used in order for translated
voice commands to be directed to the control system that will
enable home devices. SiriProxy is a proxy server used in the
system that will hijack the translated text and response from
the apple server and process it through a SiriProxy plug-in
[13]. A SiriProxy plug-in is developed in order to create
library of commands that would enable a GPIO port of the
Raspberry Pi and will send a corresponding response to the
Siri enabled device (Figure 5) [14].

Fi
Fig. 5. SiriProxy Operaton.

Fig. 3. Diagram of L298N Motor Driver to the GPIO ports of the Raspberry
Pi.

V. SOFTWARE DESIGN
The software design of the system focuses on how to
translate voice commands to text in order for the main control
system to recognize a command that would enable a home
device.
A. Speech Recognition

Fig. 4. Standard Siri Operation.

The standard Siri operation is shown on Figure 4. Siri


application of a mobile device will generate voice packets
from the user and will be sent to the apple server

B. Domain Name Service (DNS) Configuration


A DNS is a server that provides an IP address to a user that
would direct him to a corresponding web server once the user
sends a domain name to his browser[15]. Through DNS, Siri
Application sends voice packets to an IP address of an apple
server in order to translate it to text then process what
response of the given command will be sent to the user [15].
To redirect the DNS, dnsmasq.conf must be installed and
configured in accordance to the IP address of the Raspberry Pi
[16].
In the system, we need the apple device to believe that
SiriProxy is the apple server and we also need to make the
apple server believe that the request came from the apple
device. With the use of dnsmasq.conf, we created a DNS
server for siriproxy that will redirect requests/ voice packets
from the Apple devices to the Raspberry Pi then sends back
responses to the Apple device like it came directly from the
apple server (guzzoni.apple.com) [16].Translated text and
corresponding response redirected by dnsmasq from the apple
server will processed by SiriProxy installed on the Raspberry
Pi. When the SiriProxy recognize the translated text as one of
the commands specified by a siriproxy plugin, it will send a
response for Siri and then enable a GPIO port in order to
enable a home device [14]. When it doesn't recognize the
translated text as one of the commands of the siriproxy plugin,

8th IEEE International Conference Humanoid, Nanotechnology, Information Technology


Communication and Control, Environment and Management (HNICEM)
The Institute of Electrical and Electronics Engineers Inc. (IEEE) Philippine Section
9-12 December 2015, Waterfront Hotel, Cebu City, Philippines

it will simply direct the response given by guzzoni.apple.com


to the Siri-enabled device [14].
In order for Siriproxy to hijack the request from the Sirienabled device and for the Siri-enabled device to recognize
that the response came directly from the apple server and for it
to receive responses from the siriproxy, a certificate that will
fakeApple SSL (SSL or Secure Sockets Layer is a security
feature for making sure that data passed over the internet is
kept secure and private) must be generated and installed to the
Apple device (Figure 6) [16]. The Siri-enabled devices DNS
must be configured with the same DNS of the Raspberry Pi.

Fig. 7. Code Block Diagram

VI. DATA AND RESULTS

Fig. 6. SiriProxy Certification.

C. System Control through Raspberry Pi


Ruby [17] and WiringPi [18] is used simultaneously in the
programming of the system to operate the appliances
connected to the RaspberryPi. These are used in order to fully
customize the operation of the appliances. The program allows
the control of the appliance through a specific library of
instruction sets. First, the program should recognize the
hijacked information from the Siri server. If the hijacked
information is the command programmed within the code, the
program will then have a set of responses that are programmed
by a researcher[b]. To be specific, if the user says Hello and
the program has a code that should respond to that word, it
would do the instruction that is linked to Hello. The
program is accessed through the LX Terminal.
A block diagram of the code is shown below in Figure 7. If
the user says a command, Siri will determine if that command
is written in the code or not. When there is a corresponding
command within the code, Siri will immediately go to the
server of the SiriProxy then it will go to the RaspberryPi. The
RaspberryPi will now be able to enable or disable the GPIO
pins to control one of the 5 appliances.

A. Accuracy
One of the things that the researchers had to calculate was
how accurate the system is. The test involved having 30
volunteers to test the system by saying specific commands for
each appliance. The result, as shown in Figure 8, shows that the
light off command has the lowest accuracy mark as
compared to the other commands. Siri often mistakes light
off to night off which is the cause of the error in the
response of the system. The results shows that two commands
were below 80% while the remaining commands did well and
are above the 80% mark.

Fig. 8. Percent Accuracy of the System.

B. Accuracy According to Gender


Aside from having the general accuracy rate of the system
the researchers also decided to test if the home automation is

8th IEEE International Conference Humanoid, Nanotechnology, Information Technology


Communication and Control, Environment and Management (HNICEM)
The Institute of Electrical and Electronics Engineers Inc. (IEEE) Philippine Section
9-12 December 2015, Waterfront Hotel, Cebu City, Philippines

more accurate in either men or women. Below is a set of tables,


namely Table 1 and Table 2, which shows the accuracy rate for
both men and women. The data were gathered from 17 male
and 13 female subjects. The subjects would randomly choose
from a library of commands specified by the researchers for
SiriProxy.
TABLE I. ACCURACY RATE FOR MEN
Success Rate
Appliance Aircooler Door
Lights
Blinds
Trial 1
100%
76.47%
94.12% 100%
Trial 2
82.35%
88.24% 64.71%
Total Speech Recognition Success rate for Men

Television
88.24%
82.35%
86.27%

TABLE II. ACCURACY RATE FOR WOMEN


Success Rate
Appliance Aircooler Door
Lights
Blinds
Trial 1
100%
76.92%
84.62% 92.31%
Trial 2
92.31%
69.23% 53.84%
Total Speech Recognition Success rate for Women

Television
61.54%
92.31%
80.34%

As shown above, the speech recognition system is more


accurate in recognizing speech patterns for men rather than
women. The accuracy rate for men is tallied at 86.27% while
the accuracy rate for women is tallied at 80.34%.
C. Latency

half-seconds. Moreover, the door and window blinds are


located significantly farther from the RaspberryPi compared to
others which may be a factor in its response time.
VII. CONCLUSION AND RECOMMENDATIONS
A home automation system was implemented using
Raspberry Pi that automates the 5 appliances through the use of
Siri's speech recognition capability. The Raspberry Pi's
network and DNS settings, using the Raspbian operating
system, were configured in order to connect to Siri-enabled
mobile devices. The system was able to automate the five
appliances inside the room.The system was able to automate
the air cooler to turn off and on; the air cooler to adjust the
temperature; opening and closing of the blinds and the door;
turning on and off of the lights. And finally, the system
successfully operated the TV to turn off and on, change
channels, and adjust the volume. The system is fully functional
and controlled through the use of wireless fidelity with an
overall success rate of 93.3333% at an average of 2.12s
latency.
For future use, the researchers would recommend:
Adding a feature to Siri that recognizes the other
accent.
Develop an application to be available for Android
Phones.
Automation of additional appliances by increasing the
number of IO ports on the Raspberry Pi.
Using a high RPM motor for better performance of
the motor circuits.
Utilization of sensors and other devices to determine
the current states of the appliances. (example: Door
is currently open.)
Develop this study using iOS7 or any up-to-date iOS
version available.
Adding compatibility of Linux Infrared Remote
Control (LIRC) to the system for easier control of
remote-controlled devices.
ACKNOWLEDGMENT

Fig. 9. Average Response Time for each Command

One of the most important factor in having an efficient


system is on how fast it responds to the users command. The
researchers were able to determine which appliances took the
longer response time and the appliances which have the shorter
response time. As shown in Figure 9, the door and window
blinds have the longest response time. One of the possible
reasons is due to the wiring connections and the time the
appliances should operate. The door should operate for more
than a minute and the window blinds is timed for 20 seconds,
this means that the system should process that information
longer than the rest of the appliances which only operates for

The authors would like to acknowledge Pete Lamonica who


developed the proxy server for Siri and making it open for
aspiring developers to use his proxy server for further
applications and researches. They would also thank their the
participants who took part in the study and the researchers
families for supporting them throughout this study.
REFERENCES
[1] K.P. Wacks, International Development of Home Automation
Standards, Home and Building Automation Consultant, 1992.

[2] Y.L. Kwang, and J.W. Choi, Remote-controlled home


automation system via bluetooth home network, Sice annual
conference in Fukui University, Japan, August 2003.

8th IEEE International Conference Humanoid, Nanotechnology, Information Technology


Communication and Control, Environment and Management (HNICEM)
The Institute of Electrical and Electronics Engineers Inc. (IEEE) Philippine Section
9-12 December 2015, Waterfront Hotel, Cebu City, Philippines

[3] R. Piyare, and S.R. Lee, Smart home-control and monitoring


system using smart phone, Proceedings, The 1st International
Conference on Convergence and its Application, vol. 84, pp.
83-86, 2013.
[4] P. Milhorat, S. Schogl, G. Chollet , J. Boudy, A. Esposito and G.
Pelosi, Building the next generation of Personall Digital
Assistants, 1st International Conference on Advanced
Technologies for Signal and Image Processing,May 2014.
[5] S. Das, S. Chita, N. Peterson, B. Shirazi, and M. Bhadkamkar,
Home automation and security for mobile devices, 1st IEEE
PerCom Workshop on Pervasive Communities and Service
Clouds, pp. 141-146, 2012.
[6] J.A. Nazabal, F. Falcone, C. Fernndez-Valdivielso, P.E.
Branchi, and I. Matias, Android application for accessing KNX
devices via IP connection, International Journal of Smart
Home, vol. 8, no. 4, 2012.
[7] M. Yan, and H. Shi, Smart living using bluetooth based
android smartphone, International Journal of Wireless &
Mobile Networks (IJWMN), vol. 5, no. 1, 2013.
[8] A.J. Dinusha Rathnayaka, and S.J Kuruppu, Evaluation of
Wireless Home Automation Technologies, 5th IEEE
International Conference on Digital Ecosystems and
Technologies, May 2011.
[9] J. Zhu, X. Gao, Y. Yang, H. Li, Z. Ai and X. Cui, Developing
A Voice Control System for ZigBee-based Home Automation
Networks, 2nd IEEE International Conference onNetwork
Infrastructure and Digital Content,September 2010.
[10] Apple
Inc.
(2014).
Siri
[Online].
Available:
https://www.apple.com/ios/siri.html.
[11] R. Piyare and M. Tazil, Bluetooth based Home Automation
System using Cell Phone, IEEE 15th International Symposium
on Consumer Electronics,June 2011.

[12] Domotics. Siri + Raspberry Pi + Z-Wave, your DIY Voice


Pod, [online] 2014, http://www.domotics.sg/siri-raspberry-pi-zwave-voice-pod.html
[13] P. Lamonica. (2014, September 24). SiriProxy [Online].
Available: https://github.com/plamoni/SiriProxy.html
[14] Git Hub, Inc. (2013, March 15). Plugin Developer Guide
[Online].
Available:
https://github.com/plamoni/SiriProxy/wiki/Plugin%20Developer
%20Guide.html
[15] T. Chatterjee, Configuration of DNS Server with
Cryptographic Algorithm for Secure DNS and DHCP Updates,
Third International Conference onComputing Communication &
Networking Technologies (ICCCNT),July 2012.
[16] H. Lai (2012, January 30). How to setup Siriproxy and Spire
witn
VPN
access[Online].
Available:
http://www.contrib.andrew.cmu.edu/~hanlai/?p=6.html
[17] Ruby. (2013, March 25). RubyGems Guide [Online]. Available:
http://guides.rubygems.org
[18] G. Henderson. (2013, March 25). Wiring Pi [Online]. Available:
https://github.com/WiringPi/WiringPi.html
A. D. Celebre, A. A. Dubouzet , I. A. Medina, and A. M.Surposawere born
in the Philippines. They are currently working towards theirBachelor of
Science, Degree in Electronics and Communications Engineering at De La
Salle University.
They are currently members of the Electronics and Communications
Engineering Society (ECES) and the Institute of Electronics and
Communications Engineers of the Philippines (IECEP).Their research interest
includes home automation system.

You might also like