You are on page 1of 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/269310262

Raspberry Pi based interactive home automation system through E-mail

Conference Paper · February 2014


DOI: 10.1109/ICROIT.2014.6798330

CITATIONS READS
123 7,095

3 authors:

Sarthak Jain Anant Vaibhav

8 PUBLICATIONS   146 CITATIONS   
University of Texas at Dallas
6 PUBLICATIONS   207 CITATIONS   
SEE PROFILE
SEE PROFILE

Lovely Goyal
Delhi Technological University
9 PUBLICATIONS   149 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Phd research View project

All content following this page was uploaded by Anant Vaibhav on 30 March 2015.

The user has requested enhancement of the downloaded file.


2014 International Conference on Reliability, Optimization and Information Technology -

ICROIT 2014, India, Feb 6-8 2014

Raspberry Pi based Interactive


Home Automation System through E-mail

Sarthak Jain, Anant Vaibhav, Lovely Goyal


Student member, IEEE,
Dept. of Electrical and Electronics Engineering, Maharaja Agrasen Institute of Technology
Delhi - 110086, India
sarthJain@yahoo.co.in, anant.vaib@gmai1.com, lovelygoyaI1979@gmai1.com

Abstract- Home automation is becoming more and more popular developed a Java based home automation system. The use of
day by day due to its numerous advantages. This can be achieved Java technology, which incorporates built-in network security
by local networking or by remote control. This paper aims at
features, produces a secure solution. However, the system
designing a basic home automation application on Raspberry Pi
requires an intrusive and expensive wired installation and the
through reading the subject of E-mail and the algorithm for the
same has been developed in python environment which is the
use of a high end Pc. Baudel et at (1993) proposed a novel
default programming environment provided by Raspberry Pi.
control network, using hand gestures. The controller uses a
Results show the efficient implementation of proposed algorithm glove to relay hand gestures to the system. Ardam et at (1998)
for home automation. LEDs were used to indicate the switching introduced a phone based remote controller for home and office
action. automation. The system differs in that all communications
occur over a fixed telephone line and not over the Internet. The
Key Words -Raspberry Pi, E-mail, Home Automation, Python. system can be accessed using any telephone that supports dual
tone multiple frequency (DTMF).
I. INTRODUCTION The research available into home automation in public
domain lies predominantly in the academic arena, with little
Home automation refers to the application of computer and industrial research being available in open literature. The
information technology for control of home appliances and adoption of home automation technologies into commercial
domestic features. Its application varies from simple remote systems has been limited, and where available consumer uptake
control of lighting to complex computer/micro-controller based has been slow. The aforementioned systems offer little in the
networks involving varying degrees of intelligence and way of interoperability. Attempts have been made to provide
automation. Home automation results in convenience, energy network interoperability and remote access to home automation
efficiency, and safety benefits leading to improved quality of systems through the development of home gateways. Kushirio
life. et at (1998) proposed a home energy management focused
home gateway, which connects the home network with the
The popularity of network enabled home automation has
Internet. The system was installed in twenty houses in the Tokyo
been increasing greatly in recent years due to simplicity and
area. Saito et at (2000) defined a home gateway as the point of
much higher affordability. Moreover, with the rapid expansion
ingress between a personal area network and a public access
of the Internet, there is the potential for the remote control and
network. Yoon et at (2008) implements a home gateway that
monitoring of such network enabled appliances. However, the
accepts mobile phone signals and activates or deactivates an
new and exciting opportunities to increase the connectivity of
LED representing a home device. Ok et at (2006) proposed a
devices within the home for the purpose of home automation
home gateway based on the OSGI (Open Service Gateway
through internet are yet to be explored.
Initiative), which allows service providers to access home
Several definitions are available in the literature for home
automation systems for administration and maintenance
Automation. Bromley et at (2003) describes home automation
services. These systems have made a significant contribution to
as the "introduction of technology within the home to enhance
the development of a home gateway. However, the existing
the quality of life of its occupants, through the provision of
network infrastructure within the home environment has not
different services such as telehealth, multimedia entertainment
been taken into consideration when selecting the networks for
and energy conservation". There has been significant research
integration with the respective home gateways.
into the field of home automation with many other
communication protocols like bluetooth, hand gestures, DTMF The paper proposes a Raspberry Pi based home automation
etc. The XlO industry standard, developed in 1975 for system through e-mails.
communication between electronic devices, is the oldest
standard identified from the author's review, providing limited
control over household devices through the home's power lines.
Sriskanthan et at (2002) introduced a Bluetooth based home
automation system, consisting of a primary controller and a
number of Bluetooth sub-controllers. AI-Ali et at (2004)

