Voice.docx

  • Uploaded by: Samsul Hutha
  • 0
  • 0
  • July 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Voice.docx as PDF for free.

More details

  • Words: 8,392
  • Pages: 51
1

ABSTRACT

“The technology today, is outpacing humanity”. Today, the only aim of technology seems to be- to reduce the human effort to the minimum. We have many electronic devices that reduce the mechanical work of humans. Humans, to be precise, the “gifted humans” are fortunate enough to carry out their daily chores. But what about the physically disabled? Here is our small effort to make the ‘ungifted’ humans ‘gifted’, the “VOICE OPERATED ROBOT”. Never the less, it is as beneficial to the gifted humans as it is to the physically disabled.

The voice operated robot is designed using APR9600. The robot’s architecture consists of two main parts- the electronics architecture and the software architecture. The APR9600 is a voice recording integrated circuit of non-volatile storage, and playback capability (for 40 to 60 seconds) that can store 8 voice commands. The integrated circuit can be used in visitor guiding mode or patient guiding mode to play the voices stored. The commands that we give verbally is internally interpreted by the robot into low level machine commands which could be understood by a microcontroller and the corresponding action is performed. The robot can perform many functions depending on the inputs given to it in the form of voice commands. The natural language of humans is recorded and converted into simple commands for its execution.

The voice operated robot proves to be a valuable device to reduce human effort and also, more importantly, to reduce the gap between the gifted and the ungifted. Those who are physically handicapped can get their work done very easily through simple voice commands. It can also be used in military applications where the risk of human loss is more. It can equally be used in the industrial applications with much efficiency and more life time.

2

TABLE OF CONTENT CHAPTER

PAGE NUMBER

1. Introduction 1.1 Embedded Systems 1.1.1 What is an Embedded System?

10 10 10

1.2 Applications in the field of Embedded Systems

11

1.3 Micro- controller

12

2. Hardware components

14

2.1 Micro- controller AT 89S52

14

2.1.1

Basic information

14

2.1.2

Description

14

2.1.3

Features

15

2.1.4

Pin description

16

2.1.5

Architecture

17

2.1.6

Applications

19

2.2 Power supply circuit

19

2.2.1

Bridge rectifier

19

2.2.2

LED

20

2.2.3

Voltage regulator

20 20

2.2.3.2 Pin description

21

2.2.4

2.2.3.1 Pin diagram

Filter

2.3 Blue tooth module

21 21

2.3.1 HC- 05 serial blue tooth module

21

2.3.2 Hardware features

22

2.3.3 Software features

22

2.4 Motor driver IC

24

2.4.1 Motor driver IC L293D

24

2.4.2 Pin description

25

2.5 Liquid Crystal Display

26

3

2.5.1 LCD (16 BY 2)

26

2.5.2 Pin description

27

2.5.3 16x2 LCD module commands

28

2.5.5 LCD initialization

30

2.6 AMR voice recorder application 2.6.1 AMR voice 2.6.1.1 Introduction 2.7 Robot kit

30 30 30 32

3. Software components

33

3.1 Keil’s software

33

3.1.1 Introduction

33

3.1.2 Features

33

3.1.3 Introduction of Keil

34

3.1.4 Development tools

34

4. Implementation

35

4.1 Block diagram

35

4.2 Working

36

4.2.1 Android meets robots

36

4.2.2 Interfacing LCD to 8051

37

4.2.2.1 Sending data to the LCD

37

4.2.2.2 Circuit diagram

38

4.2.3 Interfacing motor driver to 8051 4.2.3.1 Circuit diagram 4.2.4 Interfacing blue tooth module with 8051 (HC05)

39 40 40

4

4.2.4.1 Schematic design

41

5. Result analysis

42

5.1 Advantages

42

5.2 Disadvantage

43

5.3 Applications

43

5.4 Future scope

44

5.5 Conclusion

44

References

45

Appendices

46

Source code

46

5

LIST OF FIGURES FIGURE NUMBER

FIGURE NAME

PAGE NUMBER

1

Embedded system

10

2

Applications of E S

11

3

Pin diagram of 8051

15

4

Architecture of 8051

17

5

Power supply circuit

19

6

Voltage regulator

20

7

Blue tooth module

21

8

Blue tooth module IC

22

9

Motor driver IC

24

10

L293D pin diagram

25

11

LCD

26

12

Pin diagram of LCD

27

13

AMR voice application

30

14

Robot kit

32

15

Keil microvision 3

33

software 16

Block diagram

35

17

Voice operated robot

35

18

Connecting the robot

36

19

Interfacing LCD to 8051

38

20

Interfacing motor

39

controller to 8051 21

Circuit diagram showing

40

motor interfacing 22

Interfacing blue tooth module to 8051

41

6

CHAPTER 1 INTRODUCTION 1.1 EMBEDDED SYSTEMS 1.1.1

WHAT IS AN EMBEDDED SYSTEM?

Figure 1 Embedded system

An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. Embedded systems control many devices in common use today. Examples of properties typical of embedded computers when compared with general-purpose ones are low power consumption, small size, rugged operating ranges, and low per-unit cost. This comes at the price of limited processing resources, which make them significantly more difficult to program and to interface with. However, by building intelligence mechanisms on the top of the hardware, taking advantage of possible existing sensors and the existence of a network of embedded units, one can both optimally manage available resources at the unit and network levels as well as provide augmented functionalities, well beyond those available. For example, intelligent techniques can be designed to manage power consumption of embedded systems. Modern embedded systems are often based on microcontrollers (i.e. CPUs with integrated memory or peripheral interfaces) but ordinary microprocessors (using external chips for memory and peripheral interface circuits) are also still common, especially in more complex systems. In either case, the processor(s) used may be types ranging from general purpose to those specialized in certain class of computations, or even custom designed for the application

7

