project lastest one 9.00pm
TRANSCRIPT
ABSTRACT
Speech is primary mode of communication among the human beings. In the presence work
we have designed a robot which could move according the our voice command. The system
comprises of mike, microcontroller unit(MCU), motor interfacing circuit ,amplitude shift keying
module (ASK and ultrasonic sensor. Our voice command is given as input to the mike which
is recognized by the HM 2007 IC, then the digital signal is transferred through the wireless
ASK module to the MCU. The MCU sends the control signals based on the voice command for
the movement of the robot. The MCU also checks the input from the ultrasonic sensor which
monitors the obstacle and the MCU gives the necessary control signal for the robot to avoid
obstacle. Our system is person depended voice recognition robot. The biggest advantage of this
type of robot is no one can misuse it. As the robot does not respond to the stranger’s voice, it is
secured. We can configure more than one voice that depends on our usage . Ultrasonic
sensor is used to detect obstacle on their path. The advantage of ultrasonic sensor is to cover
long range. The robot is powered using a 12v battery.
Page 1 of 37
LIST OF FIGURES
FIGURE NO FIGURE PAGE NO.
Figure 2.1 Structure of service robot wireless control system transmitter
section
Figure 3.1 Block Diagram of Robot
Figure 3.2 Command section
Figure 3.3 Control section
Figure 4.1 Circuit Diagram For Voice Recognition
Figure 4.2 Atmega8 Pin Configuration
Figure 4.3 TQFP Top View
Figure 4.4 MLF Top View
Figure 4.5 Pin Diagram of Motor Driver
Figure 4.6 Internal Circuit Diagram of Motor Driver
Figure 4.7 Architecture Of Atmega8
Figure 4.8 Internal Motor Driver Circuit
Page 2 of 37
LIST OF TABLES
TABLE NO. FIGURE PAGE NO.
4.1 Values for the motor working 42
Page 3 of 37
ABBREVTIONS
ACCRONYM WORD
MCU Micro Controller
A/D Analog to digital convertor
D/A Digital to Analog convertor
I/O Input\Output ports
USB Universal Serial Bus
IC Intergrated Circuit
LED Light Emitting Diode
SRAM Secondary Random Access Memory
EEPROM Electrically Erasable Programmable Read Only Memory
ADC Analog to Digital Comparator
TRN Train
CLR Clear
AUI Aural Interface
USART Universal Synchronous Asynchronous Receiver Transmitter
ASK Amplitude Shift Keying
Page 4 of 37
Page 5 of 37
CHAPTER-1
INTRODUCTION
1.1 OVERVIEW :
A robot is a mechanical or virtual intelligent agent that can perform tasks automatically or with
guidance, typically by remote control. In practice a robot is usually an electro-mechanical machine that is
guided by computer and electronic programming.[citation needed] Robots can be autonomous, semi-
autonomous or remotely controlled.The word robot can refer to both physical robots and virtual software
agents, but the latter are usually referred to as bots. There is no consensus on which machines qualify as
robots but there is general agreement among experts, and the public, that robots tend to do some or all of
the following: move around, operate a mechanical limb, sense and manipulate their environment, and
exhibit intelligent behavior — especially behavior which mimics humans or other animals.
In our project we have designed a wireless robot in such a way that the robot is controlled by the
commands given by a human. This wireless robot system improves the Travel efficiency and convenience.
The input is given through the voice of a human in the form of Analog. This analog input is received by
microcontroller in the form of bits To make human-robot communication natural, it is necessary for the
robot to recognize voice even while is moving and performing gestures. For example, a robot's gesture is
considered to play a crucial role in natural human-robot communication . In addition, robots are expected to
perform tasks by physical actions to make a presentation . If the robot can recognize human interruption
voice while it is executing physical actions or making a presentation with gestures, it would make the robot
more useful.
1.2 HISTORY
1.2.1 ANCIENT BEGINNINGS
In ancient Greece, the Greek engineer Ctesibius (c. 270 BC) "applied a knowledge of
pneumatics and hydraulics to produce the first organ and water clocks with moving figures. In the 4th
century BC, the Greek mathematician Archytas of Tarentum postulated a mechanical steam-operated bird
he called "The Pigeon". Hero of Alexandria (10–70 AD), a Greek mathematician and inventor, created
numerous user-configurable automated devices, and described machines powered by air pressure, steam
and water.In ancient China, the 3rd century BC text of the Lie Zi describes an account of humanoid
automata, involving a much earlier encounter between King Mu of Zhou (Chinese emperor 10th century
BC) and a mechanical engineer known as Yan Shi, an 'artificer'. The latter proudly presented the king with
4.2 ATMEGA8
4.2.1 INTRODUCTION:
We have chosen atmega8 due to its high performance ,low power consumption
and low cost. The Atmel®AVR® ATmega8 is a low-power CMOS 8-bit microcontroller based
on the AVR RISC architecture. By executing powerful instructions in a single clock cycle, the
ATmega8 achieves throughputs approaching 1MIPS per MHz, allowing the system designer to
optimize power consumption versus processing speed.
The main features of Atmel®AVR® ATmega8 are 8 Kbytes of In-System
Programmable Flash with Read-While-Write capabilities, 512 bytes of EEPROM, 1 Kbyte of
SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible
Timer/Counters with compare modes, internal and external interrupts, a serial programmable
USART, a byte oriented Two wire Serial Interface, a 6-channel ADC (eight channels in TQFP
and QFN/MLF packages) with 10-bit accuracy, a programmable Watchdog Timer with Internal
Oscillator, an SPI serial port, and five software selectable power saving modes.
The Atmel ATmega8 is a powerful microcontroller that provides a highly-flexible
and cost-effective solution to many embedded control applications. The ATmega8 is supported
with a full suite of program and system development tools, including C compilers, macro
assemblers, program debugger/simulators, In-Circuit Emulators, and evaluation kits.
Page 6 of 37
4.2.2PIN CONFIGURATIONS :
Figure 4.2 Atmega8 Pin Configuration
Figure 4.3 TQFP Top View
Page 7 of 37
Figure 4.4 MLF Top View
4.2.3 OVERVIEW :
The Atmel®AVR® ATmega8 is a low-power CMOS 8-bit microcontroller based on the AVR RISC architecture. By executing powerful instructions in a single clock cycle, the ATmega8 achieves throughputs approaching 1MIPS per MHz, allowing the system designer to optimize power consumption versus processing speed.
Page 8 of 37
4.2.4 ARCHITECTURE OF ATMAGA8
Figure 4.5 ATMECA8 Architecture
Page 9 of 37
The Atmel®AVR® core combines a rich instruction set with 32 general purpose working
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in one single instruction executed in one clock
cycle. The resulting architecture is more code efficient while achieving throughputs up to ten
times faster than conventional CISC microcontrollers. The device is manufactured using Atmel’s
high density non-volatile memory technology. The Flash Program memory can be reprogrammed
In-System through an SPI serial interface, by a conventional non-volatile memory programmer,
or by an On-chip boot program running on the
AVR core. The boot program can use any interface to download the application program in the
Application Flash memory. Software in the Boot Flash Section will continue to run while the
Application Flash Section is updated, providing true Read-While-Write operation. By combining
an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel
ATmega8 is a powerful microcontroller that provides a highly-flexible and cost-effective
solution
to many embedded control applications. The ATmega8 is supported with a full suite of program
and system development tools, including C compilers, macro assemblers, program
debugger/simulators, In-Circuit Emulators, and evaluation
kits.
4.2.5 REASONS FOR CHOSING ATMEGA8
8Kbytes of In-System Self-programmable Flash program memory
512Bytes EEPROM
1Kbyte Internal SRAM
Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode
One 16-bit Timer/Counter with Separate Prescaler, Compare and Capture mode
23 Programmable I/O Lines
On-chip Analog Comparator
Programmable Watchdog Timer with Separate On-chip Oscillator
Page 10 of 37
4.2.6 FEATURES
High-performance, Low-power Atmel®AVR® 8-bit Microcontroller
Advanced RISC Architecture
High Endurance Non-volatile Memory segments Power-on Reset and Programmable
Brown-out Detection
Internal Calibrated RC Oscillator
External and Internal Interrupt Sources
Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and Standby
4.2.7 CHARACTERISTICS OF ATMEGA8
Operating Temperature.................................. -55°C to +125C
Storage Temperature ..................................... -65°C to +150°C
Voltage on any Pin except RESET
with respect to Ground ................................-0.5V to VCC+0.5V
Voltage on RESET with respect to Ground......-0.5V to +13.0V
Maximum Operating Voltage ............................................ 6.0V
DC Current per I/O Pin ................................................ 40.0mA
DC Current VCC and GND Pins................................. 300.0mA
Page 11 of 37
4.3 SENSOR
4.3.1 INTRODUCTION:
A sensor (also called detector) is a converter that measures a physical quantity and converts
it into a signal which can be read by an observer or by an (today mostly electronic) instrument
Sensors are used in everyday objects such as touch-sensitive elevator buttons (tactile
sensor) and lamps which dim or brighten by touching the base. There are also innumerable
applications for sensors of which most people are never aware. Applications include cars,
machines, aerospace, medicine, manufacturing and robotics.
A sensor is a device which receives and responds to a signal. A sensor's sensitivity
indicates how much the sensor's output changes when the measured quantity changes.
Sensors need to be designed to have a small effect on what is measured; making the
sensor smaller often improves this and may introduce other advantages. Technological progress
allows more and more sensors to be manufactured on a microscopic scale as micro sensors using
ROBOTICS.
4.3.2 CLASSIFICATION OF MEASUREMENT OF ERRORS:
A good sensor obeys the following rules:
Is sensitive to the measured property only
Is insensitive to any other property likely to be encountered in its application
Does not influence the measured property
Ideal sensors are designed to be linear or linear to some simple mathematical function of the
measurement, typically logarithmic. The output signal of such a sensor is linearly proportional to
the value or simple function of the measured property. The sensitivity is then defined as the ratio
between output signal and measured property.
Page 12 of 37
4.3.3SENSORS IN NATURE:
Light, motion, temperature, magnetic fields, gravity, humidity, moisture, vibration,
pressure, electrical fields, sound, and other physical aspects of the external environment
Physical aspects of the internal environment, such as stretch, motion of the organism, and
position of appendages (proprioception)
Environmental molecules, including toxins, nutrients, and pheromones
Estimation of biomolecules interaction and some kinetics parameters
Internal metabolic milieu, such as glucose level, oxygen level, or osmolality
Internal signal molecules, such as hormones, neurotransmitters, and cytokines
4.3.4TYPES OF SENSOR:
INFRARED
ULTRASONIC
BIO SENSOR
RF SENSOR(radio frequency) .
4.3.5 SENSOR DEVIATION:
If the sensor is not ideal, several types of deviations can be observed:
The sensitivity may in practice differ from the value specified. This is called a sensitivity
error, but the sensor is still linear.
Since the range of the output signal is always limited, the output signal will eventually
reach a minimum or maximum when the measured property exceeds the limits. The full
scale range defines the maximum and minimum values of the measured property.
If the output signal is not zero when the measured property is zero, the sensor has an
offset or bias. This is defined as the output of the sensor at zero input.
If the sensitivity is not constant over the range of the sensor, this is called non linearity.
Usually this is defined by the amount the output differs from ideal behavior over the full
range of the sensor, often noted as a percentage of the full range.
Page 13 of 37
If the deviation is caused by a rapid change of the measured property over time, there is a
dynamic error. Often, this behavior is described with a bode plot showing sensitivity
error and phase shift as function of the frequency of a periodic input signal.
Noise is a random deviation of the signal that varies in time.
Hysteresis is an error caused by when the measured property reverses direction, but there
is some finite lag in time for the sensor to respond, creating a different offset error in one
direction than in the other.
If the sensor has a digital output, the output is essentially an approximation of the
measured property. The approximation error is also called digitization error.
All these deviations can be classified as systematic errors or random errors. Systematic errors
can sometimes be compensated for by means of some kind of calibration strategy.
4.3.6 RESOLUTION:
The resolution of a sensor is the smallest change it can detect in the quantity that it is
measuring. Often in a digital display, the least significant digit will fluctuate, indicating that
changes of that magnitude are only just resolved. The resolution is related to the precision with
which the measurement is made. For example, a scanning tunneling probe (a fine tip near a
surface collects an electron tunneling current) can resolve atoms and molecules.
4.3.7 ULTRA SONIC SENSOR:
Ultrasonic sensor provides a very low-cost and easy method of distance
measurement. This sensor is perfect for any number of applications that require you to perform
measurements between moving or stationary objects. Naturally, robotics applications are very
popular but you'll also find this product to be useful in security systems or as an infrared
replacement if so desired. You will definitely appreciate the activity status LED and the
economic use of just one I/O pin.
Page 14 of 37
The Ping sensor measures distance using sonar; an ultrasonic (well above human
hearing) pulse is transmitted from the unit and distance-to-target is determined by measuring the
time required for the echo return. Output from the PING))) sensor is a variable-width pulse that
corresponds to the distance to the target.
4.3.8 FEATURES
• Range: 2 cm to 4 m
• Accurate and Stable range data
• Data loss in Error zone eliminated
• Modulation at 40 KHz
• Triggered externally by supplying a pulse to the signal pin.
• Echo pulse: positive TTL pulse, 87 µs minimum to 30 ms maximum(PWM)
4.3.9 WORKING
Normally sensor sense any kind of input signal and produces the desired output. Each
sensor performs various kinds of functions. Some of the sensor plays a vital role in electronics
field. One such sensor is described here as ultrasonic sensor.
• The sensor transmits an ultrasonic wave and produces an output pulse that corresponds to
the time required for the burst echo to return to the sensor.
• By measuring the echo pulse width, the distance to target can easily be calculated.
• The "ECHO" does not require any ADC or USART to measure the distance.
• This sensor helps the bot to travel for a longer distance &also it is used to detect any
• obstacle present while travelling
Page 15 of 37
4.4 SERIAL TRANSMITTER & RECEIVER
4.4.1 INTRODUCTION
The transmitter & receivers are used to transmit the information in from a source to a
distant destination. The basic principle in this type of communication is that the data to be
transmitted is converted in to corresponding binary codes and transmitted all around in a
particular frequency. The receiver is designed in such a way to scan for the presence of any
signal in the frequency to which it is tuned. Only one frequency/frequency band is used for one
dedicated link, that is the connection between the transmitter and receiver, for the transmission of
the data.
Transmitters and receivers must each perform two basic functions. The transmitter must
generate a radio frequency signal of sufficient power at the desired frequency. It must have some
means of varying (or modulating) the basic frequency so that it can carry an intelligible signal.
The receiver must select the desired frequency you want to receive and reject all unwanted
frequencies. In addition, receivers must be able to amplify the weak incoming signal to overcome
the losses the signal suffers in its journey through space.
4.4.2 TYPES OF TRANSMITTER AND RECEIVER:
The transmission system is classified according to two different categories
According to the way in which the bits are transmitted the transmission system is
classified as follows
PIPO(Parallel In Parallel Out)
SISO(Serial In Serial Out)
PISO(Parallel In Serial Out)
SIPO(Serial In Parallel Out)
According to the range of the frequency of the signal used the system is classifies
into
• Continuous Wave (Cw)
Page 16 of 37
• Amplitude Modulated (Am)
• Frequency Modulated (Fm)
• Phase Modulated (Pm)
• Single Sideband (Ssb)
• Etc…
4.4.3 ASK TRANSMITTER RECEIVER:
A transmitter can be a separate piece of electronic equipment, or an electrical circuit
within another electronic device. A transmitter and receiver combined in one unit is called
a transceiver. The term transmitter is often abbreviated "XMTR" or "TX" in technical
documents. The purpose of most transmitters is radio communication of information over a
distance. The information is provided to the transmitter in the form of an electronic signal, such
as an audio (sound) signal from a microphone, a video (TV) signal from a TV camera, or
in wireless networking devices a digital signal from a computer. The transmitter combines the
information signal to be carried with the radio frequency signal which generates the radio waves,
which is often called the carrier. This process is called modulation. The information can be
added to the carrier in several different ways, in different types of transmitter. In an amplitude
modulation (AM) transmitter, the information is added to the radio signal by varying
its amplitude (strength). Many other types of modulation are used.
This ASK transmitter (ASK Tx) is about the simplest and most basic ASK Tx it is
possible to build and have a useful transmitting range. It is surprisingly powerful despite its small
component count and 3V operating voltage. It will easily penetrate over three floors of an
apartment building and go over 300 meters in the open air.
The circuit we use is based on a proven Australian design. It may be tuned anywhere in the ASK
band. Or it may be tuned outside the commercial M band for greater privacy. (Of course this
means you must modify your ASK radio to
be able to receive the transmission or have a broad-band ASK receiver).
The output power of this ASK Tx is below the legal limits of many countries (eg, USA
and Australia). However,some countries may ban ALL wireless transmissions without a licence.
Page 17 of 37
It is the responsibility of the purchaser to check the legal requirements for the operation of this
kit and to obey them.
4.4.4 HT12A/HT12E ENCODERS:
The 212 encoders are a series of CMOS LSIs forVremote control system applications.
They are capable of encoding information which consists of N address bits and 12_N data bits.
Each address data input can be set to one of the two logic states. The programmed addresses/data
are transmitted together with the header bits via an RF or an infrared transmission medium upon
receipt of a trigger signal. The capability to select a TE trigger on the HT12E or a DATA trigger
on the HT12A further enhances the application flexibility of the 212 series of encoders. The
HT12A additionally provides a 38kHz carrier for infrared systems.
4.4.4.1 FEATURES:
Operating voltage
2.4V~5V for the HT12A
2.4V~12V for the HT12E
Low power and high noise immunity CMOS technology
Low standby current: 0.1_A (typ.) at VDD=5V
HT12A with a 38kHz carrier for infrared transmission medium
Minimum transmission word
Four words for the HT12E
One word for the HT12A
Built-in oscillator needs only 5% resistor
Data code has positive polarity
Minimal external components
HT12A/E: 18-pin DIP/20-pin SOP package
4.4.4.2OPERATION:
Page 18 of 37
The 212 series of encoders begin a 4-word transmission cycle upon receipt of a
transmission enable (TE for the HT12E or D8~D11 for the HT12A, active low). This cycle will
repeat itself as long as the transmission enable (TE or D8~D11) is held low. Once the
transmission enable returns high the encoder output completes its final cycle and then stops.
Figure 4.6 Encoder/Decoder Circuits
4.4.4.3 INFORMATION WORD:
The device is in the latch mode (for use with the latch type of data
decoders). When the transmission enable is removed during a transmission, the DOUT pin
outputs a complete word and then stops. On the other hand, if L/MB=0 the device is in the
momentary mode (for use with the momentary type of data decoders) When the transmission
enable is removed during a transmission, the DOUT outputs a complete word and then adds 7
words all with the _1_ data code.
4.4.4.4 APPLICATIONS:
Page 19 of 37
• Burglar alarm system
• Smoke and fire alarm system
• Garage door controllers
• Car door controllers
• Car alarm system
• Security system
• Cordless telephones
• Other remote control systems
4.5 MOTOR DRIVER
4.5.1 INTRODUCTION:
Page 20 of 37
The Device is a monolithic integrated high voltage, high current four channel driver
designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays
solenoids, DC and stepping motors) and switching power transistors. To simplify use as two
bridges each pair of channels is equipped with an enable input. A separate supply input is
provided for the logic, allowing operation at a lower voltage and internal clamp diodes are
included.
The L293D is assembled in a 16 lead plastic package which has 4 center pins connected together
and used for heat sinking. The L293DD is assembled in a 20 lead surface mount which has 8
center pins connected together and used for heat sinking.
4.5.2 PIN DIAGRAM
Figure 4.7 Pin Diagram of Motor Driver
4.5.3 INTERNAL CIRCUIT OF L293D:
Page 21 of 37
Figure 4.8 Internal Circuit Diagram of Motor Driver
4.5.4 DESCRIPTION:
The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to
provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is
designed to provide bidirectional drive currents of up to
600-mA at voltages from 4.5 V to 36 V. Both devices 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.
All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a
Darlington transistor sink and a pseudo- Darlington source. Drivers are enabled in pairs, with
Page 22 of 37
drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4 EN. When an enable input
is high, the associated drivers are enabled, and their outputs are active and in phase with their
inputs. When the enable input is low, those drivers are disabled, and their outputs are off and in
the high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or
bridge) reversible drive suitable for solenoid or motor applications.
Direction Motor 1 Motor 2 Hex Value
Forward ON ON 0x0A
Reverse ON ON 0x05
Left – Forward OFF ON 0x02
Right – Forward ON OFF 0x08
Left – Reverse OFF ON 0x01
Right – Reverse ON OFF 0x04
Table 4.1 Values for the motor working
Page 23 of 37
SOFTWARE IMPLEMENTATION
CHAPTER 5
5.1 ATMEL AVR STUDIO
5.1.1. INTRODUCTION:
This provides information on the tools and the basic steps that are involved in using the C
programming language for the Atmel AVR microcontrollers. It is aimed at people who are new
to this family of microcontrollers. The Atmel STK500 development board and the ATMEGA16
chip are used ,however, it is easy to adapt the information given here for other AVR chips.
5.1.2. INSTALLING TOOLS FOR C PROGRAMMING
To work with the Atmel AVR microcontroller using the C programming language, you
will need two tools: AVR Studio and Win AVR. Both tools are free at the links given below.
• AVR Studio is an integrated development environment that includes an editor, the
assembler, HEX file downloader and a microcontroller emulator. AVR Studio setup file
and service packs are available at
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725
• Win AVR is for a GCC-based compiler for AVR. It appears in AVR Studio as a plug-
in. Win AVR also includes a program called Programmer’s Notepad that can be used to
edit and compile C programs, independently of AVR Studio. Win AVR setup file is
available at
http://winavr.sourceforge.net/
Installing these tools is easy: just download and run the setup files, and accept the default
installation options. Remember to install AVR Studio first before Win AVR.
Page 24 of 37
5.1.3 USING AVR STUDIO FOR C PROGRAMMING:
As an example, we will create a simple C program for the Atmel AVR that allows the
user to turn on one of the eight Light Emitting Diodes (LEDs) on the STK500 development
board, by pressing a switch. Next, you will be guided through four major stages:
• creating an AVR Studio project,
• compiling C code to HEX file,
• debugging C program using the simulator,
• downloading HEX file to the STK500 development board and running it.
5.1.3.1 CREATING AN AVR STUDIO PROJECT:
Perform the following steps to create a simple AVR Studio project.
• Start the AVR Studio program by selecting Start | Programs | Atmel AVR
Tools |AVR Studio.
• Select menu Project | New Project. In the dialog box that appears, select AVR
GCC as project type, and specify the project name and project location. If options ‘Create
initial file’ and ‘Create folder’ are selected, an empty C file and containing folder will be
created for you.
• Click button Next when you are ready.
• In the ‘Select debug platform and device’ dialog that appears, choose ‘AVR
Simulator’ as the debug platform and ‘ATMEGA16’ as the device. Click button Finish.
• A project file will be created and AVR Studio displays an empty file. Enter the
C code. It is not important to understand the code at this stage, but you can do that by
reading the C comments.
• Click menu Project | Save Project to save the project file and the C program.
AVR Studio project files have extension ‘aps’.
Page 25 of 37
5.1.3.2 COMPILING C CODE TO HEX FILE:
• Click menu Build | Rebuild All to compile the C code.
• If there is no error message, a file called led.hex will be produced This file
contains the machine code that is ready to be downloaded to the ATMEGA16
microcontroller. The file is stored in sub-folder ‘\default’ of your project.
• If there are error messages, check your C code. Most often, they are caused by
some types or syntax errors.
5.1.3.3 DEBUGGING C PROGRAM USING THE SIMULATOR:
Debugging is an essential aspect in any type of programming. This section will show you
how to debug a C program at source-code level, using AVR Studio. You can execute a C
program one line at a time, and observe the effects on the CPU registers, IO ports and memory.
This is possible because AVR Studio provides a simulator for many AVR microcontrollers,
including the
ATMEGA16 and ATMEGA8515. Therefore, this debugging does not require the STK500 kit.
We will continue with the example project led.aps created in Section 3.2 of this tutorial.
• AVR Studio lets you examine the contents of CPU registers and IO ports. To
enable these views, right click on the menu bar at the top and select ‘I/O’ and ‘Processor’
options.
• Select menu Debug | Start Debugging. A yellow arrow will appear in the code
window, it indicates the C instruction to be executed next.
• Select menu Debug | Step Into (or press hot-key F11) to execute the C
instruction at the yellow arrow. Figure 6c shows the IO view after the following C
instruction is executed:
DDRB = 0xFF; // set PORTB for output
We can see that Port B Data Direction Register (DDRB) has been changed to 0xFF.
• While debugging the C program, you can change the contents of a register. For
example, to change Port A Input Pins register (PINA), click on the value column of PINA
Page 26 of 37
and enter a new value (Figure 8a). This change takes effect immediately. Subsequently,
the contents of PORTB will be 0x04 (see Figure 8b) after running the two C instructions:
i = PINA;
PORTB = i;
• To monitor a C variable, select the variable name in the code window and click
menu Debug | Quick Watch. The variable will be added to a watch window, as in Figure
9.
• Many other debugging options are available in the Debug menu, such as running
up to a break point or stepping over a function or a loop. To view the assembly code
along with the C code, select menu View | Disassembler.
5.1.3.4 DOWNLOADING AND RUNNING HEX FILE ON AVR BOARD:
To perform the steps in this section, you will need a STK500 development board from
Atmel. The STK500 kit includes two AVR microcontroller chips: ATMEGA8515 and
ATMEGA16.
• The ATMEGA8515 is installed on the development board by the manufacturer.
• The ATMEGA16 is installed on all development boards in SECTE laboratories.
5.1.4 HARDWARE SETUP:
• Connect the SPRO3G jumper to the ISP6PIN jumper, using the supplied cable
in the STK500 kit. This is needed to program the ATMEGA16 chip.
• Connect the board with the PC using a serial cable. Note that the STK500C has
two RS232 connectors; we use only the connector marked with RS232 CTRL.
• Connect the SWITCHES jumper to PORTA jumper. This step is needed in our
example because we want to connect 8 switches on the development board to port A of
the microcontroller.
Page 27 of 37
• Connect the LEDS jumper to PORTB jumper. This step is needed in our
example because we want to connect 8 LEDs on the development board to port B of the
microcontroller.
• Connect the board with 12V DC power supply and turn the power switch ON.
5.1.5 DOWNLOADING AND RUNNING HEX FILE:
• In AVR Studio, select menu Tools | Program AVR | Connect.
• In the ‘Select AVR Programmer’ dialog box, choose ‘STK500 or AVRISP’ as
the platform and ‘Auto’ as Port (see Figure 11). Then click button Connect.
• Depending on the version of your AVR Studio, a message about firmware may
appear. For now, this message can be discarded by clicking button Cancel. In the future,
you may want to read this message carefully and perform the steps described there to
perform firmware update.
• The program will now run on the microcontroller
Page 28 of 37
CHAPTER-7
FLOW CHART
Page 29 of 37
Page 30 of 37
Page 31 of 37
Page 32 of 37
CHAPTER-7
ALGORITHM
Step 1: Start.
Step 2: Create a database of commands.
Step 3: Configure port settings.
Step 4: Check for input commands.
Step 5.a: Transmit the corresponding code generated to the microcontroller.
Step 5.b: Generate error codes in case of wrong command.
5 = word to long
6 = word to short
7 = no match
Step 6: Check for response of ultra sonic sensor.
Step 7.a: If ‘1’ stop and wait for command.
Step 7.b: if ‘0’ proceed for the same command.
Step 8: Switch command.
Step 9.a: if ‘1’ move forward.
Step 9.b: if ‘2’ move reverse.
Step 9.c: if ‘3’ move left.
Step 9.d: if ‘4’ move right.
Step 9.e: if ‘5’ move too short.
Step 9.f: if ‘6’ move too long.
Page 33 of 37
Step 9.g: if ‘7’ move not matched.
Step 9.h: if ‘8’ stop.
Step 10: Go to step 4.
Step 11: Stop.
Page 34 of 37
REFERENCES
[1] Jizhong Liu Jingjing Yao Hua Zhang , A Design of Wireless Intelligent Control System
for Service Robots 2011 Third International Conference on Measuring Technology and
Mechatronics Automation
[2] Jizhong Liu , A Novel Economical Embedded Multi-mode Intelligent Control System
for Powered Wheelchair Computing, Control and Industrial Engineering (CCIE),
International Conference on 2010
[3] Min Wang, Sunplus 16-bit microcontroller experiments andexercises. Beijing:
Publishing house of Beijing Aeronautic and Astronautic University, 2007.(in Chinese)
[4] Zhi Wei Hang, The Design of Wireless digital transmission circuit.Beijing: Publishing
house of electronic industry, 2003. (in Chinese)
[5] Li zheng , The Program Designing of Visual C + + 6. 0. Beijing: Publishing house of
Tsinghua University, 2006. (in Chinese)
[6] Q. Zhu, “Structural pyramids for representing and locating moving obstacles in visual
guidance of navigation,” in IEEE Comput. Society Conf. Comput. Vis. Pattern Recog., Ann
Arbor, MI, 1988, pp. 832–837.
Page 35 of 37
[7] P. R. Wurman, R. D’Andrea, and M. Mountz, “Coordinating hundreds of cooperative,
autonomous vehicles in warehouses,” AI Magazine, vol. 29, no. 1, pp. 9–19, 2008.
[8] T. A. Tamba, B. Hong, and K.-S. Hong, “A path following control of an unmanned
autonomous forklift,” Int’l J. of Control, Automation and Systems, vol. 7, no. 1, pp. 113–
122, 2009.
[9] R. Cucchiara, M. Piccardi, and A. Prati, “Focus-based feature extraction for pallets
recognition,” in Proc. British Machine Vision Conf., 2000.
[10] G.Bauzil, M.Briot and P.Ribes, “A navigation sub-system using ultrasonic sensors
Formobile robot HILARE,” in Proc. 1st Int. Conf. Robot Vision And Sensory Controls,
Apr. 1981, Stratford upon-Avon, UK, pp, 47-58 and pp.681-698.
Page 36 of 37
CONCLUSION
In the present work we have designed a speech recognized obstacle detection
robot using mike, microcontroller unit(MCU), motor interfacing circuit ,amplitude shift keying
module (ASK) and ultrasonic sensor. This is a person depended system. It will recognizes the
following speech commands forward, reverse, left, right, left-reverse, right – reverse and the
MCU sends the corresponding control signals to actuate the robot through proper interface to
carry out the necessary action. The system also incorporates the obstacle monitoring system that
has been achieved using ultra sonic sensor and MCU. The present work involves hardware and
software design. This system is cost effective and simply. The presence work has a lot of future
scope with suitable modification can be employed in varies industrial applications that are
hazardous to the human beings.
Page 37 of 37