Top Banner
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
Welcome message from author
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
Page 1: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 2: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 3: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 4: NEW Advanced low cost voice recognition based smart homeoffice

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

market segment- consumer electronics, office automation, industrial automation, biomedical

engineering, wireless communication, data communication, telecommunications, transportation,

military and so on.

4

Page 5: NEW Advanced low cost voice recognition based smart homeoffice

Consumer appliances :

At home we use a number of embedded systems which include digital camera, digital

diary, DVD player, electronic toys, microwave oven, remote controls for TV and air-conditioner,

VCO player, video game consoles, video recorders etc. Today’s high-tech car has about 20

embedded systems for transmission control, engine spark control, air-conditioning, navigation

etc. Even wristwatches are now becoming embedded systems. The palmtops are powerful

embedded systems using which we can carry out many general-purpose tasks such as playing

games and word processing.

Office automation:

The office automation products using embedded systems are copying machine, fax

machine, key telephone, modem, printer, scanner etc.

Industrial automation :

Today a lot of industries use embedded systems for process control. These include

pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and

transmission. The embedded systems for industrial use are designed to carry out specific tasks

such as monitoring the temperature, pressure, humidity, voltage, current etc., and then take

appropriate action based on the monitored levels to control other devices or to send information

to a centralized monitoring station. In hazardous industrial environment, where human presence

has to be avoided, robots are used, which are programmed to do specific jobs. The robots are

now becoming very powerful and carry out many interesting and complicated tasks such as

hardware assembly.

Medical electronics :

Almost every medical equipment in the hospital is an embedded system. These

equipments include diagnostic aids such as ECG, EEG, blood pressure measuring devices, X-ray

scanners; equipment used in blood analysis, radiation, colonoscopy, endoscopy etc.

Developments in medical electronics have paved way for more accurate diagnosis of diseases.

5

Page 6: NEW Advanced low cost voice recognition based smart homeoffice

Computer networking: Computer networking products such as bridges, routers, Integrated

Services Digital Networks (ISDN), Asynchronous Transfer Mode (ATM), X.25 and frame relay

switches are embedded systems which implement the necessary data communication protocols.

For example, a router interconnects two networks. The two networks may be running different

protocol stacks. The router’s function is to obtain the data packets from incoming pores, analyze

the packets and send them towards the destination after doing necessary protocol conversion.

Most networking equipments, other than the end systems (desktop computers) we use to access

the networks, are embedded systems.

Telecommunications :

In the field of telecommunications, the embedded systems can be categorized as

subscriber terminals and network equipment. The subscriber terminals such as key telephones,

ISDN phones, terminal adapters, web cameras are embedded systems. The network equipment

includes multiplexers, multiple access systems, Packet Assemblers Dissemblers (PADs),

sate11ite modems etc. IP phone, IP gateway, IP gatekeeper etc. are the latest embedded systems

that provide very low-cost voice communication over the Internet.

Wireless technologies :

Advances in mobile communications are paving way for many interesting applications

using embedded systems. The mobile phone is one of the marvels of the last decade of the 20’h

century. It is a very powerful embedded system that provides voice communication while we are

on the move. The Personal Digital Assistants and the palmtops can now be used to access

multimedia services over the Internet. Mobile communication infrastructure such as base station

controllers, mobile switching centers are also powerful embedded systems.

Insemination:

Testing and measurement are the fundamental requirements in all scientific and

engineering activities. The measuring equipment we use in laboratories to measure parameters

such as weight, temperature, pressure, humidity, voltage, current etc. are all embedded systems.

Test equipment such as oscilloscope, spectrum analyzer, logic analyzer, protocol analyzer, radio

communication test set etc. are embedded systems built around powerful processors. Thank to

miniaturization, the test and measuring equipment are now becoming portable facilitating easy

testing and measurement in the field by field-personnel.

6

Page 7: NEW Advanced low cost voice recognition based smart homeoffice

Security:

Security of persons and information has always been a major issue. We need to protect

our homes and offices; and also the information we transmit and store. Developing embedded

systems for security applications is one of the most lucrative businesses nowadays. Security

devices at homes, offices, airports etc. for authentication and verification are embedded systems.