at hand. A common standard class of dedicated processors is the digital signal processor (DSP). Since the embedded system is dedicated to specific tasks, design engineers can optimize it to reduce the size and cost of the product and increase the reliability and performance. Some embedded systems are mass-produced, benefiting from economies of scale. Embedded systems range from portable devices such as digital watches and MP3 players, to large stationary installations like traffic lights, factory controllers, and largely complex systems like hybrid vehicles, MRI, and avionics. Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or enclosure. 1.2 APPLICATIONS IN THE FIELD OF EMBEDDED SYSTEMS

Figure 2 Applications of E S

8

1.3 MICRO- CONTROLLER A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of Ferroelectric RAM, NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications. Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys and other embedded systems. By reducing the size and cost compared to a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices and processes. Mixed signal microcontrollers are common, integrating analog components needed to control non-digital electronic systems. Some microcontrollers may use four-bit words and operate at clock rate frequencies as low as 4 kHz, for low power consumption (single-digit milli watts or micro watts). They will generally have the ability to retain functionality while waiting for an event such as a button press or other interrupt; power consumption while sleeping (CPU clock and most peripherals off) may be just nano watts, making many of them well suited for long lasting battery applications. Other microcontrollers may serve performance-critical roles, where they may need to act more like a digital signal processor (DSP), with higher clock speeds and power consumption. Microcontrollers usually contain from several to dozens of general purpose input/output pins (GPIO). GPIO pins are software configurable to either an input or an output state. When GPIO pins are configured to an input state, they are often used to read sensors or external signals. Configured to the output state, GPIO pins can drive external devices such as LEDs or motors, often indirectly, through external power electronics. Many embedded systems need to read sensors that produce analog signals. This is the purpose of the analog-to-digital converter (ADC). Since processors are built to interpret and process digital data, i.e. 1s and 0s, they are not able to do anything with the analog signals that may be sent to it by a device. So the analog to digital converter is used to convert the incoming data into a form that the processor can recognize. A less common feature on some microcontrollers is a digital-to-analog converter (DAC) that allows the processor to output analog signals or voltage levels.

9

In addition to the converters, many embedded microprocessors include a variety of timers as well. One of the most common types of timers is the Programmable Interval Timer(PIT). A PIT may either count down from some value to zero, or up to the capacity of the count register, overflowing to zero. Once it reaches zero, it sends an interrupt to the processor indicating that it has finished counting. This is useful for devices such as thermostats, which periodically test the temperature around them to see if they need to turn the air conditioner on, the heater on, etc. A dedicated Pulse Width Modulation (PWM) block makes it possible for the CPU to control power converters, resistive loads, motors, etc., without using lots of CPU resources in tight timer loops. Universal Asynchronous Receiver/Transmitter (UART) block makes it possible to receive and transmit data over a serial line with very little load on the CPU. Dedicated on-chip hardware also often includes capabilities to communicate with other devices (chips) in digital formats such as Inter-Integrated Circuit (I²C), Serial Peripheral Interface (SPI), Universal Serial Bus (USB), and Ethernet.

10

CHAPTER-2 HARDWARE COMPONENTS 2.1 MICRO-CONTROLLER AT89S52 2.1.1 BASIC INFORMATION CPU Speed: 24MHz Controller Family/Series: AT89S52 Embedded Interface Type: SPI, UART MCU Case Style: DIP MSL: No. of I/O's: 32 No. of Pins: 40 Packaging: Each Program Memory Size: 8KB RAM Memory Size: 256Byte SVHC: No SVHC (15-Jun-2015) Supply Voltage Max: 5.5V Supply Voltage Min: 4V

2.1.2 DESCRIPTION The AT89S52-24PU is a low-power, high-performance CMOS 8-bit Microcontroller, uses Atmel's high-density non-volatile memory technology and is compatible with the industrystandard 80C51 instruction set and pin-out. 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 in-system programmable flash on a monolithic chip, the Atmel AT89S52-24PU is a powerful microcontroller which provides a highly-flexible. It provides the following standard features 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the microcontroller is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes.

11

2.1.3 FEATURES Compatible with MCS®-51 Products 8kb of In-system Programmable (ISP) Flash Memory, 10,000 Write/Erase Cycles Endurance 0Hz to 33MHz Fully Static Operation 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)

Figure 3 Pin diagram of 8051

12

2.1.4 PIN DESCRIPTION

ALE/PROG: Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. ALE is emitted at a constant rate of 1/6 of the oscillator frequency, for external timing or clocking purposes, even when there are no accesses to external memory. (However, one ALE pulse is skipped during each access to external Data Memory.) This pin is also the program pulse input (PROG) during EPROM programming.

PSEN: Program Store Enable is the read strobe to external Program Memory. When the device is executing out of external Program Memory, PSEN is activated twice each machine cycle (except that two PSEN activations are skipped during accesses to external Data Memory). PSEN is not activated when the device is executing out of internal Program Memory.

EA/VPP: When EA is held high the CPU executes out of internal Program Memory (unless the Program Counter exceeds 0FFFH in the 80C51). Holding EA low forces the CPU to execute out of external memory regardless of the Program Counter value. In the 80C31, EA must be externally wired low. In the EPROM devices, this pin also receives the programming supply voltage (VPP) during EPROM programming.

XTAL1: Input to the inverting oscillator amplifier. XTAL2: Output from the inverting oscillator amplifier.

Port 0: Port 0 is an 8-bit open drain bidirectional port. As an open drain output port, it can sink eight LS TTL loads. Port 0 pins that have 1s written to them float, and in that state will function as high impedance inputs. Port 0 is also the multiplexed low-order address and data bus during accesses to external memory. In this application it uses strong internal pullups when emitting 1s. Port 0 emits code bytes during program verification. In this application, external pull-ups are required.

Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pullups. Port 1 pins that have 1s written to them are pulled high by the internal pullups, and in that state can be used as inputs. As inputs, port 1 pins that are externally being pulled low will source current because of the internal pull-ups .

