Android Controlled Home Automation: September 2014
Android Controlled Home Automation: September 2014
Android Controlled Home Automation: September 2014
discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/266373446
CITATIONS READS
0 19,555
3 authors, including:
Sabin Adhikari
Kathmandu Engineering College
3 PUBLICATIONS 0 CITATIONS
SEE PROFILE
All in-text references underlined in blue are linked to publications on ResearchGate, Available from: Sabin Adhikari
letting you access and read them immediately. Retrieved on: 26 September 2016
TRIBHUVAN UNIVERSITY
INSTITUTE OF ENGINEERING
By
Sabin Adhikari
Sangam KC
Santosh Lamichanne
Urjala Bajracharya
Kathmandu, Nepal
2071
TRIBHUVAN UNIVERSITY
INSTITUTE OF ENGINEERING
By
Sabin Adhikari
Sangam KC
Santosh Lamichanne
Urjala Bajracharya
Kathmandu, Nepal
2071
TRIBHUVAN UNIVERSITY
INSTITUTE OF ENGINEERING
Kathmandu Engineering College
Department of Electronics and Communication
Engineering
ANDROID CONTROLLED
HOME AUTOMATION
By
Sabin Adhikari
Sangam KC
Santosh Lamichanne
Urjala Bajracharya
Kathmandu, Nepal
BHADRA 2071
TRIBHUVAN UNIVERSITY
Kathmandu Engineering College
Department of Electronics and communication Engineering
TRIBHUVAN UNIVERSITY
INSTITUTE OF ENGINEERING
Kathmandu Engineering College
Department of Electronics and Communication
Engineering
CERTIFICATE
The undersigned certify that they have read and recommended to the Department of
Electronics and communication Engineering, a final year project work entitled
Android Controlled Home Automation submitted by (Sabin Adhikari, Sangam KC,
Santosh Lamichanne, Urjala Bajracharya) in partial fulfillment of the requirements for
the degree of Bachelor of Engineering.
Acknowledgement...............................................................i
Abstract..........................................................................ii
List of Figures..................................................................iii
List of Table.....................................................................iii
1. Introduction
1.1 Introduction.............................................................1
1.2 Project Objectives............................2
1.3 Project Scope...................2
1.4 Technology exposure that project provides....3
1.5 Project Management...........3
2. Literature Review........5
3. Background Theory.........6
3.1 Block Diagram of Proposed Design....6
3.2 Background..............7
3.3 Solution Details...9
3.4 Raspberry Pi............................................................9
4. Methodology ...................10
4.1 Start Mode Activity...........10
4.2 Option Mode Activity....10
4.3 Voice Mode Activity.....11
4.4 Switch Mode Activity....11
4.5 Video Mode Activity.........11
5. Hardware & Programming Language Description.....12
5.1 Hardware Description....12
5.2 Software Description.....13
6. Epilogue..........................................14
6.1. Limitation.............................................................14
6.2. Discussion.............................................................14
6.3. Conclusion............................................................14
6.4. Further Enhancement............................................15
References....................................................................16
Bibliography.....................................................................17
Appendixes
1. Part list with cost estimation
2. Gantt chart
3. Raspberry pi GPIO
4. Raspberry pi Quick Start Guide
List of Figures
1. Waterfall Model....4
2. Gantt Chart....5
3. Block Diagram of Proposed System............................................7
4. Start Mode Activity......................................................11
5. Option Mode Activity...........................11
6. Voice Mode Activity............................12
7. Switch Mode Activity..........................12
8. Block Diagram of Hardware Description.13
List of Table
1. Part List with Cost Estimation.................................15
iii
Acknowledgement
This major project would not have been possible without the valuable assistance of
many people to whom we are indebted, in particular, our project coordinator Shankhar
Gongaju of Kathmandu Engineering College.
We would also like to thank Department of Electronics and Computer, Kathmandu
Engineering College for providing us with the necessary components for our project.
Our thank also goes to all the teachers of Electronics and Computer Department who
helped us in many difficult situations regarding the project and provided with the
necessary advice.
A special word of thanks is to our class mates and our families for providing us the
moral support. A word of thanks to our friends Shreya Dahal, Rishikesh Bhandari,
who helped us in many ways.
i
Abstract
This project presents the overall design of Home Automation System (HAS) with
low cost and wireless system. This system is designed to assist and provide
support in order to fulfill the needs of elderly and disabled in home. Also, the
smart home concept in the system improves the standard living at home. . The
switch mode and voice mode are used to control the home appliances. The video
feedback is received in the android application which streams the video of IP-
Camera. The main control system implements wireless technology to provide
remote access from smart phone. The design remains the existing electrical
switches and provides more safety control on the switches with low voltage
activating method. The switches status is synchronized in all the control system
whereby every user interface indicates the real time existing switches status. The
system intended to control electrical appliances and devices in house with
relatively low cost design, user-friendly interface and ease of installation.
ii
1
1. Introduction
1.1. Background
The Home Automation concept has existed for many years. The terms Smart
Home, Intelligent Home followed and has been used to introduce the concept of
networking appliances and devices in the house. Home automation Systems (HASs)
represents a great research opportunity in creating new fields in engineering, and
Computing. HASs includes centralized control of lighting, appliances, security locks
of gates and doors and other systems, to provide improved comfort, energy efficiency
and security system. HASs becoming popular nowadays and enter quickly in this
emerging market. However, end users, especially the disabled and elderly due to their
complexity and cost, do not always accept these systems.
This project forwards the design of home automation and security system using
Raspberry pi, a credit sized computer. Raspberry pi provides the features of a mini
computer, additional with its GPIO pins where other components and devices can be
connected. GPIO registers of raspberry pi are used for the output purposes. We have
design a power strip that can be easily connected to GPIO Pins of the Raspberry pi.
The home appliances are connected to the input/output ports of Raspberry pi along
with the power strip and their status is passed to the raspberry pi. The android running
OS in any phone connected to a network can access the status of the home appliances
via an application. It presents the design and implementation of automation system
that can monitor and control home appliances via android phone or tablet.
2
1.3. Scopes
The project aims at designing a prototype for controlling the home appliances that can
be controlled wirelessly via an application that provides the features ofspeech
recognition, video streaming, and switch mode. An application is run on android
device. The system can be used in wide range of areas.
The system integrated with different features can be applied in the following fields.
The system can be used in home, small offices to the big malls
The system can be used from home to offices to control the electrical
appliances.
3
2. Wi-Fi technology.
6. Embedded programming.
4
1.5.1. Experimentation
In this step, we were discussing about the necessary equipments and materials. We
were studying about the similar projects, gathering the information of programming
language to be used. We were developing simple algorithms and flowcharts.
1.5.2. Design
In this phase, we were designing the layout of the application. The necessary features
to be included. We were designing the power strip to connect the home appliances
that can be controlled via GPIO pins.
1.5.3. Development and Testing
In this phase, the development of application was performed. The bugs were
identified and removed. We consulted many software experts for the evaluation of our
application. Hardware design includes the design of power strip.
Finally, our system was ready to be tested in the real electrical appliances.
5
2. Literature Review:
As per our survey, there exist many systems that can control home appliances using
android based phones/tablets. Each system has its unique features. Currently certain
companies are officially registered and are working to provide better home
automation system features. Following models describes the work being performed by
others.
N. Sriskanthan [7] explained the model for home automation using bluetooth via PC.
But unfortunately the system lacks to support mobile technology.
Muhammad Izhar Ramli [8] designed a prototype electrical device control system
using Web. They also set the server with auto restart if the server condition is
currently down.
Hasan [9] has developed a telephone and PIC remote controlled device for controlling
the devices pin check algorithm has been introduced where it was with cable network
but not wireless communication.
Amul Jadhav [10] developed an application in a universal XML format which can be
easily ported to any other mobile devices rather than targeting a single platform.
Each of these system has their own unique features and on comparison to one another
lacks some advancement.
Our designed system has application layer prototype. The application is able to
synthesize the speech data with the help of Google Voice Reorganization. The
synthesized data are analyzed and further processing is carried out. In layman words,
our design system provides features of controlling the home appliances using voice
commands.
The use of socket programming is performed to connect the android application with
the raspberry pi. This further adds security to our system. The data are received only
by the server at the specified port and data are further analyzed. Our project is
different in a sense it has its own software level application to control the home
appliances.
7
3. Block Diagram
Android device
Network IP
(mobile/ tablet)
(Router) camera
Wi-Fi Adapter
Raspberry Pi
1. Switch Mode
2. Voice Mode
3. Video Mode
Switch mode uses the radio buttons that are used to control the home appliances. The
radio button sends the status of the switch.
Voice Mode is used to control the home appliances using voice command. Using the
inbuilt microphone of Smartphone, the application creates an intent that fetches the
speech data to the Google server which responds with a string data. The string data
are further analyzed and then processed.
Video Mode shows the video stream of the room. The captured video is streamed at
the android application.
All the devices are connected to a common network. Smartphone, raspberry pi and IP
camera are connected to the common network Router is used to create a common
network.
IP Camera
This security camera can offer you the freedom to get your home or business
surveillance via network anytime and anywhere. It comes with alarm function, when
somebody appears on the camera under alarm function, it will take a picture or sound
the alarm and email the pictures to you immediately. IP camera can be used in various
places, such as warehouse, office, supermarket, and doorkeeper and so on.
9
3. File Transfer Protocol Setting and Email Setting Provides the features of
emailing the video stream or images at the regular interval of time.
Advantages of Wi-Fi over other wireless technologies like Bluetooth and ZigBee:
Bluetooth is generally used for point to point networks and Bluetooth operates at a
much slower rate of around 720 Kbps which is very small for video transfer or
moving large amount of data like the image captured from a camera, whereas the
bandwidth of Wi-Fi can be up to 150Mbps and very ideal for video transmission.
Wi-Fi connection to send video, audio, and telemetry operation, while accepting
remote control commands from an operator who can be located virtually anywhere in
the world.
Robots are already being eyed for obvious tasks like conducting search-and rescue
missions during emergencies or hauling gear for soldiers in the jungle or woods. The
mechanics of the robot uses the concept that has been developed to ensure robust
navigation, search and transportation in rough terrain.
Control electronics
Raspberry Pi as the controller for its processing power and large developer
community.
4 relays are connected to power strips.
10
4. Application Description:
Figure 4.1: Start Mode Activity Figure 4.2: Option Mode Activity
Figure 4.3: Voice Mode Activity Figure 4.4: Switch Mode Activity
This mode displays the video of the IP cameras connected at the rooms of the home.
13
Eclipse software is used to write the codes for the application under Java Platform.
Raspbian OS is used at the raspberry pi. Server is established at raspberry pi. Python
Language is used to write the codes of server, and to control the GPIO Pins of OS.
5.2.1. Java:
Java is a set of several computer software products and specifications from Oracle
Corporation that provides a system for developing application software and deploying
it in a cross-platform computing environment. Java is used in a wide variety of
computing platforms from embedded devices and mobile phones on the low end, to
enterprise servers and supercomputers on the high end.
5.2.2. Python:
Python is an interpreter, interactive, object-oriented programming language. It
incorporates modules, exceptions, dynamic typing, very high level dynamic data
types, and classes. Python combines remarkable power with very clear syntax. It has
interfaces too many system calls and libraries, as well as to various window systems,
and is extensible in C or C++. It is also usable as an extension language for
applications that need a programmable interface.Python is a high-level general-
purpose programming language that can be applied to many different classes of
problems.
5.2.3. Raspbian:
Raspbian is a free Operating System based on Debian optimized for the raspberry pi
hardware. Raspbian comes with more than 35000 packages; pre-combined software
bundled in a nice format for easy installation on Raspberry pi.
15
1 1500 Available
WiFi Adapter
8. Limitations
Android devices having lower API version than 16 requires internet access to convert
the speech data to string data. Currently, the application is made for Android Smart
Phones; other OS platform doesnt support our application.
During voice mode, external noises (voice) may affect our result. The speech
instruction that we command in our voice mode may not give exact result as expected.
9. Further Enhancements:
Looking at the current situation we can build cross platform system that can be
deployed on various platforms like iOS, Windows. Limitation to control only several
devices can be removed by extending automation of all other home appliances.
Network can be connected to internet and Security cameras can be controlled from
other places, allowing the user to observe activity around a house or business.
Security systems can include motion sensors that will detect any kind of unauthorized
movement and notify the user. Scope of this project can be expanded to many areas
by not restricting to only home.
17
10. Conclusion:
The prime objective of our project is to use the Smartphone to control the home
appliances effectively. The switch mode and voice mode are used to control the home
appliances. The video feedback is received in the android app which streams the video
of IP- Camera.
This project is based on the Raspberry pi, Android platform Java and Python. These
platforms are Free Open Source Software. So the overall implementation cost is low
and can be easily configured.
User can easily interact with the android phone/tablet. The user can send commands
via the switch mode or speech mode. The data are being analyzed by the application
and are sent over a network. The Raspberry pi acts as a server, analyses the data and
activates the GPIO (General Purpose Input Output) Pins. The GPIO Pins are
connected to the relays switch which activated the required home appliances.
In this way, automation process is carried out. This is a simple prototype. Using this
as a reference further it can be expanded to many other programs.
18
11. References
1. https://docs.python.org/
2. http://developer.android.com/training/index.html
3. http://elinux.org/RPi_Hub
4. http://www.raspberrypi.org/
5. http://stackoverflow.com/
6. http://electronics.howstuffworks.com/
7. N. Sriskanthan and Tan Karand. Bluetooth Based Home Automation
System. Journal of Microprocessors and Microsystems, Vol. 26, pp.281-289,
2002.
8. Muhammad Izhar Ramli, Mohd Helmy Abd Wahab, Nabihah, TOWARDS
SMART HOME: CONTROL ELECTRICAL DEVICES ONLINE
,Nornabihah Ahmad International Conference on Science and Technology:
Application in Industry and Education (2006)
9. E. Yavuz, B. Hasan, I. Serkan and K. Duygu. Safe and Secure PIC Based
Remote Control Application for Intelligent Home. International Journal of
Computer Science and Network Security, Vol. 7, No. 5, May 2007
10. Amul Jadhav, S. Anand, Nilesh Dhangare, K.S. Wagh Universal Mobile
Application Development (UMAD) On Home Automation Marathwada
Mitra Mandals Institute of Technology, University of Pune, India Network
and Complex Systems ISSN 2224-610X (Paper) ISSN 2225-0603 (Online)
Vol 2, No.2, 2012
Appendix A: Raspberry Pi GPIO
Introduction
The Raspberry Pi allows peripherals and expansion boards to access the CPU by
exposing the in and outputs. The production board has a 26-pin 2.54mm (100mil)
expansion header, arranged in a 2x13 strip. They provide 8 GPIO pins plus access to I2C,
SPI, UART), as well as +3V3, +5V and GND supply lines. Pin one is column 0 on the
bottom row. Voltage levels are 3v3. There is no over-voltage protection on the board -
the intention is that people interested in serious interfacing will use an external board
with buffers, level conversion and analog I/O rather than soldering directly onto the main
board.
It is also possible to reconfigure some of the pins to provide a second I2C interface.
Kernel boot messages go to the UART at 115200bps.
Header Pinout:
5
Top DN GN TX RX GPI DN GPI GPI SPI_CE SPI_CE
V DNC GPIO6
Row C D D D O1 C O4 O5 0_N 1_N
0
Bott 3
SD SC GPI DN GPI GPI GPI DN SPI_M SPI_M SPI_SC
om V DNC
A0 L0 O7 C O0 O2 O3 C OSI ISO LK
Row 3
Colour legend
+5V
+3.3V
Do not connect
UART
GPIO
SPI
I2C
Power Pins
Maximum permitted current draw from the 5v pin is the USB input current (usually 1A)
minus any current draw from the rest of the board.
The available alternative functions and their corresponding pins are detailed below. These
numbers are in reference to the chipset documentation and may not match the numbers
exposed in linux or detailed above. Only fully usable functions are detailed, for some
alternative functions not all the necessary pins are available for the functionality to be
actually used. All exposed pins can be used for GPIO
0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25
It is also possible to reconfigure some of the pins to provide an ARM JTAG interface.
However ARM_TMS isn't available for this (chipset pin 12 or 27 is needed).
It is also possible to reconfigure some of the pins to provide an I2S (hardware mod may
be required) or PCM interface.
MIPI CSI-2
The MIPI CSI-2 interface to a 15-way flat flex connector is Sony sub-LVDS.
DSI
CEC
Connecting Together
You can use the diagram to connect everything together, or use the following
instructions:
1. Plug the preloaded SD Card into the Pi.
2. Plug the USB keyboard and mouse into the Pi, perhaps via a USB Hub. Connect the
Hub to power, if necessary.
3. Plug the video cable into the screen (TV) and into the Pi.
4. Plug your extras into the Pi (USB WiFi, Ethernet cable, hard drive etc.). This is
whereyou may really need a USB Hub.
5. Ensure that your USB Hub (if any) and screen are working.
6. Plug the power source into the main socket.
7. With your screen on, plug the other end of the power source into the Pi.
8. The Pi should boot up and display messages on the screen.
It is always recommended to connect the MicroUSB Power to the unit last (while
mostconnections can be made live, it is best practice to connect items such as
displays/h/w pinconnections with the power turned off).
The RPi may take a long time to boot when powered-on for the first time, so be patient!
As the RPi has no internal storage or built-in operating system it requires an SD-Card that
isset up to boot the RPi.
You can create your own preloaded card using any suitableSD card you have. Be
sureto backup any existing data on the card.
Preloaded SD cards will be available from the RPi Shop.
This guide will assume you have a preloaded SD card.
Note: There is no VGA output available, so older VGA monitors will require anexpensive
adaptor.
Using an HDMI to DVI-D (digital) adaptor plus a DVI to VGA adaptor will not work.
HDMIdoes not supply the DVI-A (analogue) needed to convert to VGA - converting an
HDMI or
DVI-D source to VGA (or component) needs an active converter. (It can work out
cheaper tobuy a new monitor.) The lack of VGA has been acknowledged as a priority
issue.
Power Supply
The unit uses a Micro USB connection to power itself (only the power pins are connected
soit will not transfer data over this connection). A standard modern phone charger with
a micro-USB connector will do, but needs to produce at least 700mA at 5 volts. Check
your powersupply's ratings carefully. Suitable mains adaptors will be available from the
RPi Shop andare recommended if you are unsure what to use.
You can use a range of other power sources (assuming they are able to provide
enoughcurrent ~700mA):
Computer USB Port or powered USB hub (will depend on power output)
Cables
You will probably need a number of cables in order to connect your RPi up.
1. Micro-B USB Power Cable
2. HDMI-A or Composite cable, plus DVI adaptor or SCART adaptor if required,
toconnect your RPi to the Display/Monitor/TV of your choice.
3. Audio cable, this is not needed if you use a HDMI TV/monitor.
4. Ethernet/LAN Cable
Additional Peripherals
You may decide you want to use various other devices with your RPi, such as Flash
Drives/Portable Hard Drives, Speakers etc.
Internet Connectivity
This may be an Ethernet/LAN cable (standard RJ45 connector) or a USB WiFi adaptor.
TheRPiethernet port is auto-sensing which means that it may be connected to a router or
directlyto another computer (without the need for a crossover cable).
USB-Hub
In order to connect additional devices to the RPi, you may want to obtain a USB Hub,
whichwill allow multiple devices to be used.
It is recommended that a powered hub is used - this will provide any additional power to
thedevices without affecting the RPi itself.
USB version 2.0 is recommended. USB version 1.1 is fine for keyboards and mice, but
maynot be fast enough for other accessories.
Case
Since the RPi is supplied without a case, it will be important to ensure that you do not use
itin places where it will come into contact with conductive metal or liquids, unless
suitablyprotected.
Expansion & Low Level Peripherals
If you plan on making use of the low level interfaces available on the RPi, then ensure
youhave suitable header pins for the GPIO (and if required JTAG) suitable for your
needs.
Also if you have a particular low-level project in mind, then ensure you design in
suitableprotection circuits to keep your RPi safe.