Encryption devices are nearly 99 per cent of the processors that are manufactured end up in~

embedded systems. Embedded systems find applications in every industrial segment- consumer

electronics, transportation, avionics, biomedical engineering, manufacturing, process control and

industrial automation, data communication, telecommunication, defense, security etc. Used to

encrypt the data/voice being transmitted on communication links such as telephone lines.

Biometric systems using fingerprint and face recognition are now being extensively used for user

authentication in banking applications as well as for access control in high security buildings.

Finance :

Financial dealing through cash and cheques are now slowly paving way for transactions

using smart cards and ATM (Automatic Teller Machine, also expanded as Any Time Money)

machines. Smart card, of the size of a credit card, has a small micro-controller and memory; and

it interacts with the smart card reader! ATM machine and acts as an electronic wallet. Smart card

technology has the capability of ushering in a cashless society. Well, the list goes on. It is no

exaggeration to say that eyes wherever you go, you can see, or at least feel, the work of an

embedded system!

7

Page 8: NEW Advanced low cost voice recognition based smart homeoffice

CHAPTER: 3

HARDWARE IMPLEMENTATION OF THE PROJECT

This chapter briefly explains about the Hardware Implementation of the project. It

discusses the design and working of the design with the help of block diagram and circuit

diagram and explanation of circuit diagram in detail. It explains the features, timer programming,

serial communication, interrupts of AT89S52 microcontroller. It also explains the various

modules used in this project.

3.1. Project Design:

The implementation of the project design can be divided in two parts.

1. Hardware implementation

2. Firmware implementation.

Hardware implementation deals in drawing the schematic on the plane paper according to the

application, testing the schematic design over the breadboard using the various IC’s to find if the

design meets the objective, carrying out the PCB layout of the schematic tested on breadboard,

finally preparing the board and testing the designed hardware.

The firmware part deals in programming the microcontroller so that it can control the

operation of the IC’s used in the implementation.

INTRODUCTION TO MICROCONTROLLER:

Based on the Processor side Embedded Systems is mainly divided into 3 types

1. Micro Processor: - are for general purpose e.g. our personal computer

2. Micro Controller: - are for specific applications, because of cheaper cost we will go for these

3. DSP (Digital Signal Processor):- are for high and sensitive application purpose

MICROCONTROLLER VERSUS MICROPROCESSOR:

A system designer using a general-purpose microprocessor such as the Pentium or the 68040

must add RAM, ROM, I/O ports, and timers externally to make them functional. Although the

addition of external RAM, ROM, and I/O ports makes these systems bulkier and much more

8

Page 9: NEW Advanced low cost voice recognition based smart homeoffice

ADDRESS BUS

Many chips on mother’s board

I/O PORT TIMER SERIAL COM PORTROM

CPUGeneral purpose micro processor

RAM

Data bus

expensive, they have the advantage of versatility such that the designer can decide on the amount

of RAM, ROM and I/O ports needed to fit the task at hand.

A Microcontroller has a CPU (a microprocessor) in addition to a fixed amount of RAM,

ROM, I/O ports, and a timer all on a single chip. In other words, the processor, the RAM, ROM,

I/O ports and the timer are all embedded together on one chip; therefore, the designer cannot add

any external memory, I/O ports, or timer to it. The fixed amount of on-chip ROM, RAM, and

number of I/O ports in Microcontrollers makes them ideal for many applications in which cost

and space are critical.

General Micro Processor:

1. cpu for computers

2. No RAM, ROM, I/O on CPU chip itself

3. Example : Intel’s x86

Micro Controller:

9

Page 10: NEW Advanced low cost voice recognition based smart homeoffice

CPU

Serial COMPort

RAM

TimerI/O PORT

ROM

A sigle Chip

A smaller Computer

On chip RAM, ROM, I/O PORTS……..

Example: Intel 8052 etc….

Microprocessor vs. Microcontroller

Microprocessor Microcontroller

CPU is stand alone RAM, RAM, I/O,

timer are separate

CPU,RAM,ROM,I/O and timer are all on a

single chip

Designer can decide on the amount of

ROM, RAM and I/O ports.

Fix amount of on chip ROM,RAM, I/O