978-1-4799-2995-5/14/$31.00©20 14 IEEE
277
This paper presents a basic application of Raspberry Pi in
home automation control through internet (E-mail) where
subject of the received e-mail is read by the developed algorithm
fed into raspberry Pi and system responds to the corresponding
instructions. The presented system is interactive, efficient and
flexible according to the consumer needs. It immediately replies
the status of work done by raspberry Pi to the consumer. The
proposed system has been tested practically using LEDs as
switching signal indicators, which can be seen in the presented
results. The project can be extended for more applications apart
from switching of home devices like surveillance, power
Fig. I. Raspberry Pi board. monitoring, fauIt monitoring, power control, security etc.

II. SYSTEM CONFIGURATION


Raspberry Pi (shown in Fig. 1) is a credit-card-sized single­
Fig. 3 describes the configuration of the proposed system.
board computer developed in the UK by Raspberry Pi
Raspberry Pi has been chosen as the processing unit for the
foundation with the intention of stimulating the teaching of
system because of its user friendly features and economical
basic computer science in schools. It has two models; Model A
benefits. Further, python coded algorithm has been fed into the
has 25 6Mb RAM, one USB port and no network connection.
raspberry Pi and is connected to the internet through Modulator­
Model B has 5 12Mb RAM, 2 USB ports and an Ethernet port. It
Demodulator (MODEM) interface to access and send e-mails to
has a Broadcom BCM2835 system on a chip which includes an
the consumer. The Devices to be controlled have been
ARMl176JZF-S 700 MHz processor, Video Core IV GPU, and
interfaced with raspberry Pi using relay driver circuit due to
an SD card. The GPU is capable of Blu-ray quality playback,
different power ratings of devices and raspberry Pi. A display
using H.264 at 40MBits/s. It has a fast 3D core accessed using
(optional) may also be connected to view the instantaneous
the supplied OpenGL ES2.0 and OpenVG libraries. The chip
status and processing of raspberry Pi.
specifically provides HDMI and there is no VGAsupport.
The foundation provides Debian and Arch Linux ARM � Receiving
distributions and also Python as the main programming
language, with the support for BBC BASIC, C and Perl, detailed
description of Raspberry Pi board has been given in Fig. 2
(Raspbefl)' Pi user guide). Python was chosen as the main
programming language, as it is generally accepted to be both
easy to learn and a fully fledged , programming language
suitable for real world applications. With the addition of
NumPy, SciPy, Matplotlib, IPython, and PyLab, Python can be
used for computational mathematics as well as for the analysis Fig. 3. Layout of the proposed system configuration
of experimental data or control systems (Ali etal-2013).
Also, the recent development of the Raspberry Pi mini­ III. CONTROL ALGORITHM
computer has unlocked great potential for computing to be
applied in a vast number of areas. Due to the unique advantages
of the Raspberry Pi system, this technology holds great promise 3V3 1 2 5V

for providing solutions within the developing world. This