13

Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pullups. Port 2 emits the highorder address byte during accesses to external memory that use 16-bit addresses. In this application, it uses the strong internal pull-ups when emitting 1s.

Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pullups. It also serves the functions of various special features of the 80C51 Family as follows: Port Pin Alternate Function P3.0 RxD (serial input port) P3.1 TxD (serial output port) P3.2 INT0 (external interrupt 0) P3.3 INT1 (external interrupt 1) P3.4 T0 (timer 0 external input) P3.5 T1 (timer 1 external input) P3.6 WR (external data memory write strobe) P3.7 RD (external data memory read strobe)

VCC: Supply voltage

2.1.5 ARCHITECTURE

Figure 4 Architecture of 8051

14

Data and Program Memory: The 8051 Microcontroller can be programmed in PL/M, 8051 Assembly, C and a number of other high-level languages. Many compilers even have support for compiling C++ for an 8051. Program memory in the 8051 is read-only, while the data memory is considered to be read/write accessible. When stored on EEPROM or Flash, the program memory can be rewritten when the microcontroller is in the special programmer circuit. Program Start Address: The 8051 starts executing program instructions from address 0000 in the program memory. The A register is located in the SFR memory location 0xE0. The A register works in a similar fashion to the AX register of x86 processors. The A register is called the accumulator, and by default it receives the result of all arithmetic operations. Special Function Register: The Special Function Register (SFR) is the upper area of addressable memory, from address 0x80 to 0xFF. A, B, PSW, DPTR are called SFR. This area of memory cannot be used for data or program storage, but is instead a series of memory-mapped ports and registers. All port input and output can therefore be performed by memory mov operations on specified addresses in the SFR. Also, different status registers are mapped into the SFR, for use in checking the status of the 8051, and changing some operational parameters of the 8051. General Purpose Registers: The 8051 has 4 selectable banks of 8 addressable 8-bit registers, R0 to R7. This means that there are essentially 32 available general purpose registers, although only 8 (one bank) can be directly accessed at a time. To access the other banks, we need to change the current bank number in the flag register.

15

A and B Registers: The A register is located in the SFR memory location 0xE0. The A register works in a similar fashion to the AX register of x86 processors. The A register is called the accumulator, and by default it receives the result of all arithmetic operations. The B register is used in a similar manner, except that it can receive the extended answers from the multiply and divide operations. When not being used for multiplication and Division, the B register is available as an extra general-purpose register. The A and B registers can store up to 8-bits of data each. 2.1.6 APPLICATIONS Embedded design and development Communication and networks 2.2 POWER SUPPLY CIRCUIT

Figure 5 Power supply circuit

2.2.1 BRIDGE RECTIFIER A bridge rectifier is an arrangement of four or more diodes in a bridge circuit configuration which provides the same output polarity for either input polarity. It is used for converting an alternating current (AC) input into a direct current (DC) output. A bridge rectifier provides full-wave rectification from a two-wire AC input, therefore resulting in lower weight and cost when compared to a rectifier with a 3-wire input from a transformer with a center-tapped secondary winding.

16

2.2.2 LED A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n junction diode, which emits light when activated. When a suitable voltage is applied to the leads, electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence, and the color of the light (corresponding to the energy of the photon) is determined by the energy band gap of the semiconductor. An LED is often small in area (less than 1 mm2) and integrated optical components may be used to shape its radiation pattern. 2.2.3 VOLTAGE REGULATOR 7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at input and output pins depending upon the respective voltage levels.

2.2.3.1 PIN DIAGRAM

Figure 6 Voltage regulator

17

2.2.3.2 PIN DESCRIPTION Pin No

Function

Name

1

Input voltage (5V-18V)

Input

2

Ground (0V)

Ground

3

Regulated output; 5V (4.8V-5.2V)

Output

2.2.4 FILTER Filter capacitors are capacitors used for filtering of undesirable frequencies. They are common in electrical and electronic equipment, and cover a number of applications, such as: Glitch removal on Direct current (DC) power rails Radio frequency interference (RFI) removal for signal or power lines entering or leaving equipment Capacitors used after a voltage regulator to further smooth dc power supplies Capacitors used in audio, intermediate frequency (IF) or radio frequency (RF) frequency filters (e.g. low pass, high pass, notch, etc.) Arc suppression, such as across the contact breaker or 'points' in a spark-ignition engine

2.3 BLUE TOOTH MODULE 2.3.1 HC - 05 SERIAL BLUE TOOTH MODULE

Figure 7 Blue tooth module

HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup. Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Blue

18

core 04-External single chip Bluetooth system with CMOS technology and with AFH(Adaptive Frequency Hopping Feature). It has the footprint as small as 12.7mmx27mm. 2.3.2 HARDWARE FEATURES Typical -80dBm sensitivity Up to +4dBm RF transmit power Low Power 1.8V Operation ,1.8 to 3.6V I/O PIO control UART interface with programmable baud rate With integrated antenna With edge connector

Figure 8 Blue tooth module IC

2.3.3 SOFTWARE FEATURES Default Baud rate: 38400, Data bits:8, Stop bit:1,Parity:No parity, Data control: has Supported baud rate: 9600,19200,38400,57600,115200,230400,460800. Given a rising pulse in PIO0, device will be disconnected. Status instruction port PIO1: low-disconnected, high-connected; PIO10 and PIO11 can be connected to red and blue led separately. When master and slave are paired, red and blue led blinks 1time/2s in interval, while disconnected only blue led blinks 2 times/s. Auto-connect to the last device on power as default. Permit pairing device to connect as default. Auto-pairing PINCODE:”1234” as default

19

