You are on page 1of 4

2017 2nd International Conference on Frontiers of Sensors Technologies

Voice Activated Smart Home Design and Implementation

Chan Zhen Yue Shum Ping


School of Electrical and Electronics Engineering Director, Centre for Optical Fibre Technology
Nanyang Technological University Nanyang Technological University
Singapore Singapore
e-mail: zchan012@e.ntu.edu.sg e-mail: epshum@ntu.edu.sg

Abstract—For over more than a decade, smart systems have become the latest trend in this field. Various devices
played an important part in human daily life. With the use of including Philips Hue, Samsung Smart Thing, WeMo and
modern technologies, smart sensors, processors and phones, Ecobee are also developed to work with the above-
the present smart home systems enhance distributed mentioned smart home system. The main advantage of using
entertainment, household control, home energy monitoring, voice recognition in smart home system is to reduce the
home security and surveillance. The services provided include effort of using smartphone and the need of developing a
voice controlled alarms, personalized calendars with weather mobile application. On the other hand, users especially the
forecast, and news report reminders. This paper presents an elderly can save the time spent familiarizing with the
overall design for low-cost, micro-processor based smart home
dynamic operating technologies. People with disabilities also
system designed for hall residents of Nanyang Technological
have access to use the smart home system.
University (as the main beneficiary). It aims to improve their
academic performance by providing a better quality of living.
The aim of this paper is to design and implement a
The system can also be operated as a computer and supports quality home assistant which can control by both voice and
integration with various sensors through its General-purpose text commands. Voice commands are captured by Amazon
Input / Output pins (GPIO). Users can customize their needs Voice Service (AVS), also known as Alexa. It is then
through this system. The presented system integrates processed by Amazon Developer Console, Alexa Skill Sets
household appliance control, entertainment system, hall and Ngrok service before reaching the control terminal, a
facilities monitoring and home security. It is controlled via Raspberry Pi. User can access and manage these services via
Telegram on smart phones and Alexa Voice Service (AVS) and Amazon Developer Console.
Amazon Developer Console supported by Amazon.
II. LITERATURE REVIEW
Keywords-raspberry Pi; Python; smart home; Telegram; The basic idea of a smart home system is to control and
Alexa; Alexa skill sets monitor household appliance wirelessly and verbally.
Amruta S Et Al. [2] proposed a computer based wireless
I. INTRODUCTION smart home system. The proposed system consists of an
Home automation is an act of using devices and automatic speech recognition system which identifies the
programming through a network to control home functions spoken words and translates them into text command in
for a better quality of life. It reduces human interactions as MATLAB. The text command will be transmitted to a
much as technically possible and replaces them with microcontroller via a low-powered RF ZigBee based remote
programmed electronic systems. Smart home has been a control system. The microcontroller controls the household
developmental focus for global technology corporates such electrical appliances via its corresponding relays.
as Google and Amazon. By 2022, global smart home market Sonali Sen Et Al. [3] proposed another voice controlled
is expected to reach USD 121.73 Billion, a huge growth smart home project. It was implemented with an Android
from USD 46.97 Billion in 2015 [1]. The most common based smartphone, an Arduino UNO, a Bluetooth module
features of the smart home systems in the market comprise and relays which are connected to the household appliances.
household control, smart room, security, surveillance, The Speech to Text service (STT) is implemented by the
entertainment system, energy saving and healthcare. built-in Android voice recognizer, and the Bluetooth module
Generally, most of the smart home systems make use of transmits the text command to the serial ports of Arduino
wireless technology such as internet, radio frequency and UNO. Based on the text commands to the General-Purpose
Bluetooth as means of communication between the Input / Output (GPIO) pins, the relays are set to ON or OFF
controllers and receivers. Users are able to send commands accordingly.
and control the smart home systems via computers,
III. PROPOSED SYSTEM
smartphones and pre-built programming codes. Various
Android and iOS based mobile applications are developed to The proposed system utilizes the services provided by
improve the user experience. Amazon, which is capable of capturing voice commands and
Today, with the introduction of Google Home and processing them. The command will be sent to a local
Amazon Echo, voice controlled smart home system has webserver created by Raspberry Pi microprocessor. This

978-1-5090-4860-1/17/$31.00 ©2017 IEEE 