Ports.

Expansive, Versatility For applications in which cost, power and

space are critical

General purpose Single purpose

3.1.1 Block Diagram of the Project and its DescriptionThe block diagram of the

design is as shown in Fig 3.1. It consists of power supply unit, microcontroller, BLUETOOTH

modem, TRIAC, loads and LCD. The brief description of each unit is explained as follows.

BLOCK DIAGRAM:

10

Page 11: NEW Advanced low cost voice recognition based smart homeoffice

Bluetooth module

11

MICRO

CONTROLLER

RESET

CRYSTAL

OSCILLATOR

TRIAC

DRIVER

TRIAC

DRIVER

TRIAC

DRIVER

TRIAC

DRIVER

TRIAC

TRIAC

TRIAC

TRIAC

Page 12: NEW Advanced low cost voice recognition based smart homeoffice

Andriod based phone

3.2. Power Supply:

The input to the circuit is applied from the regulated power supply. The a.c. input i.e.,

230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier. The

output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c voltage,

the output voltage from the rectifier is fed to a filter to remove any a.c components present even

after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc

voltage.

Fig.2: Components of regulated power supply

3.2.1. Transformer:

The A.C. input available at the mains supply i.e., 230V is to be brought down to the

required voltage level. This is done by a transformer. Thus, a step down transformer is employed

to decrease the voltage to a required level.

12

Page 13: NEW Advanced low cost voice recognition based smart homeoffice

3.2.2. Rectifier:

The output from the transformer is fed to the rectifier. It converts A.C. into pulsating

D.C. In this project, a bridge rectifier is used because of its merits like good stability and full

wave rectification.

3.2.3. Filter:

Capacitive filter is used in this project. It removes the ripples from the output of rectifier

and smoothens the D.C. Output received from this filter is constant until the mains voltage and

load is maintained constant. However, if either of the two is varied, D.C. voltage received at this

point changes. Therefore a regulator is applied at the output stage.

3.2.4. Voltage regulator:

As the name itself implies, it regulates the input applied to it. A voltage regulator is an

electrical regulator designed to automatically maintain a constant voltage level. In this project,

power supply of 5V and 12V are required. In order to obtain these voltage levels, 7805 and 7812

voltage regulators are to be used. The first number 78 represents positive supply and the numbers

05, 12 represent the required output voltage levels.

3.3. Microcontrollers:

Microprocessors and microcontrollers are widely used in embedded systems products.

Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed

amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount

of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many

applications in which cost and space are critical.

It was popular in the 1980s and early 1990s, but today it has largely been superseded by

a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by

more than 20 independent manufacturers including Atmel, Infineon Technologies and Maxim

Integrated Products.

8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a

time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8051

is available in different memory types such as UV-EPROM, Flash and NV-RAM.

13

Page 14: NEW Advanced low cost voice recognition based smart homeoffice

3.3.1. Features of AT89S52:

8K Bytes of Re-programmable Flash Memory.

RAM is 256 bytes.

4.0V to 5.5V Operating Range.

Fully Static Operation: 0 Hz to 33 MHz’s

Three-level Program Memory Lock.

256 x 8-bit Internal RAM.

32 programmable I/O Lines.

Three 16-bit Timer/Counters.

Eight Interrupt Sources.

Full Duplex UART Serial Channel.

Low-power Idle and Power-down Modes.

Interrupt recovery from power down mode.

Watchdog timer.

Dual data pointer.

Power-off flag.

Fast programming time.

Flexible ISP programming (byte and page mode).

14

Page 15: NEW Advanced low cost voice recognition based smart homeoffice

3.3.2. Description:

The AT89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer with 8K

bytes of Flash programmable memory. The device is manufactured using Atmel’s high density

nonvolatile memory technology and is compatible with the industry-standard MCS-51

instruction set. The on chip flash allows the program memory to be reprogrammed in system or

by a conventional non volatile memory programmer. By combining a versatile 8-bit CPU with

Flash on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer, which provides a

highly flexible and cost-effective solution to many embedded control applications.

In addition, the AT89s52 is designed with static logic for operation down to zero

frequency and supports two software selectable power saving modes. The Idle Mode stops the

CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue

functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling

all other chip functions until the next hardware reset.

Fig.3: Pin diagram of 8051

15

Page 16: NEW Advanced low cost voice recognition based smart homeoffice

Fig.4: Block diagram of 8051

Pin description:

3.3.3. Vcc:

Pin 40 provides supply voltage to the chip. The voltage source is +5V.

3.3.4. GND:

Pin 20 is the ground.

16

Page 17: NEW Advanced low cost voice recognition based smart homeoffice

3.3.5. Port 0:

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink

eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance

inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during

accesses to external program and data memory. External pull-ups are required during program

verification.

3.3.6. Port 1:

Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers

can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the

internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled

low will source current (IIL) because of the internal pull-ups.

Table 1: Alternate functions of port 1

3.3.7. Port 2:

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers

can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the

internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled

low will source current (IIL) because of the internal pull-ups.

17

Page 18: NEW Advanced low cost voice recognition based smart homeoffice

3.3.8.Port 3:

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers

can sink/source four TTL inputs.

Table2: Alternate functions of port3

3.3.9. RST:

Reset input A high on this pin for two machine cycles while the oscillator is running

resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The

DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state

of bit DISRTO, the RESET HIGH out feature is enabled.

3.3.10.ALE/PROG:

Address Latch Enable (ALE) is an output pulse for latching the low byte of the address

during accesses to external memory. This pin is also the program pulse input (PROG) during

Flash programming.

3.3.11. PSEN:

Program Store Enable (PSEN) is the read strobe to external program memory. When the

AT89S52 is executing code from external program memory, PSEN is activated twice each

machine cycle, except that two PSEN activations are skipped during each access to external data

memory.

3.3.12. EA/VPP:

External Access Enable EA must be strapped to GND in order to enable the device to

fetch code from external program memory locations starting at 0000H up to FFFFH.

18

Page 19: NEW Advanced low cost voice recognition based smart homeoffice

3.3.13. XTAL1:

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

3.3.14. XTAL2:

Output from the inverting oscillator amplifier.

Fig.5: Oscillator connections

Fig.6: External clock drive configuration

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be

configured for use as an on-chip oscillator. Either a quartz crystal or ceramic resonator may be

used. To drive the device from an external clock source, XTAL2 should be left unconnected

while XTAL1 is driven.

3.3.15. Special Function Registers:

A map of the on-chip memory area called the Special Function Register (SFR). It should

be noted that not all of the addresses are occupied and unoccupied addresses may not be

implemented on the chip. User software should not write 1s to these unlisted locations, since

they may be used in future products to invoke new features.

19

Page 20: NEW Advanced low cost voice recognition based smart homeoffice

3.3.16. Timer 2 Registers:

Control and status bits are contained in registers T2CON and T2MOD for Timer 2. The

register pair (RCAP2H, RCAP2L) is the Capture/Reload register for Timer 2 in 16-bit capture

mode or 16-bit auto-reload mode.

3.3.17. Interrupt Registers:

The individual interrupt enable bits are in the IE register. Two priorities can be set for each of the

six interrupt sources in the IP register.

3.3.18. Dual Data Pointer Registers:

To facilitate accessing both internal and external data memory, two banks of 16-bit Data

Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DP1 at 84H and

85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. The user should

ALWAYS initialize the DPS bit to the appropriate value before accessing the respective Data

Pointer Register.

3.3.19. Power off Flag:

The Power off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is set to

“1” during power up. It can be set and rest under software control and is not affected by reset.

3.3.20. Memory Organization:

MCS-51 devices have a separate address space for Program and Data Memory. Up to

64K bytes each of external Program and Data Memory can be addressed.

3.3.21. Program Memory:

If the EA pin is connected to GND, all program fetches are directed to external memory.

On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through

1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to

external memory.

3.3.22. Data Memory:

20

Page 21: NEW Advanced low cost voice recognition based smart homeoffice

The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a

parallel address space to the Special Function Registers. This means that the upper 128 bytes

have the same addresses as the SFR space but are physically separate from SFR space.

3.3.23. Watchdog Timer (One-time Enabled with Reset-out):

The WDT is intended as a recovery method in situations where the CPU may be