Auto-reconnect in 30 min when disconnected as a result of beyond the range of connection. The wireless-networking standard technology called Bluetooth has subtly become an innovative way to control a robot and a technology to replace the cables. Using an Android device to control a robot over Bluetooth is another step forward in remote robotics control by sending commands with the flick of a wrist. With an opened architecture and powerful proficiency, Android has become popular operating system among intense hobbyists able to build remote control applications with small development resources. They use smartphones or tablets that run Android OS and build applications feasible of developing remote controlled robots by sending some sort of signals wirelessly and at simple movements of the device or touching the screen. Based on the Java programming language, a built-in Bluetooth module, and a series of useful sensors already integrated and having permanent Internet connectivity, almost any Android device is categorized as a perfect tool for remote robotics control over Bluetooth. The idea of this paper is to use an Android application that allows you to communicate with a robot over the Bluetooth technology. The robot can respond to button, and swipes on the touch screen. In this way, you can control the robot to transport from one place to the other using commands forward, reverse, left and right. HC – 05 Serial Bluetooth product consists of Bluetooth serial interface module and Bluetooth adapter. Bluetooth serial module is used for converting serial port to Bluetooth. This module has two modes: master and slaver device. The device named after odd number is defined to be master or slaver when out of factory and can’t changed to the other mode. But for the device named after even number, users can set the work mode (master or slaver) of the device by AT commands. The main function of Bluetooth serial module is replacing the serial port line, such as: One connects to Bluetooth master device while the other one connect to slaver device. Their connection can be built once the pair is made. This Bluetooth connection is equivalently liked to a serial port line connection including RXD, TXD signals. And they can communicate with each other. When MCU has Bluetooth salve module, it can communicate with Bluetooth adapter of computer and smart phones. The Bluetooth devices in the market mostly are salve devices, such as Bluetooth printer, Bluetooth GPS. So, we can use master module to make pair and communicate with

them.

20

Bluetooth serial module’s operation doesn’t need drive, and can communicate with the other Bluetooth device. But communication between two Bluetooth module require at two conditions: i) The communication must be between master and slave. ii) The password must be correct. 2.4 MOTOR DRIVER IC 2.4.1 MOTOR DRIVER IC L293D

Figure 9 Motor driver IC

The L293 and L293D are quadruple high-current half –H drivers. L293D is a typical Motor driver or Motor Driver IC which is used to drive DC on either direction. It is a 16-pin IC which can control a set of two DC motors simultaneously in any direction. It means that you can control two DC motor with a single L293D IC. Dual H-bridge Motor Driver integrated circuit (IC).The L293D can drive small and quiet big motors as well. L293 and L293D both are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high voltage loads in positive-supply applications. On the L293D, external high-speed output clamp diodes should be used for inductive transient suppression. A Vcc1 terminal, separate from Vcc2, is provided for the logic inputs to minimize device power dissipation. The L293 and L293D are characterized for operation from 0 0C to 70 0C. It works on the concept of H-bridge. H-bridge is a circuit which allows the high voltage to be flown in either direction. As you know voltage should change its direction to able to rotate the

21

motor in clockwise or anticlockwise direction. Hence H-bridge IC are ideal for driving a DC motor using micro-controller. In a single L293D IC there two H-Bridge circuits inside it which can rotate two dc motor independently. Due its size it is very much used in robotic application for controlling DC motors. 2.4.2 PIN DESCRIPTION

Figure 10 L293D pin diagram

There are two Enable pins on L293D. Pin 1 and pin 9, for being able to drive the motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to enable pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If anyone of the either pin1 or pin9 goes low then the motor in the corresponding section will suspend working. It’s like a switch. The 4 input pins for this L293D, pin 2,7 on the left and pin 15, 10 on the right as shown on the pin diagram. Left input pins will regulate the rotation of motor connected on the left side and right input for motor on the right hand side. The motors are rotated on the basis of the inputs provided at the input pins as LOGIC 1 or LOGIC 0. In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.

22

Let us consider a Motor connected on left side output pins (pin 3,6). For rotating the motor in clockwise direction the input pins has to be given with Logic 1 and Logic 0. • Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction • Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction • Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state] • Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation] In a very similar way the motor can also operated across input pin 15,10 for motor on the right hand side. The voltage (Vcc) needed to for its own working is 5V but L293d will not use that Voltage to drive DC Motors. That means you should provide that voltage(36V maximum) and a maximum current of 600mA to drive the motors. 2.5 LIQUID CRYSTAL DISPLAY 2.5.1 LCD (16 BY 2)

Figure 11 LCD

A liquid-crystal display (LCD) is a flat panel display, electronic visual display, or video display that uses the light modulating properties of liquid crystals. Liquid crystals do not emit light directly. LCDs are available to display arbitrary images (as in a general-purpose computer display) or fixed images with low information content which can be displayed or hidden, such as preset words, digits, and 7-segment displays as in a digital clock. They use the same basic technology, except that arbitrary images are made up of a large number of small pixels, while other displays have larger elements.

23

LCDs are used in a wide range of applications including computer monitors, televisions, instrument panels, aircraft cockpit displays, and signage. They are common in consumer devices such as DVD players, gaming devices, clocks, watches, calculators, and telephones, and have replaced cathode ray tube (CRT) displays in nearly all applications. They are available in a wider range of screen sizes than CRT and plasma displays, and since they do not use phosphors, they do not suffer image burn-in. LCDs are, however, susceptible to image persistence. The LCD screen is more energy efficient and can be disposed of more safely than a CRT. Its low electrical power consumption enables it to be used in battery powered electronic equipment. It is an electronically modulated optical device made up of any number of segments controlling a layer of liquid crystals and arrayed in front of a light source (backlight) or reflector to produce images in color or monochrome. Liquid crystals were first discovered in 1888. By 2008, annual sales of televisions with LCD screens exceeded sales of CRT units worldwide, and the CRT became obsolete for most purposes. LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments and other multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation of displaying special and even custom characters (unlike in seven segments), animations and so on. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data. The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD. 2.5.2 PIN DESCRIPTION