LED (Switch (l
includes but is not limited to education tools, especially the use
3 4 GND
of GPIO (General Purpose Input/Output) which allows
I
I I)

� LED3(Switch3)
automated data acquisition and producing simple digital control GPI04

LED2(Switch2) r-
systems in a school laboratory setting. The most distinctive 5 6
feature of the Raspberry Pi when used for educational purposes
is the GPIO module, which allows interfacing with general
I GPIOl7
7 8
I GPIOl8
I
purpose electronics (Ali etal-2013).

9 10

11 12

Raspberry Pi �
Quick start � 13 14

15 16

Fig. 2. Description of raspberry Pi Board. Fig. 4. Pin layout of raspberry Pi GPIO used in system.

278
The GPIO pins for input and output have been defined to if(len(x)<>O):
control different devices. The Raspberry Pi board has GPIO pin GPIO.setmode(GPIO.BOARD)
layout as shown in fig. 4. Out of the 26 pins, 3 pins have been #s ignal to devices

used to control three devices in this project which have been if(x[O] == 'ONI'):
represented by 3 LEDs for testing the switching signal. For Reply('Turning ON swithch I' , y[O])
practical purposes a relay driver circuit and relays can be GPIO.setup(7,GPIO.OUT)
interfaced with Raspberry Pi and appliances, respectively, for GPIO.output(7,GPI0.HIGH) #Turn ON LEDI
their controlling. if(x[O] == 'ON2'):
Reply('Turning ON switch 2', y[O])
GPIO.setup(II,GPIO.OUT)

GPIO.output(II,GPIO.HIGH) #Turn ON LED2


if(x[O] == 'ON3'):
Initi alise the system Reply('Turning ON swithch 3', y[O])
(i.e., log in home aCCOJIt
Dedicated to Rasp8err)pI, GPIOpins GPIO.setup(12,GPIO.OUT)
fordevice intermcing, etc) GPIO.output(12,GPI0.HIGH) #Turn ON LED3
if(x[O] == 'OFFI '):
Reply('Turning OFF swithch 1', y[O])

GPIO.setup(7,GPIO.OUT)
GPIO.output(7,GPI0.LOW) #Turn OFF LEDI
if(x[O] == 'OFF2'):
Reply('Turning OFF swithch 2', y[O])
GPIO.setup(II,GPIO.OUT)
Implement GPIO.output(II,GPIO.LOW) #Turn OFF LED2
the funct ion
if(x[O] == 'OFF3'):
correspondi
ng to the Reply('Turning OFF swithch 3', y[O])
read subject
GPIO.setup( 12,GPIO.OUT)
and reply
the status to GPIO.output(12,GPI0.LOW) #Turn OFF LED3
the senrer time.sleep(O.S) #call delay

Fig. 6. Control Structure of proposed algorithm coded in pythonIDE

Wait for 0. 5 s e conds befu re


checking thc new mail and
update IV. PERFORMANCE EVALUATION
For verification of the practicality of the proposed algorithm,
LEDs were used to indicate the switching signal of the
interfaced devices. The experimental setup is shown in Fig. 7.
Results were generated by a series of E-mails sent to the G-mail
Fig. 5. Flowchart of the control algorithm used. account of raspberry pi and the corresponding inbox and sent
mails of raspberry G-mail account are shown in Fig. 8 and Fig.
The pins used in this project were: pin7(GPI04), 9, respectively. For example, an E-mail with the subject
pinll(GPIOI7) and pinI2(GPIOI8) . The code for
implementing the control strategy for home automation was
written in python environment on Raspberry Pi. Firstly, the
code was set to initialize and log in into home g-mail account (g­
mail-imap) using the e-mail library of pythonIDE. After
successful initialization, Raspberry Pi starts reading the
subjects of e-mails from the account specified in the code. The
subject of these e-mails is then compared from the initializing
commands of the interfaced devices and the control signal is
generated according to it on the corresponding GPIO pin. This
process is repeated continuously at an interval of 0.5 seconds.
Fig. 5 represents the algorithm of the used code in the form of
flowchart. Fig. 6 shows the controlling module of the proposed
algorithm, coded in pythonIDE. Here, the subject read from the
e-mail is stored in an array x[], and the 'if structure was defmed
as per the elements of that array, i.e. if subject is 'ONI', raspberry
Pi replies 'Turning On switch I' to the sender and
simultaneously the switch at pin.7 is turned ON and the
structure is looped for checking new mail after every 0.5
seconds. Fig. 7. Working Experimental setup, responding to email with subject 'On I"
i.e. LEDI is glowing, representing the switching signal for switch I.