connection service is provided by Ngrok by generating a to be programmed. Raspberry Pi can also be connected and
secured public Uniform Resource Locator (URL). Upon controlled by a smartphone or computer via the Secure Shell
receiving the commands, the Raspberry Pi will execute the (SSH). Created by Simon Tatham, PuTTY is one of the free
control of its GPIO pins with the written Python scripts. SSH clients for Windows platform [5] and it is used in this
Users can control the smart home system via the microphone project. In short, the Raspberry Pi takes input from the
attached to the Raspberry Pi, Amazon Reverb mobile app processed voice commands and various sensors, processes
installed on any smart phones or text commands via them with the written Python codes and executes the
Telegram app. corresponding commands specified by the codes. Figure 2
shows the front schematic of a Raspberry Pi 3 Model B.
B. Alexa Skill Kits / Amazon Developer Console
The Amazon Voice Service, also known as Alexa, is not
only the core of the voice recognition function in this smart
home system, but also the brain of millions of devices
including Amazon Echo – the smart home device developed
by Amazon. The proposed smart home system uses Amazon
Voice Service as its voice recognition system due to its user-
friendliness and the cost of prototyping. The free tier account
is usually sufficient for development purpose. Application
Program Interfaces (APIs) are created via the Alexa Skill
Kits (ASK), where the voice commands are defined and
processed before sending them to a local server hosted by the
Figure 1. Block Diagram of the System. Raspberry Pi. Figure 3 shows the architecture of Alexa Skill
Kits [6].
The key components of this voice activated smart home are:
x Raspberry Pi 3 Model B
x Alexa Skill Kits / Amazon Developer Console
x Ngrok Service
x Electronics Components and Sensors
x Reverb Smartphone Application
x Telegram Smartphone Application

A. Raspberry Pi 3 Model B Figure 3. Architecture of Alexa Skill Kits.

C. Ngrok Service
Ngrok is an efficient tool for developers to test their
webworks, localhost and APIs. By creating a secure public
URL, it allows local hosts and machines to connect to the
internet, behind the firewalls [7]. In this project, Ngrok
generates a public URL and it is used by Amazon Developer
Console as a mean of communication with the Raspberry Pi.
The most significant advantage of using Ngrok is its swift
response speed. The average time taken for the voice
command to be processed in this smart home system is 1 to 2
Figure 2. Schematic Raspberry Pi 3 Model B front. seconds. Figure 4 shows the terminal of Ngrok displaying
the public URL while Figure 5 shows Amazon Developer
The Raspberry Pi is a credit card size microcomputer. It Console interface where the Ngrok URL is requested.
is the brain of the entire smart home system, capable of
processing programming codes and controlling a huge
number of devices via its GPIO pins. For specifications, the
Raspberry Pi processes at 1.2GHz with a Broadcom
BCM2837 64bit ARMv7 Quad Core Processor. It has 40
GPIO pins, 4 USB ports, a full size HDMI port, micro-SD
port, and is powered by a micro USB power source [4]. For
its wireless communication, the Raspberry Pi has both WiFi
and Bluetooth module on board. Once the Raspberry Pi is
Figure 4. Ngrok Terminal Showing the Public URL.
connected to a monitor, a mouse and a keyboard, it is ready


connected to the Raspberry Pi as a microphone. The
hardware prototype is shown in Figure 7 below.

Figure 5. Amazon Developer Console Service Endpoint Section.

D. Electronics Components and Sensor


In this project, an RGB Light Emitting Diode (LED) strip
and Radio Frequency (RF) controlled sockets are used as a
representation of a household electrical appliances control.
Whenever the user gives voice command such as “Alexa, tell Figure 7. Hardware Prototype of the Smart Home Sytem.
Pi to turn on my red lights”, the LED strip will turn red
within seconds. On the other hand, when the Raspberry Pi The implementation will be divided into 2 parts: Alexa
receives a command to switch off an electrical appliance, Voice Service and Raspberry Pi Controls. The results will be
such as a fan, a radio frequency pattern will be generated by shown later.
Raspberry Pi through a 433MHz RF transceiver to the RF
controlled socket and turn it off. As for security feature, a A. Alexa Voice Service Implementation
magnetic reed switch is installed on the door. Once the In the Amazon Developer Console, intents must be
security feature is activated by the user, e.g. “Alexa, tell Pi to created and defined before a voice command can be
secure my room”, the door will be in secured mode and the understood by Alexa. In this smart home system, three
user will be alerted through a push notification if the door intents are created, namely Control, Module and Detail.
opens. Custom slot types can be referenced by these intents
according to their functions. Figure 8 shows the custom slot
E. Reverb Smartphone Application types which are used in this smart home system.
Reverb allows users to access the Alexa Voice Service
from anywhere, and is useful when the nearest microphone
does not receive voice command clearly. By tapping the
microphone icon on Reverb, Alexa is ready to receive voice
commands.
F. Telegram Smartphone Application
Telegram allows user to control the smart home system Figure 8. Custom Slot Types and their Referenced Intents
by sending text commands directly to the Raspberry Pi. The
Bot API in Telegram is capable of providing text responses With the intents and custom slot types, sample utterances
which are defined in the scripts. Figure 6 shows the smart can be created to invoke the intents. For example, utterance
home control interface via Telegram. “GPIOControlIntent to {status} the {detail} {module}” will
invoke the specified intent if the user gives a voice command
like “Alexa, tell Pi to {on} the {blue} {lights}”. More
utterance samples can be created so that Alexa will have
better accuracy in understanding more voice commands of
different structures. Figure 9 shows the list of utterance
samples used in this smart home system.