Figure 12 Pin diagram of LCD

24

Pin

Function

Name

1

Ground (0V)

Ground

2

Supply voltage; 5V (4.7V – 5.3V)

Vcc

3

Contrast adjustment; through a variable resistor

VEE

4

Selects command register when low; and data register when high

Register Select

5

Low to write to the register; High to read from the register

Read/write

6

Sends data to data pins when a high to low pulse is given

Enable

No

7

DB0

8

DB1

9

DB2

10

DB3

8-bit data pins

11

DB4

12

DB5

13

DB6

14

DB7

15

Backlight VCC (5V)

Led+

16

Backlight Ground (0V)

Led-

2.5.3 16×2 LCD MODULE COMMANDS 16×2 LCD module has a set of preset command instructions. Each command will make the module to do a particular task. The commonly used commands and their function are given in the table below.

Function

Command

LCD ON, Cursor ON, Cursor blinking 0F

ON

01

Clear screen

VOICE OPERATED ROBOT

29

02

Return home

04

Decrement cursor

06

Increment cursor

0E

Display ON ,Cursor blinking OFF

80

Force cursor to the beginning of 1st line

C0

Force cursor to the beginning of 2nd line

38

Use 2 lines and 5×7 matrix

83

Cursor line 1 position 3

3C

Activate second line

08

Display OFF, Cursor OFF

C1

Jump to second line, position1

OC

Display ON, Cursor OFF

C1

Jump to second line, position1

C2

Jump to second line, position2

INSTITUTE OF AERONAUTICAL ENGINEERING

VOICE OPERATED ROBOT

30

2.5.4 LCD INITIALIZATION The steps that has to be done for initializing the LCD display is given below and these steps are common for almost all applications. Send 38H to the 8 bit data line for initialization Send 0FH for making LCD ON, cursor ON and cursor blinking ON. Send 06H for incrementing cursor position. Send 01H for clearing the display and return the cursor.

2.6 AMR VOICE RECORDER APPLICATION 2.6.1 AMR VOICE

Figure 13 AMR voice application

2.6.1.1 INTRODUCTION The Adaptive Multi-Rate (AMR or AMR-NB or GSM-AMR) audio codec is an audio compression format optimized for speech coding. AMR speech codec consists of a multirate narrowband speech codec that encodes narrowband (200–3400 Hz) signals at variable bit rates ranging from 4.75 to 12.2 kbit/s with toll quality speech starting at 7.4 kbit/s.

VOICE OPERATED ROBOT

31

AMR was adopted as the standard speech codec by 3GPP in October 1999 and is now widely used in GSM and UMTS. It uses link adaptation to select from one of eight different bit rates based on link conditions. AMR is also a file format for storing spoken audio using the AMR codec. Many modern mobile telephone handsets can store short audio recordings in the AMR format, and both free and proprietary programs exist to convert between this and other formats, although AMR is a speech format and is unlikely to give ideal results for other audio. The common filename extension is ‘.amr’. There also exists another storage format for AMR that is suitable for applications with more advanced demands on the storage format, like random access or synchronization with video. This format is the 3GPP-specified 3GP container format based on ISO base media file format. The frames contain 160 samples and are 20 milliseconds long. AMR uses various techniques, such as ACELP, DTX, VAD and CNG. The usage of AMR requires optimized link adaptation that selects the best codec mode to meet the local radio channel and capacity requirements. If the radio conditions are bad, source coding is reduced and channel coding is increased. This improves the quality and robustness of the network connection while sacrificing some voice clarity. In the particular case of AMR this improvement is somewhere around S/N = 4-6 dB for usable communication. The new intelligent system allows the network operator to prioritize capacity or quality per base station. There are a total of 14 modes of the AMR codec, 8 are available in a full rate channel (FR) and 6 on a half rate channel (HR). Sampling frequency 8 kHz/13-bit (160 samples for 20 ms frames), filtered to 200– 3400 Hz. The AMR codec uses eight source codecs with bit-rates of 12.2, 10.2, 7.95, 7.40, 6.70, 5.90, 5.15 and 4.75 kbit/s. Generates frame length of 95, 103, 118, 134, 148, 159, 204, or 244 bits for AMR FR bit rates 4.75, 5.15, 5.90, 6.70, 7.40, 7.95, 10.2, or 12.2 kbit/s, respectively. AMR HR frame lengths are different. AMR utilizes Discontinuous Transmission (DTX), with Voice Activity Detection (VAD) and Comfort Noise Generation (CNG) to reduce bandwidth usage during silence periods Algorithmic delay is 20 ms per frame. For bit-rates of 12.2, there is no 'algorithm' lookahead delay. For other rates, look-ahead delay is 5 ms. Note that there is 5 ms 'dummy' look-ahead delay, to allow seamless frame-wise mode switching with the rest of rates.

VOICE OPERATED ROBOT

32

AMR is a hybrid speech coder, and as such transmits both speech parameters and a waveform signal. DIFFERENT SOFTWARES SUPPORT AMR ON DIFFERENT PLATFORMS IN ANDROID OS, AMR IS USED FOR VOICE RECOGNITION. 2.7 ROBOT KIT

Figure 14 Robot kit

A robot kit is a special construction kit for building robots, especially autonomous mobile robots. Toy robot kits are also supplied by several companies. They are mostly made of plastics elements like Lego Mind storms, the Robotics Bioloid, Robobuilder, the ROBO-BOX-3.0 (produced by Inex), and the lesser-known KAI Robot (produced by Kaimax), or aluminum elements like Lynx motion's Servo Erector Set and the qfix kit. The kits can consist of: structural elements, mechanical elements, motors (or other actuators), sensors and a controller board to control the inputs and outputs of the robot. In some cases, the kits can be available without electronics as well, to provide the user the opportunity to use his or her own.