subjected to software upsets. The WDT consists of a 14-bit counter and the Watchdog Timer

Reset (WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To enable the WDT,

a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H).

When the WDT is enabled, it will increment every machine cycle while the oscillator is

running.).

3.3.24. Timer 0:

Timer 0 functions as either a timer or event counter in four modes of operation. Timer 0

is controlled by the four lower bits of the TMOD register and bits 0, 1, 4 and 5 of the TCON

register. TMOD register selects the method of timer gating (GATE0), timer or counter operation

(T/C0#) and mode of operation (M10 and M00).

3.3.25. Mode 0 (13-bit Timer):

Mode 0 configures timer 0 as a 13-bit timer which is set up as an 8-bit timer (TH0

register) with a modulo-32 prescaler implemented with the lower five bits of the TL0 register.

The upper three bits of TL0 register are indeterminate and should be ignored. Prescaler overflow

increments the TH0 register.

3.3.26. Baud Rate Generator:

Timer 2 is selected as the baud rate generator by setting TCLK and/or RCLK in T2CON.

Note that the baud rates for transmit and receive can be different if Timer 2 is used for the

receiver or transmitter and Timer 1 is used for the other function. Setting RCLK and/or TCLK

puts Timer 2 into its baud rate generator mode.

3.3.27. Interrupts:

The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and

INT1), three timers interrupts (Timers 0, 1, and 2) and the serial port interrupt.

21

Page 22: NEW Advanced low cost voice recognition based smart homeoffice

3.4 Bluetooth Module

Bluetooth is a wireless technology standard for exchanging data over short distances (using

short-wavelength radio transmissions in the ISM band from 2400–2480 MHz) from fixed and

mobile devices, creating personal area networks (PANs) with high levels of security. Created by

telecom vendor Ericsson in 1994, it was originally conceived as a wireless alternative to RS-232

data cables. It can connect several devices, overcoming problems of synchronization.

This module enables you to wireless transmit & receive serial data. It is a drop in

replacement for wired serial connections allowing transparent two way data communication. You

can simply use it for serial port replacement to establish connection between MCU or embedded

project and PC for data transfer. We have another model 3685 available without backing pcb

which operates on 3V only. This board operates on 5V and has LED indication and 3V regulator

onboard.

Communication and connection:

A master Bluetooth device can communicate with a maximum of seven devices in a piconet (an

ad-hoc computer network using Bluetooth technology), though not all devices reach this

maximum. The devices can switch roles, by agreement, and the slave can become the master (for

example, a headset initiating a connection to a phone will necessarily begin as master, as initiator

of the connection; but may subsequently prefer to be slave).

The Bluetooth Core Specification provides for the connection of two or more piconets to form a

scatter net, in which certain devices simultaneously play the master role in one piconet and the

slave role in another.

