Advanced low cost voice recognition based smart home/office automation using android ABSTRACT Now a day’s so many useful technologies are coming out to make our life style more comfort, luxurious and secure. Especially in mobile field so many application are being developed to give us more information and entertainment .this project is designed with combination of two latest and most demanding technologies that are Android and Embedded Systems. Android is a Linux based operating system designed primarily for mobile devices and it is a open source .There are so many applications are already developed on Android and many applications are being developed at free of cost for its users. We can also develop our own customized applications with free of cost or with minimum cost according to our requirements. In this project we are using an application to control electrical appliances like fan, lights and water pump motors in home or office with voice recognition. Whenever we operate this application, it will wait for voice input for some time and sends recognized voice commands to our controlling system through Bluetooth. At controlling system side we have Bluetooth module, micro controller and load controlling circuits. Whenever this blue tooth module receives command from android application then it 1
61
Embed
NEW Advanced low cost voice recognition based smart homeoffice
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Advanced low cost voice recognition based smart home/office automation using android
ABSTRACT
Now a day’s so many useful technologies are coming out to make our life style more comfort,
luxurious and secure. Especially in mobile field so many application are being developed to give
us more information and entertainment .this project is designed with combination of two latest
and most demanding technologies that are Android and Embedded Systems.
Android is a Linux based operating system designed primarily for mobile devices and it is a open
source .There are so many applications are already developed on Android and many applications
are being developed at free of cost for its users. We can also develop our own customized
applications with free of cost or with minimum cost according to our requirements.
In this project we are using an application to control electrical appliances like fan, lights and
water pump motors in home or office with voice recognition. Whenever we operate this
application, it will wait for voice input for some time and sends recognized voice commands to
our controlling system through Bluetooth.
At controlling system side we have Bluetooth module, micro controller and load controlling
circuits. Whenever this blue tooth module receives command from android application then it
transfers this command to micro controller. Micro controller will control the respective loads
depends upon the command it received. This is very safe and secure and also we can control
many loads without getting confused by adding specific names for each load.
1
CHAPTER: 1
INTRODUCTION
1.1 INTRODUCTION
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
opportunity in creating new fields in engineering, architecture. The capabilities of Bluetooth are
more than enough to be implemented in the design. Also, most of the current laptop/notebook or
cell phones are come with built-in Bluetooth adapter. It will indirectly reduce the cost of this
system. Due to the advancement of wireless technology, there are several different of
connections are introduced such as GSM, WIFI, ZIGBEE, and Bluetooth.
Each of the connection has their own unique specifications and applications. Among the
four popular wireless connections that often implemented in HAS project, Bluetooth is being
chosen with its suitable capability. Bluetooth with globally available frequencies of 2400Hz is
able to provide connectivity up to 100 meters at speed of up to 3Mbps depending on the
Bluetooth device
This application will be used to control the AC loads according to your command give
from the android app. Especially in mobile field so many application are being developed to give
us more information and entertainment. This project is designed with combination of two latest
and most demanding technologies that are Android and Embedded Systems. To do this we are
using this Android App, which is open source and easy to install Bluetooth SPP software and
Bluetooth module at receiver side to receive the data.
Android is a Linux based operating system designed primarily for mobile devices and it
is a open source .There are so many applications are already developed on Android and many
applications are being developed at free of cost for its users .
2
1.2 PROBLEM OUTLINE
In the earlier days the loads are controlled by using switches by going to the near of switch
boards. As technology increases there were wireless technologies developed like IR, RF, and
ZIGBEE etc. But these all technologies need a separate remote like transmitter object to operate
the loads.
1.3 OBJECTIVE OF THE PROJECT
The most advanced technology is Bluetooth. And the technology based on Android OS. By
using this technology, we just need and android mobile and there is no separate remote. By using
the mobile itself you can send voice commands to the Bluetooth module. 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 .
1.4 SCOPE OF STUDY:
The scope of study which is needed for the completion of this project involves the following criteria:
1. Architecture of 8051 knowledge
2. 8051 programming in C language.
3. The study of the serial communication.
4. Interfacing loads with microcontroller.
5. The circuitry and devices that is needed to construct the devices and establish the necessary communication between the devices.
6. Interfacing Bluetooth with microcontroller
3
CHAPTER: 2
INTRODUCTION TO EMBEDDED SYSTEMS
An embedded system can be defined as a computing device that does a specific focused
job. Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine,
mobile phone etc. are examples of embedded systems. Each of these appliances will have a
processor and special hardware to meet the specific requirement of the application along with the
embedded software that is executed by the processor for meeting that specific requirement. The
embedded software is also called “firm ware”. The desktop/laptop computer is a general purpose
computer. You can use it for a variety of applications such as playing games, word processing,
accounting, software development and so on. In contrast, the software in the embedded systems
is always fixed listed below:
Embedded systems do a very specific task, they cannot be programmed to do different things.
Embedded systems have very limited resources, particularly the memory. Generally, they do not
have secondary storage devices such as the CDROM or the floppy disk. Embedded systems have
to work against some deadlines. A specific job has to be completed within a specific time. In
some embedded systems, called real-time systems, the deadlines are stringent. Missing a
deadline may cause a catastrophe-loss of life or damage to property. Embedded systems are
constrained for power. As many embedded systems operate through a battery, the power
consumption has to be very low.
Some embedded systems have to operate in extreme environmental conditions such as very high
temperatures and humidity.
Application Areas:
Nearly 99 per cent of the processors manufactured end up in embedded systems. The
embedded system market is one of the highest growth areas as these systems are used in very
We supply module with 9600 baud rate in ready to use with PC. You will need a USB Bluetooth
Adapter at PC side or Bluetooth Enabled Laptop to connect to our Bluetooth module.
Module supplied by us with this setting: 9600 baud rate, Pair Code: 1234
Note: There are many low cost USB Bluetooth dongle adapters for PC available with mobile
spares suppliers. You can use any of them with PC to establish Bluetooth connection.
3.5 TRIAC BT136:
General Description
26
Glass passivated, sensitive gate triacs in a plastic envelope, intended for use in general purpose
bidirectional switching and phase control applications, where high voltages sensitivity is required
in all four quadrants.
27
3.9 TRIAC DRIVER MOC3021:
The MOC301XM and MOC302XM series are optically isolated triac driver devices. These
devices consist of gallium arsenide infrared emitting diodes, optically coupled to silicon bilateral
switch and are designed for applications requiring isolated triac triggering, low–current isolated
ac switching, high electrical isolation (to 7500 VAC peak), high detector standoff voltage, small
size, and low cost. This series is designed for interfacing between electronic controls and power
triacs to control resistive and inductive loads for 115/240V AC operations.
Features:
Low input current required (typically 5mA).
High isolation voltage-minimum 7500 VAC peak
Applications:
TRIAC driver
28
Industrial controls
Traffic lights
Vending machines
Motor control
Solid state relay
Solenoid/valve controls
Static AC power switch
Incandescent lamp dimmers
Lamp ballasts
3.6. Liquid Crystal Display:
LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs (seven
segment LEDs or other multi segment LEDs) because of the following reasons
The declining prices of LCDs.
The ability to display numbers, characters and graphics. This is in contrast to LEDs,
which are limited to numbers and a few characters.
Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the
task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep
displaying the data.
Fig.7: Front part of LCD
29
3.6.1. Pins Functions:
There are pins along one side of the small printed board used for connection to the
microcontroller. There are total of 14 pins marked with numbers (16 in case the background light
is built in). Their function is described in the table:
Table3:Pin functioning of LCD
30
Function Pin Number Name Logic State DescriptionGround 1 Vss - 0VPower supply 2 Vdd - +5VContrast 3 Vee - 0 – Vdd
4 RS0 D0 – D7 are interpreted as commands1 D0 – D7 are interpreted as data
4 RS0 D0 – D7 are interpreted as commands1 D0 – D7 are interpreted as data
5 R/W0 Write data (from controller to LCD)1 Read data (from LCD to controller)
6 E
0 Access to LCD disabled1 Normal operating
From 1 to 0 Data/commands are transferred to LCD 7 D0 0/1 Bit 0 LSB8 D1 0/1 Bit 19 D2 0/1 Bit 210 D3 0/1 Bit 311 D4 0/1 Bit 412 D5 0/1 Bit 513 D6 0/1 Bit 6
Control of operating
Control of operating
Data / commands
31
3.6.2.LCD screen:
LCD screen consists of two lines with 16 characters each. Each character consists of 5x7
dot matrix.
Fig.8: LCD screen
3.6.3.LCD Basic Commands:
The below basic commands clearly declare their functioning:
I/D 1 = Increment (by 1) R/L 1 = Shift right
0 = Decrement (by 1) 0 = Shift left
S 1 = Display shift on DL 1 = 8-bit interface
0 = Display shift off 0 = 4-bit interface
D 1 = Display on N 1 = Display in two lines
0 = Display off 0 = Display in one line
U 1 = Cursor on F 1 = Character format 5x10 dots
0 = Cursor off 0 = Character format 5x7 dots
B 1 = Cursor blink on D/C 1 = Display shift
0 = Cursor blink off 0 = Cursor shift
32
3.6.4. LCD Connection:
Depending on how many lines are used for connection to the microcontroller, there are 8-
bit and 4-bit LCD modes. The appropriate mode is determined at the beginning of the process in
a phase called “initialization”. In the first case, the data are transferred through outputs D0-D7 as
it has been already explained. In case of 4-bit LED mode, for the sake of saving valuable I/O
pins of the microcontroller, there are only 4 higher bits (D4-D7) used for communication, while
other may be left unconnected.
Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that
normally would be sent through lines D4-D7), four lower bits are sent afterwards. With the help
of initialization, LCD will correctly connect and interpret each data received. Besides, with
regards to the fact that data are rarely read from LCD (data mainly are transferred from
microcontroller to LCD) one more I/O pin may be saved by simple connecting R/W pin to the
Ground. Such saving has its price.
3.6.5.LCD Initialization:
Once the power supply is turned on, LCD is automatically cleared. This process lasts for
approximately 15mS. After that, display is ready to operate. The mode of operating is set by
default. This means that:
1. Display is cleared
2. Mode
DL = 1 Communication through 8-bit interface
N = 0 Messages are displayed in one line
F = 0 Character font 5 x 8 dots
3. Display/Cursor on/off
D = 0 Display off
U = 0 Cursor off
B = 0 Cursor blink off
4. Character entry
ID = 1 Addresses on display are automatically incremented by 1
S = 0 Display shift off
33
Fig.9: Procedure on 8 bit initialization
3.6.6. Contrast control:
To have a clear view of the characters on the LCD, contrast should be adjusted. To adjust
the contrast, the voltage should be varied. For this, a preset is used which can behave like a
variable voltage device
Fig.10:Reset
34
3.6.7.Potentiometer:
Variable resistors used as potentiometers have all three terminals connected. This
arrangement is normally used to vary voltage.
Fig.11: Potentiometer symbol
3.6.8.Presets:
These are miniature versions of the standard variable resistor. They are designed to be
mounted directly onto the circuit board and adjusted only when the circuit is built.
Fig.12: LCD interface with the microcontroller (4-bit mode)
35
36
CHAPTER: 4
FIRMWARE IMPLEMENTATION OF THE PROJECT DESIGN
This chapter briefly explains about the firmware implementation of the project.
4.1. Software Tools Required:
Keil µv3, Proload are the two software tools used to program microcontroller. The working of each software tool is explained below in detail.
4.1.1. Programming Microcontroller:
A compiler for a high level language helps to reduce production time. To program the AT89S52 microcontroller the Keil µv3 is used
4.1.2. Keil Compiler:
Keil compiler is software used where the machine language code is written and compiled. After compilation, the machine source code is converted into hex code which is to be dumped into the microcontroller for further processing. Keil compiler also supports C language code.
Fig.15: Compilation of source code
37
Fig.16: Run the compiled program
4.1.3. Proload:
Proload is software which accepts only hex files. Once the machine code is converted into hex code, that hex code has to be dumped into the microcontroller and this is done by the Proload. The board itself but in order to switch on that power supply, a source is required.
Fig.17: Atmel 8051 Device Programmer
38
4.1.4. Features:
Supports major Atmel 89 series devices
Auto Identify connected hardware and devices
Error checking and verification in-built
Lock of programs in chip supported to prevent program copying
20 and 40 pin ZIF socket on-board
4.1.5. Description:
It is simple to use and low cost, yet powerful flash microcontroller programmer for the Atmel 89
series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and Blank Check.
All fuse and lock bits are programmable. This programmer has intelligent onboard firmware and
connects to the serial port. All devices also have a number of lock bits to provide various levels
of software and programming protection. These lock bits are fully programmable using this
programmer. Lock bits are useful to protect the program to be read back from microcontroller
only allowing erase to reprogram the microcontroller. The programmer connects to a host
computer using a standard RS232 serial port. All the programming 'intelligence' is built into the
programmer so you do not need any special hardware to run it. Programmer comes with window
based software for easy programming of the devices.
39
Fig.18:Preload the cycle to load the program
CHAPTER 5
CIRCUIT DIAGRAM
5.1. SCHEMATIC DIAGRAM:
40
5.2. WORKING PROCEDURE:
The main aim of the project is to control the loads from the android phone using
through Bluetooth communication link. Android is a Linux based operating system designed
primarily for mobile devices and it is a open source.
41
To operate this project, first of all we should download an application from
google play store called “Bluetooth Spp”. After that switch on the Bluetooth in the android
mobile and the Bluetooth module in hardware kit. Then pair each other and send the commands
from the android mobile by sending the voice commands from the android mobile, the data was
transmitted through Bluetooth and received by the Bluetooth module at kit and further it sends
this command to 8051. According to the command received by itself, the microprocessor
controls the particular load by using TRIAC circuitry.
The code was written in C language using KIEL compiler and the relevant hex
file was dumped into the microcontroller using proload software.
CHAPTER 6
RESULTS AND DISCUSSIONS
6.1 Results
42
Assemble the circuit on the PCB as shown in above circuit diagram. After assembling the circuit
on the PCB, check it for proper connections before switching on the power supply.
With the help of this project we had implemented advanced low cost voice recognition based
smart home/office automation using android mobile. We controlled the ac loads by using voice
commands.
The communication is properly done without any interference between different modules in the
design. Design is done to meet all the specifications and requirements. Software tools like Keil
Uvision Simulator, Proload to dump the source code into the microcontroller, Orcad Lite for the
schematic diagram have been used to develop the software code before realizing the hardware.
Circuit is implemented in Orcad and implemented on the microcontroller board. The
performance has been verified both in software simulator and hardware design. The total circuit
is completely verified functionally and is following the application software.
It can be concluded that the design implemented in the present work provide portability,
flexibility and the data transmission is also done with low power consumption.
6.2 CONCLUSION
In conclusion, this low cost system is designed to improve the standard living in home. The
remote control function by smart phone provides help and assistance especially to disabled and
elderly. In order to provide safety protection to the user, a low voltage activating switches is
replaced current electrical switches. Moreover, implementation of wireless Bluetooth connection
in control board allows the system install in more simple way. The control board is directly
installed beside the electrical switches whereby the switching connection is controlled by
TRAIC.
6.3. Advantages
1. Easy to operate loads by voice commands
2. Easy to install
43
3. It makes connecting to different devices convenient
4. It is wireless
5. It is free to use if the device is installed with it
5. It is cheap
6.4. Disadvantages
1. If installed on a cell phone it is prone to receiving cell phone viruses
2. It can only connect two devices at once
6.5. Applications:
1. Office automation
2. Home automation
3. Machines controlling system in industry
4. Door access control system
BIBLIOGRAPHY
The 8051 Micro controller and Embedded Systems - Muhammad Ali Mazidi