VOICE OPERATED ROBOT

33

CHAPTER-3 SOFTWARE COMPONENTS 3.1 KEIL’S SOFTWARE 3.1.1 INTRODUCTION

Figure 15 Keil microvision 3 software

The Keil C51 C Compiler for the 8051 microcontroller is the most popular 8051 C compiler in the world. It provides more features than any other 8051 C compiler available today. The C51 Compiler allows you to write 8051 microcontroller applications in C that, once compiled, have the efficiency and speed of assembly language. Language extensions in the C51 Compiler give you full access to all resources of the 8051. The C51 Compiler translates C source files into relocatable object modules which contain full symbolic information for debugging with the µVision Debugger or an in-circuit emulator. In addition to the object file, the compiler generates a listing file which may optionally include symbol table and cross reference information. 3.1.2 FEATURES Nine basic data types, including 32-bit IEEE floating-point, Flexible variable allocation with bit, data, bdata, idata, xdata, and pdatamemory types, Interrupt functions may be written in C,

VOICE OPERATED ROBOT

34

Full use of the 8051 register banks, Complete symbol and type information for source-level debugging, Use of AJMP and ACALL instructions, Bit-addressable data objects, Built-in interface for the RTX51 Real-Time Kernel Support for dual data pointers on Atmel, AMD, Cypress, Dallas Semiconductor, Infineon, Philips, and Triscend microcontrollers, Support for the Philips 8xC750, 8xC751, and 8xC752 limited instruction sets, Support for the Infineon 80C517 arithmetic unit.

3.1.3 INTRODUCTION OF KEIL The Keil Software LPC2148 development tools listed below are programs you use to compile your C code, assemble your assembly source files, link and locate object modules and libraries, create HEX files, and debug your target program. μVision for Windows™ is an Integrated Development Environment that combines project management, source code editing, and program debugging in one single, powerful environment. The ARM7 ANSI Optimizing C Compiler creates re locatable object modules from your C source code. The ARM Macro Assembler creates re locatable object modules from your LPC21XX assembly source code. The Linker/Locator combines re-locatable object modules created by the Compiler and the Assembler into absolute object modules. The Library Manager combines object modules into libraries that may be used by the linker. The Object-HEX Converter creates Intel HEX files from absolute object modules. 3.1.4 DEVELOPMENT TOOLS The Keil development tools for ARM offer numerous features and advantages that help you quickly and successfully develop embedded applications. They are easy to use and are guaranteed to help you achieve your design goals. The μVision IDE and Debugger is the central part of the Keil ARM development tools. µVision offers a Build Mode and a Debug Mode. In the μVision Build Mode you maintain the project files and generate the application. μVision uses either the GNU or ARM ADS/Real View™ development tools. In the μVision Debug Mode you verify your program either with a powerful CPU and peripheral simulator that connects the debugger to the target system. The ULINK allows you also to download your application into Flash ROM of your target system.

VOICE OPERATED ROBOT

CHAPTER-4 IMPLEMENTATION 4.1 BLOCK DIAGRAM

Figure 16 Block diagram

Figure 17 Voice operated robot

35

VOICE OPERATED ROBOT

36

4.2 WORKING 4.2.1 ANDROID MEETS ROBOTS Voice Recognition uses android mobiles internal voice recognition to pass voice commands to your robot pairs with Blue tooth Serial Modules and sends in the recognized voice as a string for example if you say Hello the android phone will return a string *Hello# to your blue tooth module * and # indicate the start and stop bits. It can be used with any micro- controller which can handle strings.

Figure 18 Connecting the robot

VOICE OPERATED ROBOT

37

Example platforms: Arduino, ARM, PICAXE, MSP430, 8051 based and many other processors and controllers. Control your Processor/Controller with voice commands using an Android smart phone! AMR Voice application lets us command the Processor/Controller using an Android smart phone and a HC-05 Bluetooth module. Android OS has speech recognition and we can use it to control our 8051 microcontroller, via Bluetooth. The App works by pressing the MIC button, then it will wait for us to say a command. The app will then display the word's that we have stated and will send data strings for the 8051 microcontroller to process. 4.2.2 INTERFACING LCD TO 8051 4.2.2.1 SENDING DATA TO THE LCD The steps for sending data to the LCD module is given below. I have already said that the LCD module has pins namely RS, R/W and E. It is the logic state of these pins that make the module to determine whether a given data input is a command or data to be displayed. Make R/W low. Make RS=0 if data byte is a command and make RS=1 if the data byte is a data to be displayed. Place data byte on the data register. Pulse E from high to low. Repeat above steps for sending another data.

VOICE OPERATED ROBOT

38

4.2.2.2 CIRCUIT DIAGRAM

Figure 19 Interfacing LCD to 8051

The circuit diagram given above shows how to interface a 16×2 LCD module with AT89S1 microcontroller. Capacitor C3, resistor R3 and push button switch S1 forms the reset circuitry. Ceramic capacitors C1, C2 and crystal X1 is related to the clock circuitry which produces the system clock frequency. P1.0 to P1.7 pins of the microcontroller is connected to the DB0 to DB7 pins of the module respectively and through this route the data goes to the LCD module. P3.3, P3.4 and P3.5 are connected to the E, R/W, RS pins of the microcontroller and through this route the control signals are transfered to the LCD module. Resistor R1 limits the current through the back light LED and so do the back light intensity. POT R2 is used for adjusting the contrast of the display.

VOICE OPERATED ROBOT

39

4.2.3 INTERFACING MOTOR DRIVER TO 8051