At any given time, data can be transferred between the master and one other device (except for

the little-used broadcast mode. The master chooses which slave device to address typically, it

switches rapidly from one device to another in a round-robin fashion. Since it is the master that

chooses which slave to address, whereas a slave is (in theory) supposed to listen in each receive

22

Page 23: NEW Advanced low cost voice recognition based smart homeoffice

slot, being a master is a lighter burden than being a slave. Being a master of seven slaves is

possible being a slave of more than one master is difficult. The specification is vague as to

required behavior in scatter nets.

Many USB Bluetooth adapters or "dongles" are available, some of which also include an IrDA

adapter. Older (pre-2003) Bluetooth dongles, however, have limited capabilities, offering only

the Bluetooth Enumerator and a less-powerful Bluetooth Radio incarnation. Such devices can

link computers with Bluetooth with a distance of 100 meters, but they do not offer as many

services as modern adapters do.

Uses:

Bluetooth is a standard wire-replacement communications protocol primarily designed for low

power consumption, with a short range (power-class-dependent, but effective ranges vary in

practice; see table below) based on low-cost transceiver microchips in each device. Because the

devices use a radio (broadcast) communications system, they do not have to be in visual line of

sight of each other, however a quasi optical wireless path must be viable.

The effective range varies due to propagation conditions, material coverage, production sample

variations, antenna configurations and battery conditions. In most cases the effective range of

Class 2 devices is extended if they connect to a Class 1 transceiver, compared to a pure Class 2

network. This is accomplished by the higher sensitivity and transmission power of Class 1

devices

Bluetooth vs. Wi-Fi:

Bluetooth and Wi-Fi (the brand name for products using IEEE 802.11 standards) have some

similar applications setting up networks, printing, or transferring files. Wi-Fi is intended as a

replacement for cabling for general local area network access in work areas. This category of

applications is sometimes called wireless local area networks (WLAN). Bluetooth was intended

for portable equipment and its applications. The category of applications is outlined as the

wireless personal area network (WPAN). Bluetooth is a replacement for cabling in a variety of

23

Page 24: NEW Advanced low cost voice recognition based smart homeoffice

personally carried applications in any setting and also works for fixed location applications such

as smart energy functionality in the home (thermostats, etc.).

Wi-Fi is a wireless version of a common wired Ethernet network, and requires configuration to

set up shared resources, transmit files, and to set up audio links (for example, headsets and

hands-free devices). Wi-Fi uses the same radio frequencies as Bluetooth, but with higher power,

resulting in higher bit rates and better range from the base station. The nearest equivalents in

Bluetooth are the DUN profile, which allows devices to act as modem interfaces, and the PAN

profile, which allows for ad-hoc networking.

Device:

Bluetooth exists in many products, such as telephones, tablets, media players, Lego Mind storms

NXT, PlayStation 3, PS Vita, the Nintendo Wii, and some high definition headsets, modems, and

watches. The technology is useful when transferring information between two or more devices

that are near each other in low-bandwidth situations. Bluetooth is commonly used to transfer

sound data with telephones (i.e., with a Bluetooth headset) or byte data with hand-held

computers (transferring files).

Bluetooth protocols simplify the discovery and setup of services between devices. Bluetooth

devices can advertise all of the services they provide. This makes using services easier because

more of the security, network address and permission configuration can be automated than with

many other network types.

Features:

1. 5V power operation

2. UART interface

3. 10 meters range

24

Page 25: NEW Advanced low cost voice recognition based smart homeoffice

4. Easy to use

5. Minimum External Components

6. Status LED

Applications:

1. Wireless Telemetry

2. Remote Data Logging

3. Robotics

4. Sensor Monitoring

5. Remote Programming

Product Specifications:

Bluetooth protocol v2.0

1. Range 10 meters

2. Frequency: 2.4 GHz ISM

3. Modulation: GFSK

4. Transmit power: 4dBm

5. Sensitivity: 84dBm

6. Rate: 2.1Mbps (Max) /160kbps (Async); 1Mbps(Sync)

7. Authentication & Encryption

8. Power Supply: +5 VDC 50mA

9. Operating Temperate: -20C to +55 C

10. Dimensions: 26.9 mm x 13 mm x 2.2 mm

25

Page 26: NEW Advanced low cost voice recognition based smart homeoffice

PC Data Transfer Mode:

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

Page 27: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 28: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 29: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 30: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 31: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 32: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 33: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 34: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 35: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 36: NEW Advanced low cost voice recognition based smart homeoffice

36

Page 37: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 38: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 39: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 40: NEW Advanced low cost voice recognition based smart homeoffice

Fig.18:Preload the cycle to load the program

CHAPTER 5

CIRCUIT DIAGRAM

5.1. SCHEMATIC DIAGRAM:

40

Page 41: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 42: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 43: NEW Advanced low cost voice recognition based smart homeoffice

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

Page 44: NEW Advanced low cost voice recognition based smart homeoffice

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

Janice Gillispie Mazidi

44

Page 45: NEW Advanced low cost voice recognition based smart homeoffice

The 8051 Micro controller Architecture, Programming & Applications - Kenneth J.Ayala

Fundamentals Of Micro processors and Micro computers - B.Ram

Micro processor Architecture, Programming & Applications - Ramesh S.Gaonkar

Electronic Components - D.V.Prasad

Wireless Communications- Theodore S. Rappaport

Mobile Tele Communications - William C.Y. Lee

References on the Web:

www.national.com

www.atmel.com

www.microsoftsearch.com

www.geocities.com

45