279
·O N l ' w a s s e n t t o r a s p b e r r y P i a c c o u n t
('raspanantsarthak@gmail.com' in this case) from the consumer
account (,anant.vaib@gmail.com' in this case). The algorithm, Go gle
read the subject 'ONI' and turned ON the device 1 represented
by LEDI and instantly replied to sender by an email - Gmail- .... •
'Turning ON switch l' under the subject- 'Home automation
activated'. The code also includes exception handling in case of *NH+* � GoDaddy - Find New Custo mers Online - Rs. 10

invalid e-mail from the consumer. Inbox


Home_automation_activated
Starred

Similarly the same switch can be turned OFF by sending an raspanantsarthak@gmail.com


Important
to anant vaib ...
e-mail with subject 'OFFI' to the raspberry Pi account. Further, Sent Mail Turning ON swithch 1
This work consists of two more switches which can be Drafts

controlled by sending e-mails under the subject- 'ON2' & 'ON3' � Circles raspanantsarthak@gmail.com
to turn ON the switch2 & Switch3 and correspondingly - 'OFF2' to anantvaib ....

& 'OFF3" to turn them OFF. So, the results show that home - ..... - Turning OFF swithch 1

automation has been successfully implemented with efficiency Search, chat or SMS

and reliability. Looks like you donOt raspanantsarthak@gmail.com


have anyone to chat to ananLvaib ....
with yet. Invite some
V. CONCLUSION & FUTURE SCOPE contacts to get started. Turning ON switch 2
Learn more

In this highly developing era, where directly or indirectly, raspanantsarthak@gmail.com


everything is dependent on computation and information to ananLvaib ....

1
technology, Raspberry Pi proves to be a smart, economic and Turning ON swithch

efficient platform for implementing the home automation. This


paper provides a basic application of home automation using Fig. 9. Screen shot of "SENT MAIL" from raspberry Pi
Raspberry Pi which can be easily implemented and used
efficiently. The code provided is generic and flexible in a user REFERENCES
friendly manner and can be extended for any future applications
[I] AI-Ali A. R. and AI-Rousan M., "Java-based home automation
like power control, surveillance, etc, easily. Moreover, this system",IEEE Transactions on Consumer Electronics,vol. 50,
technique is better than other home automation methods is no. 2,pp. 498- 504,2004.
several ways. For example, in home automation through DTMF, [2] Ali M., V laskamp J.H.A, Eddiny N.N. , Falconer B. and Oram
the call tariff is a huge disadvantage, which is not the case in c., "Technical Development and Socioeconomic
proposed method. Also, in Web server based home automation, Implications of the Raspberry Pi as a Learning Tool in
the design of web server and the space required is eliminated by Developing Countries", 5th Computer Science and Electronic
this method, because it simply uses the already existing web Engineering Conference (CEEC),pp. 103- 108,2013.

server provided by G-mail. [3 ] Ardam H. and Coskun I., "A remote controller for home and
office appliances by telephone", IEEE Transactions on
Consumer Electronics,vol. 44,no. 4,pp. 1291-1297,1998.

gle
[4 ] Baudel T. and Beaudouin-Lafon M., "Charade: remote control
Go of objects using free-hand gestures", Communications of the
ACM,voI. 36,no. 7,pp. 28-35,1993.
[ 5] Bromley K., Perry M., and Webb G. "Trends in Smart Home
Systems, Connectivity and Services",
Gmail T o More ..
www.nextwave.org.uk,2003.
[6] Kushiro N. , Suzuki S., Nakata M., Takahara H. and Inoue M.,
Soc "Integrated home gateway controller for home energy
C Primary I
.-
.
management system", IEEE International Conference on
Consumer Electronics,pp. 386-387,2003.
Inbox [7] Ok S. and Park H. , "Implementation of initial provisioning
Anant vaibhav (2) ON1 function for home gateway based on open service gateway
Starred
initiative platform", T he 8th International Conference on
Advanced Communication Technology,pp. 1517-1520,2006.
Important Anant vaibhav OFF1
[8 ] Saito T., Tomoda I., Takabatake Y., Ami J. and Teramoto K.,
"Home Gateway Architecture And Its Implementation", IEEE
Sent Mail
Anant vaibhav ON2 International Conference on Consumer Electronics, pp. 194-
195,2000.
[9 ] Sriskanthan N. ,Tan F. and Karande A. ,"Bluetooth based home
Fig. 8. Screen shot of "lNBOX" received on raspberry Pi automation system", Microprocessors and Microsystems,Vol.
26,no. 6,pp. 281-289, 2002.
www.raspberrypi.orgjarchives/tagjraspberry-pi-user-guide
[ 10 ] YoonD. ,BaeD.,Ko H. and Kim H., "Implementation of Home
Gateway and GUI for Control the Home Appliance", T he 9th
International Conference on Advanced Communication
Technology,pp. 1583-1586,2007.

280
View publication stats

You might also like