Figure 20 Interfacing motor controller to 8051

We can easily control the switching of L293D using a microcontroller. There are two IC’s in this category L293D and L293. L239D can provide a maximum current of 600mA from 4.5V to 36V while L293 can provide up to 1A under the same input conditions. All inputs of these ICs are TTL compatible and clamp diodes is provided with all outputs. They are used with inductive loads such as relays solenoids, motors etc. L293D contains four Half H Bridge drivers and are enabled in pairs. EN1 is used to enable pair 1 (IN1-OUT1, IN2-OUT2) and EN2 is used to enable pair 2 (IN3-OUT3, IN4-OUT4). We can drive two DC Motors using one L293D, but here we are using only one. You can connect

second

DC

Motor

to

driver

pair

2

according

to

your

needs.

VOICE OPERATED ROBOT

40

4.2.3.1 CIRCUIT DIAGRAM

Figure 21 Circuit diagram showing motor interfacing

The DC Motor is connected to the first pair of drivers and it is enabled by connecting EN1 to logic HIGH (5V).

VSS pin is used to provide logic voltage to L293D. Here 8051

microcontroller, which works at 5v is used to control L293D, hence the logic voltage is 5. The motor supply is given to Vs pin of the L293D. 4.2.4 INTERFACING BLUETOOTH MODULE WITH 8051 (HC05) A Bluetooth module widely used with Microcontroller to enable Bluetooth communication. This module cam be interfaced using the UART in 8051 microcontroller where the data are transmitted in the form of packets. The pins TX and RX pin of the HC 05 form the path for data transmission and reception. These TX pin of HC05 must be connected to the RX pin of

VOICE OPERATED ROBOT

41

8051 and vice versa. Whereas the key pin of the module is used to set the password for pairing the module with our devices. Our devices such as mobile and PC’s need special applications known as “Bluetooth Terminal” to communicate with our microcontrollers via Bluetooth. Not to worry, there are plenty of apps you can find in the internet. These apps are available in plenty irrespective of the you device OS Android, Windows , Mac whatever it may be. Just run a search such as Bluetooth Terminal for “OS name” and search engines will take you to the destination. These applications are developed in such a way to send characters through your device BT which was received by the BT module connected with our controller. Even some apps offers some interactive GUI buttons which transmits specific characters with the press of each buttons. Later the received character can be processed in our code and force the controller to perform tasks based on the received character. We can use the Bluetooth communication in two ways, either we can use it to receive data from the Controller or control the system using our device Bluetooth. 4.2.4.1 SCHEMATIC DESIGN

Figure 22 Interfacing blue tooth module to 8051

VOICE OPERATED ROBOT

42

CHAPTER-5 RESULT ANALYSIS 5.1 ADVANTAGES When we say voice control, the first term to be considered is Speech Recognition i.e. making the system to understand human voice. Speech recognition is a technology where the system understands the words (not its meaning) given through speech. Speech is an ideal method for robotic control and communication. The speech recognition circuit we will outline, functions independently from the robot’s main intelligence [central processing unit (CPU)]. This is a good thing because it doesn’t take any of the robot’s main CPU processing power for word recognition. The CPU must merely poll the speech circuit’s recognition lines occasionally to check if a command has been issued to the robot. We can even improve upon this by connecting the recognition line to one of the robot’s CPU interrupt lines. By doing this, a recognized word would cause an interrupt, letting the CPU know a recognized word had been spoken. The advantage of using an interrupt is that polling the circuit’s recognition line occasionally would no longer be necessary, further reducing any CPU overhead. Another

advantage

to

this

stand-alone

speech-recognition

circuit

(SRC)

is

its

programmability. You can program and train the SRC to recognize the unique words you want recognized. The SRC can be easily interfaced to the robot’s CPU. To control and command an appliance (computer, VCR, TV security system, etc.) by speaking to it, will make it easier, while increasing the efficiency and effectiveness of working with that device.At its most basic level speech recognition allows the user to perform parallel tasks, (i.e. hands and eyes are busy elsewhere) while continuing to work with the computer or appliance. Robotics is an evolving technology. There are many approaches to building robots, and no one can be sure which method or technology will be used 100 years from now. Like biological systems, robotics is evolving following the Darwinian model of survival of the fittest.

VOICE OPERATED ROBOT

43

Suppose you want to control a menu driven system. What is the most striking property that you can think of? Well the first thought that came to our mind is that the range of inputs in a menu driven system is limited. In fact, by using a menu all we are doing is limiting the input domain space. Now, this is one characteristic which can be very useful in implementing the menu in stand alone systems. 5.2 DISADVANTAGE “It makes man even more lazier”......... 5.3 APPLICATIONS Menu driven systems like e-mail readers Household appliances like washing machines, microwave ovens and pagers and mobiles, etc. Military applications Industrial applications

Figure 23 Industrial application

VOICE OPERATED ROBOT

44

It is a gift for physically handicapped.

5.4 FUTURE SCOPE We can also extend our project to advanced applications by extending its range, by using Zigbee technology or by using GPS. We can also proceed to construct a full fledged robot to carry out more complex tasks. We can program the robot to shoot a target.

5.5 CONCLUSION The aim of this project is to give a small gift to the unfortunate people who are physically handicapped. By giving simple voice commands, their daily chores can be very easily accomplished. The main challenges that we faced during this project’s implantation include, the range of the Bluetooth, the delay between the transmission and reception of the voice command. This project proves to be a significant asset to the field of Robotics.

VOICE OPERATED ROBOT