Figure 6. Text Command and Responses via Telegram

IV. IMPLEMENTATION AND RESULTS


The proposed smart home system is implemented in a
mini-room created by a box and breadboard. A headset is Figure 9. List of Utterance Samples Used in this Project


B. Raspberry Pi Control Implementation V. CONCLUSION AND FUTURE WORKS
A main python script is written in Raspberry Pi to In the near future, smart home system will be essential to
execute the commands processed by Alexa Voice Service. everyone with the ever-improving Google Home and
This script is running all the time to capture any commands Amazon Echo. This paper presented the design and
sent. Individual features such as music videos control, LED implementation of a low-cost voice activated smart home
color control and security are written in separate Python system which can be integrated with many basic subsystems
codes and they are called in this main script using and tailored to personal needs. With the Alexa Skill Kits and
Subprocess method. Figure 10 shows part of the main Raspberry Pi, every appliance can be controlled from
Python script to execute the music videos control and anywhere without direct interaction with them. There is full
security features. The voice response of Alexa is written in of potential in developing the simple and user-friendly Alexa
the return statement line. Skill Kits and the Amazon Web Services. Future works can
be done on upgrading the smart home system to cater to a
larger number of users, e.g. smart classrooms and smart
schools. One can also consider developing a smart healthcare
system for the elderly to alert their next of kin should Alexa
receive no responses from the user for a long period of time,
or a requested help.
ACKNOWLEDGMENT
We wish to acknowledge the funding for this project
Figure 10. Main Python Script in Raspberry Pi from Nanyang Technological University under the
Undergraduate Research Experience on CAmpus (URECA)
programme.
C. Results
Once the main Python script is being executed and Ngrok REFERENCES
is online (connected to Amazon Developer Console), Alexa [1] Markets and markets, “Smart home market by product (lighting
is ready to work. The smart home system can be tested via control (timer, daylight sensor, occupancy sensor), security & access
the “Test” function in the console to ensure that the system is control, HVAC, entertainment, home healthcare and smart kitchen),
fully operational. Figure 11 shows the service request and software & service (behavioral, proactive), and geography – Global
Forecast to 2022, May 2016.
positive response from the test function.
[2] Amrutha S, Aravind S, Ansu Mathew, Swathy Sugathan, Rajasree R,
Upon testing, the smart home system functioned as Priyalakshmi S, “Voice controlled smart home,” ISSN 2250-2459,
expected and responded to commands within a few seconds. ISO 9001:2008 Certified Journal, vol. 5, Issue 1, January 2015.
The return statements delivered by Alexa were loud and [3] Sonali Sen, Shamik Chakrabarty, Raghav Toshniwal, Ankita
clear. Also, this smart home system worked perfectly on both Bhaumik d, “Design of an intelligence voice controlled home
Reverb and Telegram. automation system,” International Journal of Computer Applications
(0975 – 8887), vol. 121 – No.15, July 2015.
[4] Foundation, Raspberry Pi, Raspberry Pi 3 Model B specifications.
https://www.raspberrypi.org/products/raspberry-pi-3-model-b/
[5] PuTTY team, PuTTY: a free SSH and Telnet client. Accessed 21 Feb
2017.
http://www.chiark.greenend.org.uk/~sgtatham/putty/
[6] David Isbitski, “Enabling new voice expericences with Amazon
Alexa and AWS Lambda,” AWS Summit, April 2016.

Figure 11. Service Request and Response from Test Function



You might also like