REFERENCES The 8051 Micro controller and Embedded SystemsMuhammad Ali Mazidi, Janice Gillispie Mazidi The 8051 Micro controller Architecture, Programming & ApplicationsKenneth J.Ayala Fundamentals of Micro processors and Micro computersB.Ram Micro processor Architecture, Programming & ApplicationsRamesh S.Gaonkar Electronic ComponentsD.V.Prasad http://www.pdfcoke.com http://www.morldtechgossips.com, simple way of understand Other websiteshttp://www.elprocus.com/solar-panel-facts/ http://org.ntnu.no/solarcells/pages/introduction.php http://www.facstaff.bucknell.edu http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/leds.html www.national.com www.atmel.com www.microsoftsearch.com www.geocities.com

45

VOICE OPERATED ROBOT

APPENDICES SOURCE CODE: #include #include #define lcd_dport P0 sbit lcd_rs = P1^5; sbit lcd_rw = P1^6; sbit lcd_en = P1^7; sbit lcd_busy = P0^7; sbit mtr0 = P2^0; sbit mtr1 = P2^1; sbit mtr2 = P2^2; sbit mtr3 = P2^3; bit start; typedef unsigned char uc; void lcd_init(); void lcd_string(char *); void lcd_cmnd(char ); void lcd_data(char ); void lcd_busy_chk(void); void delayms(unsigned int); void compare_function(); void welcome_data(void); int cnt=0,i=0,j=0;

46

VOICE OPERATED ROBOT

47

char b[10]; //char c[4]={'s','t','a','r'},d[4]={'b','a','c','k'},f[4]={'l','e','f','t'},g[4]={'r','i','g','t'},h[4]={'s','t','o','p '}; char c[4]={'*','f'},d[4]={'*','b'},f[4]={'*','l'},g[4]={'*','r'},h[4]={'*','s'}; /*.........serial interrupt program.............*/ void serial0(void)interrupt 4 { while(TI!=0) { TI=0;

//clear interrupt

RI=0;

//clear interrupt

} while(RI!=0) {

b[i]=SBUF; //lcd_data(b[i]); delayms(5); i++; cnt++; if(cnt==2) { start=1; } }

VOICE OPERATED ROBOT

} /*............main program function.............*/ void main(void) { mtr0=0;mtr1=0;mtr2=0;mtr3=0; lcd_init(); TMOD=0x20; TH1 =0xFD; SCON=0x50; IE =0x90; TR1 =1; welcome_data(); while(1) { if(start==1) { compare_function(); delayms(138); welcome_data(); start=0;cnt=0;j=0;i=0; } } } /*..........TAGID compare function............*/

48

VOICE OPERATED ROBOT

void compare_function() { if((b[0]==c[0])&&(b[1]==c[1])) { mtr0=1;mtr1=0;mtr2=1;mtr3=0; lcd_cmnd(0x01); lcd_cmnd(0x80); lcd_string(" FORWARD "); for(i=0;i<5;i++) { b[i]=0; }

} else if((b[0]==d[0])&&(b[1]==d[1])) { mtr0=0;mtr1=1;mtr2=0;mtr3=1; lcd_cmnd(0x01); lcd_cmnd(0x80); lcd_string(" BACKWARD "); for(i=0;i<5;i++) { b[i]=0; }

49

VOICE OPERATED ROBOT

50

delayms(18); } else if((b[0]==f[0])&&(b[1]==f[1])) { mtr0=0;mtr1=0;mtr2=1;mtr3=0; lcd_cmnd(0x01); lcd_cmnd(0x80); lcd_string(" LEFT "); for(i=0;i<5;i++) { b[i]=0; } delayms(18); } else if((b[0]==g[0])&&(b[1]==g[1])) { mtr0=1;mtr1=0;mtr2=0;mtr3=0; lcd_cmnd(0x01); lcd_cmnd(0x80); lcd_string(" RIGHT for(i=0;i<5;i++) { b[i]=0; }

");

VOICE OPERATED ROBOT

51

delayms(18); } else if((b[0]==h[0])&&(b[1]==h[1])) { mtr0=0;mtr1=0;mtr2=0;mtr3=0; lcd_cmnd(0x01); lcd_cmnd(0x80); lcd_string(" STOP

");

for(i=0;i<5;i++) { b[i]=0; } delayms(18); } } /*...........delay routine program...........*/ void delayms(unsigned int itime) { unsigned int q,p; for(q=0;q
VOICE OPERATED ROBOT

{ lcd_cmnd(0x01); lcd_cmnd(0x80); lcd_string(" VOICE ROBOT "); lcd_cmnd(0xC0); lcd_string(" USING -ANDROID"); } /*..........lcd initialization program..........*/ void lcd_init() { lcd_cmnd(0x30); lcd_cmnd(0x38); lcd_cmnd(0x06); lcd_cmnd(0x0c); lcd_cmnd(0x01); } /*........lcd string display................*/ void lcd_string(char *ptr) { while(*ptr) { lcd_data(*ptr); ptr++; }

52

VOICE OPERATED ROBOT

} /*...........lcd command program..............*/ void lcd_cmnd(char byte) { lcd_busy_chk(); lcd_dport =byte; lcd_rs = 0; lcd_rw = 0; lcd_en = 1; _nop_(); _nop_(); lcd_en = 0; } /*............lcd data program................*/ void lcd_data(char byte) { lcd_busy_chk(); lcd_dport =byte; lcd_rs = 1; lcd_rw = 0; lcd_en = 1; _nop_(); _nop_(); lcd_en = 0;

53

VOICE OPERATED ROBOT

} /*.........lcd busycheck program................*/ void lcd_busy_chk(void) { lcd_busy = 1; lcd_rs = 0; lcd_rw = 1; while(lcd_busy==1) { lcd_en = 0; _nop_(); _nop_(); lcd_en = 1; } }

54

VOICE OPERATED ROBOT

55

More Documents from "Samsul Hutha"

Pgm.pdf
July 2020 10
D.el.ed.docx
May 2020 11
Agri.docx
May 2020 6
Voice.docx
July 2020 7