Upload
gopi-krishna
View
218
Download
0
Embed Size (px)
Citation preview
8/2/2019 Go Pi
1/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 1
CHAPTER 1
INTRODUCTION
This chapter gives a brief introduction about the methodology and scope of the
project. It also outlines the organization of the report.
1.1 PREAMBLE:
There are several situations where a person requires wireless control of robot, such as
in mining, military applications, spying and for space researching. When required in large
units, this can be fulfilled using a satellite based station. But for smaller cases a localized
controlling system becomes very much essential.
Our project aims to creating such a localized controlling system, which controls the
robot within the specified range.
1.2 STATEMENT OF PROBLEM:
In this project we are developing a small working model which controls the motion ofa robot wirelessly. The robot should work according to the signals received from the Personal
Computer and it should also send video signal if any obstacle found in the path of the robot
motion within the predefined area.
8/2/2019 Go Pi
2/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 2
1.3 OVERVIEW OF THE PROJECT
Fig 1.1: Personal Computer side
Fig 1.2: Robot side
PERSONALCOMPUTER
PARALLELPORT
INTERFACE
AUDIO AND
VIDEORECIEVER
ENCODER
Signal
Transmitter
circuit
RECEIVING ANTENNA
TRANSMITTING ANTENNA
MICROCONTROLLER
DECODER MOTOR CONTROLLEDDRIVER
LASER DRIVER
MOTOR1
MOTOR
2
RECEIVINGANTENNA
MOTORCONTROLLED
DRIVER
STEPPER
MOTOR
8/2/2019 Go Pi
3/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 3
The system basically has two blocks.
1. RF transmitter interfaced to Personal Computer Parallel port , as shown in fig 1.1.
2. Robot block with RF receiver and motor driver circuit as shown in fig 1.2.
The robot motion is controlled within a pre defined area by using a Personal computer
keyboard. Any change in the position of the robot will viewed in Personal computer using
the wireless webcam, according to that video Personal computer keyboard and RF transmitter
& receiver modules present in the robot provides the robot new position.
The robots brain i.e., the microcontroller, controls the gear motors and the stepper
motor which controls the robot motion and webcam & laser gun motion respectively.
Wireless webcam will detect enemies if any, laser gun is triggered by microcontroller via pc
keyboard to shoot the enemy. The chain wheel mechanism helps to tackle small obstacles
easily as well as to move in the rough terrain.
1.4 METHODOLOGY
We started of with developing a robot which resembles a vehicle in its working.
Our project is being developed under two modules: one module builds the hardware
requirement and another takes care of software part.
1.5 SCOPE OF THE STUDY
Main aim of this project is to creating localized controlling system,which
controls the bot for desired range. The bot should work according to the signals
received from the Personal Computer means a bot which is controlled by the
computer. There is a camera mounted on the bot and constantly sending the videos.
Video will be displayed on the computer screen. Accordingly we will take decision.
8/2/2019 Go Pi
4/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 4
CHAPTER 2
THEORETICAL BACKGROUND
This chapter gives an overview of various concepts, technologies, mechanisms and
tools used in this project.
2.1 EMBEDDED SYSTEMS
Embedded systems are the electronic devices that incorporate microcontroller within
their implementation. The main purpose of the micro controller is to simplify system design
and provide flexibility. Unlike Personal Computers, however, embedded systems may not
have the disc drives and so the software is often stored in read only memory; this means that
modifying the software requires either replacing or reprogramming the ROM.
Many embedded systems have to run 24 hours a day, 7 days a week, and 365 days an
year. It can't just reboot when something goes wrong. For this reason good coding practice
and through testing on new level of importance is essential in the realm of embedded
processor.
The embedded system found in most consumer products employs a single chip
controller that includes the microcontroller, a limited amount of memory and a few input
output devices. The power forthe microcontroller is usually similar to those found in earlier
personal computers.
When a desktop application program is executed, its executable images are loaded from the
disk into the memory by a part of the operating system known as the loader. The operating
system itselfis already in memory; put there doing the boot process. Unlike general purpose
desktop systems; embedded systems are designed to solve a single purpose. Once the
embedded software is in the memory, there is usually no reason to change it. This allows less
expensive ROM to be used for permanent storage of the programs . Since there is no need to
store the program on the disk, a significant amount of software can be eliminated that can be
necessary to support the file system.
8/2/2019 Go Pi
5/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 5
2.2 INTRODUCTION TO AVR STUDIO
AVR Studio is an Integrated Development Environment for writing and
debugging AVR applications in Windows 98/XP/ME/2000 and Windows NTenvironments.
AVR Studio provides a project management tool, source file editor and chip simulator.
It also interfaces with In-Circuit.
Emulators and development boards available for the AVR 8-bit RISC family of
microcontrollers. Simplifying the development tasks, AVR Studio allows customers to
significantly reduce time-to-market.
2.2.1 Features of AVR Studio
1. Integrated Development Environment for Writing, Compiling and DebuggingSoftware.
2. Fully Symbolic Source-level Debugger.3. Configurable Memory Views, Including SRAM, EEPROM, Flash, Registers,
and I/Os.4. Configurable Memory Views, Including SRAM, EEPROM, Flash, Registers,
and I/Os.
5. Unlimited Number of Break Points.
6. Online HTML Help.7. Variable Watch/Edit Window with Drag-and-drop Function.8. Extensive Program Flow Control Options.9. Simulator Port Activity Logging and Pin Input Stimuli.10.Support for C, Pascal, BASIC and Assembly Language.
11.File Parser Support for COFF, UBROF6, UBROF8, and Hex Files.
2.3 Introduction to AVR GCC (WinAVR)
The AVR GCC plug-in is a GUI front-end to GNU make and avr-gcc. Theplug-in requires GNU make and avr-gcc for basic operations and avr-objdump from
the AVR GNU binutils for generating list files.
The plug-in component will automatically detect an installed WinAVR
distribution and set up the required tools accordingly. An AVR GCC plug-in project is
a collection of source files and configurations. A configuration is a set of options that
specify how to build and link the files in a project. On creating a new project, the
"default" configuration is created. A user can choose to continue using this
configuration, adding/removing options as the project evolves or create one or more
new configurations to use in the project.
8/2/2019 Go Pi
6/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 6
2.3.1 WinAVR Features
Integration of avr-gcc and Make in AVR StudioStart the compiler, clean the project, set project options and debug the
project from AVR Studio. Tools from the WinAVR distribution are detected bythe plug-in.
GUI Controls to Manipulate Project SettingsCustom compile options can be set for specific files or all files in the
project. Linker options can also be set. There are controls for optimization
level, include directories, libraries, memory segments and more.
A Project Tree for Managing Project FilesA project tree provides easy access to and manipulation of every file in
the project.
Work with Several ConfigurationsIt is possible to define several sets of build options, called
configurations.
Build OutputA build output view shows raw output from GNU make and avr-gcc.
Error and warning messages that contain reference to a file and line can be
double-clicked to open this file and put a marker on the line.
External MakefileThe plug-in allows the user to define a makefile to use for the build
process.
Map and List FilesMap and list files can be generated on each build.
External DependenciesThe plug-in keeps track of dependencies on libraries and header files
that are not part of a project.
2.4 ISP PROGRAMMER
In System Programming, ISP is a way to seriallyprogram yourmicrocontroller, while it resides in its place, in other words, without removing the chip
from your board. Whether you're just starting in the ATMEL microcontrollers, or
you're familiar with it, ISP (In System Programming) will provide you a simple and
affordable home made solution to program and debug your microcontroller based
project. Sometimes, ISP can become very useful, when adjusting some delays,
frequencies or any other values that you would intend to find by trial and error. A
process that would otherwise take too much time.
8/2/2019 Go Pi
7/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 7
CHAPTER 3
DESIGN AND IMPLEMENTATION
3.1 INTRODUCTION
This chapter presents our design as well as reasons to why we made the engineering
choices that we encountered. Each section details the architecture of our designs. Components
used in the design are presented along with reasons to why these are selected.
3.2 MICROCONTROLLER
The ATmega16 microcontroller used is a 40-pin wide DIP (Dual In Line) package
chip. This chip was selected because it is robust and DIP package interfaces with prototyping
supplies like solderless breadboards and solder-type perf boards. Fig3.1 below shows the pin-
out diagram of the ATmega16.This diagram is very useful, because it tells you where power
and ground should be connected, which pins tie to which functional hardware, etc. The
ATmega16 is a low-power, high-performance 8-bit microcontroller with 16K bytes In-system
programmable Flash. The Atmel ATmega16 is a powerful microcomputer which provides a
highly flexible and cost effective solution to many embedded control applications.
The ATmega16 provides the following standard features.
High-performance, Low-power AVR 8-bit Microcontroller.
Advanced RISC Architecture
131 Powerful InstructionsMost Single-clock Cycle Execution.
32 x 8 General Purpose Working Registers.
Fully Static Operation.
Up to 16 MIPS Throughput at 16 MHz.
On-chip 2-cycle Multiplier.
High Endurance Non-volatile Memory segments
16K Bytes of In-System Self-programmable Flash program memory.
512 Bytes EEPROM.
1K Byte Internal SRAM.Write/Erase Cycles: 10,000 Flash/100,000 EEPROM.
8/2/2019 Go Pi
8/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 8
Optional Boot Code Section with Independent Lock Bits In-System
Programming by On-chip Boot Program.
Programming Lock for Software Security.
JTAG (IEEE std. 1149.1 Compliant) Interface
Boundary-scan Capabilities According to the JTAG Standard.
Extensive On-chip Debug Support.
Programming of Flash, EEPROM, Fuses, and Lock Bits through the JTAG
Interface.
Peripheral Features
Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes
One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and
Capture Mode.
Real Time Counter with Separate Oscillator.
Four PWM Channels.
8-channel, 10-bit ADC.
8 Single-ended Channels
7 Differential Channels in TQFP Package Only
2 Differential Channels with Programmable Gain at 1x, 10x, or 200x
Byte-oriented Two-wire Serial Interface.
Programmable Serial USART.Master/Slave SPI Serial Interface.
Programmable Watchdog Timer with Separate On-chip Oscillator.
On-chip Analog Comparator.
Special Microcontroller Features
Power-on Reset and Programmable Brown-out Detection.
Internal Calibrated RC Oscillator.
External and Internal Interrupt Sources.
Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down,
Standby and Extended Standby.
I/O and Packages
32 Programmable I/O Lines
40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
Operating Voltages
4.5 - 5.5V for ATmega16L
Speed Grades
0 - 8 MHz for ATmega16L
8/2/2019 Go Pi
9/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 9
Power Consumption 1 MHz, 3V, and 25C for ATmega16L
Active: 1.1 mAIdle Mode: 0.35 mA
Power-down Mode: < 1 A
Fig 3.1
8/2/2019 Go Pi
10/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 10
Pin descriptions
VCC : Digital supply voltage.
GND : Ground.
Port A (PA7..PA0) : Port A serves as the analog inputs to the A/D Converter.
Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used.
Port pins can provide internal pull-up resistors (selected for each bit). The Port A
output buffers have symmetrical drive characteristics with both high sink and source
capability. When pins PA0 to PA7 are used as inputs and are externally pulled low,
they will source current if the internal pull-up resistors are activated. The Port A pins
are tri-stated when a reset condition becomes active, even if the clock is not running.
Port B (PB7..PB0) : Port B is an 8-bit bi-directional I/O port with internal pull-upresistors (selected for each bit). The Port B output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port B pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port B pins are tri-stated when a reset condition becomes active, even if the clock is
not running. Port B also serves the functions of various special features of the
ATmega16.
Port C (PC7..PC0) : Port C is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port C output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port C pins that
are externally pulled low will source current if the pull-up resistors are activated. ThePort C pins are tri-stated when a reset condition becomes active, even if the clock is
not running. If the JTAG interface is enabled, the pull-up resistors on pins PC5(TDI),
PC3(TMS) and PC2(TCK) will be activated even if a reset occurs.
Port D (PD7..PD0) : Port D is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port D output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port D pins that
are externally pulled low will source current if the pull-up resistors are activated. The
Port D pins are tri-stated when a reset condition becomes active, even if the clock is
not running.
RESET : Reset Input. A low level on this pin for longer than the minimum pulse
length will generate a reset, even if the clock is not running. The Shorter pulses are not
guaranteed to generate a reset.
XTAL1 : Input to the inverting Oscillator amplifier and input to the internal clock
operating circuit.
XTAL2 : Output from the inverting Oscillator amplifier.
AVCC : AVCC is the supply voltage pin for Port A and the A/D Converter. It should
be externally connected to VCC, even if the ADC is not used. If the ADC is used, it
should be connected to VCC through a low-pass filter.
8/2/2019 Go Pi
11/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 11
AREF : AREF is the analog reference pin for the A/D Converter.
Fig3.1.1 Internal diagram
8/2/2019 Go Pi
12/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 12
3.3 CONTROL TRANSMITTER AND ENCODER
Fig 3.2: Transmission module
The serial data coming out of the encoder is given as data input to RF transmitter
TLP433, which converts the electrical signals into radio frequency signals and transmits them
wirelessly. This module has an approximate RF link range of 75ft.
The block diagram of HT12E encoder is as shown in fig 3.2. This is a CMOS LSI
used for remote 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 ofthe
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 further enhances the application flexibility of this encoder.
Data
8/2/2019 Go Pi
13/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 13
Fig 3.3: Block diagram of Encoder HT12E
As a whole this phase generates and transmits the control signals, which control the
operation ofrobot.
3.4 CONTROL RECEIVER AND DECODER
Fig 3.4: Receiver module
The signal radiated by the control transmitter (TLP433) is received by the control
receiver (RLP433). From this section data is given as input to the decoder HT12D, which
8/2/2019 Go Pi
14/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 14
converts the incoming serial data into 4 bit parallel data.
The HT12D is a CMOS LSI used for remote control system applications. This is
paired with HT12E encoder .For proper operation, a pair of Encoder/decoder with the same
number of addresses and data format should be chosen. The decoder receives serial addresses
and data from HT12E encoder that is transmitted by a carrier using an RF medium. They
compare the serial input data three times continuously with their local addresses. If no error or
unmatched codes are found, the input data codes are decoded and then transferred to the
output pins. The VT pin also goes high to indicate a valid transmission. The HT12D is
arranged to provide 8 address bits and 4 data bits. The block diagram of decoder HT12D is as
shown in Fig 3.5.
Fig 3.5: Block diagram of Decoder HT12D
8/2/2019 Go Pi
15/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 15
3.5 THE DC MOTOR DRIVER
Fig 3.6: Circuit diagram of Motor Driver L293D
The motor control signals coming from the microcontroller are given to the motor driver. We
have chosen L293D motor driver chip because it is simple to interface to and can control up to
two amps of current at variety of voltages to motors, relays, or other magnetic equipments.
For straight line motion, the motor driver drives both the motors in same direction.
Whereas in case of rotation the motors are excited in different direction according to the
requirement.
8/2/2019 Go Pi
16/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 16
The detailed block diagram of L293D motor driver is as shown in fig 3.7.
Fig 3.7: Block diagram of L293D Motor driver
The L293D can be used to control motors in an "H" bridge configuration (Fig 3.7) by
wiring two power leads to each half of the chip. The L293D has a few features that make it
very desirable for motor control.
The first and probably the most important feature is that each of the four drivers have
clamping diodes to suppress back EMF when the motors are turned off. This is important
because all magnetic devices produce a large voltage spike when the drivers are turned off.This spike is caused by the collapsing magnetic field when the current is turned off. A diode
should be placed across the coil to prevent this back EMF from disturbing or damaging any
local electronic components. Another feature of the L293D is the enable line for each ofthe
drivers. This line can be used to implement a pulse width modulation (PWM) speed control
for the motors without having to change the driver controls.
8/2/2019 Go Pi
17/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 17
The last feature is the wide range of voltages that the chip can pass along through the
drivers. For high current applications, the board that is mounted on should be designed with a
large, heat sinking flood area around the L293D's ground pins. This flood area will give the
chip some additional copper to allow current induced heat to be radiated away.
Fig 3.8: H-Bridge
3.5.1 THE DC MOTOR
Fig 3.9: DC Motor
8/2/2019 Go Pi
18/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 18
The most common actuator which we are using (and the most common in mobile
robotics in general) is the direct current (DC) motor. It is simple, cheap, and easy to use.
Also, it comes in a great variety of sizes, to accommodate different robots and tasks.
DC motors convert electrical energy into mechanical energy. They consist of
permanent magnets and loops ofwire inside. When current is applied, the wire loops generate
a magnetic field, which reacts against the outside field of the static magnets. The interactions
of the fields produce the movement of the shaft/armature. Thus, electromagnetic energy
becomes motion. As with any physical system, DC motors are not perfectly efficient,
meaning that the energy is not converted perfectly, without any waste. Some energy is wasted
as heat generated by mechanical parts. A motor requires a power source within its operatingvoltage, i.e., the recommended voltage range for best efficiency of the motor. Lower voltages
will usually turn on the motor but provide less power. Higher voltages in some cases can
increase the power output but almost always at the expense ofthe operating life of the motor.
When constant voltage is applied, a DC motor draws a current in the amount proportional to
the work it is doing. For example, if a robot is pushing against a wall, it is drawing more
current (and draining more ofits batteries) than when it is moving freely in open space.
The reason for the above fact is the resistance to the motor introduced by the wall. If
the resistance is very high (i.e. the wall just wont move no matter how much the robot
pushes against it), the motor draws a maximum amount ofpower and stalls. This is defined as
the stall current of the motor: the most current it can draw at its specified voltage. Within a
motor's operating current range, the more current is used, the more torque or the more
rotational force is produced at the shaft. Besides stall current, a motor also has its stall torque,
the amount of rotational force produced when the motor' is stalled at its operating voltage.
Finally, the amount of power a motor generates is the product of its shaft's rotational velocity
and its torque. If there is no load on the shaft, i.e. the motor is spinning freely, then the
rotational velocity is the highest, but the torque is zero, since no mechanism is driven by the
motor. The output power then is zero also. In contrast, when the motor is stalled, it is
producing maximum torque, but the rotational velocity is zero. So the output power is zero
again.
8/2/2019 Go Pi
19/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 19
3.6 STEPPER MOTOR DRIVER
Fig 3.10
The L293D contains two H-bridges for driving small DC motors. It can also be used to
drive stepper motors because stepper motors are, in fact, two(or more) coils being driven in a
sequence, backwards and forwards. One L293D can, in theory, drive one bi-polar 2 phase
stepper motor, if you supply the correct sequence.
We are going to show how to drive a bipolar and a unipolar stepper motor with the L293D.
3.6 degrees/step motors.
3.6.1 Bipolar Stepper Motor
The L293D chip has 16 pins. Here is how each of the pins should be connected:
Pin 1, 9 Enable pins. Hook them together and you can either keep them high and run the
motor all the time, or you can control them with you own controller(e.g. 68HC11).
Pin 3, 6, 11, 14 Here is where you plug in the two coils. To tell which wires correspond to
each coil, you can use a mulitmeter to measure the resistance between the wires. The wires
correspond to the same coil has a much lower resistance than wires correspond to different
8/2/2019 Go Pi
20/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 20
coils. (This method only applies to bipolar stepper motors. For unipolar stepper motors, you
have to refer to the spec. sheet to tell which wires correspond to each coil.) You can then get
one coil hooked up to pin 3,6 and another one hooked up to pin 11, 14.
Pin 4, 5, 12, 13 Gets hooked to ground.
Pin 8 Motor voltage, for the motors we are using, it is 12V.
Pin 16 +5V. It is the power supply of the chip and it's a good idea to keep this power supply
separate from your motor power.
Pin 2, 7, 10, 15 Control signals. Here is where you supply the pulse sequence. The following
is how you pulse them for a single-cycle (to move the motor in the opposite direction, just
reverse the steps. i.e. from step 4 to step1):
Coil 1a Coil 2a Coil 1b Coil 2b
Step 1 High High Low Low
Step 2 Low High High Low
Step 3 Low Low High High
Step 4 High Low Low High
In our example, we use the digital outputs of the Handy Board to generate the above pulse.
The SPI pins on the connector on the middle right edge of the Handy Board can be
configured as digital outputs. Do a poke(0x1009, 0x3c) to make them outputs; then they are
mapped o the middle 4 bits of address 0x1008 (SS= bit 5, SCK=bit 4, MOSI=bit 3, MISO=bit
2). Poke to that address (0x1008) to set them.
In the above code fragment, the variable x controls how much time the controller should wait
between each steps and this consequently determines the speed of the motor. The variable t
determines how many cycles controller should drive the motor and so this control the angular
position of the shaft.
8/2/2019 Go Pi
21/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 21
3.6.2 Unipolar Stepper Motor
Driving a unipolar stepper motor with the L293D is very similar to driving a bipolar stepper
motor. The pulse sequence is the same and you can use the code fragment above to generate
the pulse sequence. The only difference between driving a unipolar stepper motor and driving
a bipolar stepper motor is that there is an extra wire in a unipolar stepper motor you have to
hook up. You can hook it up to the +5V supply and the wires are hooked up in the same way
as those in the bipolar stepper motor.
3.7 WHEEL SELECTION
There are four wheels attached to the DC motors and a pair of chain belts to facilitate
easy movement of Robot. The chain belts can overcome tough terrain, or build a conveyor
belt for scooping up objects.
Climb over obstacles.
Traverse tough terrain.
Drive through sandy or soft spongy surfaces.
Can be used for a robot conveyor belt.
Tank treads will enable your robot to explore much more demanding terrain than ordinary
wheels. Tank treads distribute a vehicles weight more evenly than wheels, allowing your
robot to move more easily in sand or on soft, spongy surfaces into which wheels would sink
and bog down. This increased surface area also gives your robot more traction for haulingheavy loads up an incline. And because each link can grip the surface over which its
travelling, a robot with tank treads can more easily climb obstacles or traverse crevasses in
which wheels would get stuck.
8/2/2019 Go Pi
22/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 22
3.8 POWER SUPPLY
Fig 3.11: Power supply
These regulators can provide local on-card regulation, eliminating the distribution
problems associated with single point regulation. Each type employs internal current limiting,
thermal shut-down and safe area protection, making it essentially indestructible. If adequate
heat sinking is provided, they can deliver over 1A output current. Although designed
8/2/2019 Go Pi
23/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 23
primarily as fixed voltage regulators, these devices can be used with external components to
obtain adjustable voltage and currents.
The main supply is suitably converted into 5V DC supply using regulators and then
given to microcontroller,which is as shown in Fig 3.11.
3.9 THE PARALLEL PORT
The Personal Computer supports up to three parallel ports that are assigned the labels
LPTI, LPT2, and LPT3. You can use any of these standard ports as long as they use the usual
base addresses, which are (in hex) 378, 278, and 3BC, respectively. The port labels and
addresses are typically configured through the Personal Computers BIOS .Additional ports,
or standard ports not assigned the usual base addresses, are not accessible by the toolbox
3.9.1 Parallel Port Characteristics:
The parallel port consists of eight data lines, four control lines, five status lines, and
eight ground lines. In normal usage, the lines are controlled by the host computer software
and the peripheral device following a protocol such as IEEE Standard 1284-1994. The
protocol defines procedures for transferring data such as handshaking, returning status
information, and so on. However, the toolbox uses the parallel port as a basic digital I/O
device, and no protocol is needed. Therefore, you can use the port to input and output digital
values just as you would with a typical DIO subsystem.
To access the physical parallel port lines, most PCs come equipped with one 25-pin
female connector, which is shown below.
Fig 3.12: DB 25 female connector
8/2/2019 Go Pi
24/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 24
The lines use TTL logic levels. A line is high (true or asserted) when it is a TTL high
level, while a line is low (false or unasserted) when it is a TTL low level. The exceptions are
lines 1, 11, 14, and 17, which are hardware inverted.
The toolbox groups the 17 nonground lines into three separate ports. The port IDs and
the associated pin numbers are given below
Port ID Pins Description
0 2-9 Eight I/O lines, with pin 9 being the most significant bit
(MSB).
1 10-13, and 15 Five input lines used for status
2 1, 14, 16, and 17 Four I/O lines used for control
3.10 PERSONAL COMPUTER PARALLEL PORT CONNECTIONS
Fig 3.13: Connection to Personal Computer parallel port
TE
CONTROL DATA
8/2/2019 Go Pi
25/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 25
The connection to Personal Computer parallel port is as shown in fig 3.13. The
control data is the data inputs to the transmitter section. The data inputs are encoded using
HT12E and then transmitted through TLP433 MHz.
3.11 PERSONAL COMPUTER CONTROLLING SYSTEM
This section describes the process of transmission and reception of control signals from
Personal computer to Microcontroller and vice-versa. The related circuit diagram is as shown in Fig
3.14.
The control data coming from Personal Computer is transmitted as radio signal using the
radio transmitter TLP433. Before that the 8-bit parallel data is converted into serial data using the
encoder HT12E. The obstacle detected signal from robot is received by receiver RLP433 and
is decoded by the decoder HT12D. The interrupt VT INTR generated by decoder is given as
input to one of the pin of parallel port.
Fig 3.14: Personal Computer side circuitry
8/2/2019 Go Pi
26/27
SPY BOT
Dept. of ECE, JNNCE, Shimoga Page 26
3.14 SYSTEM SOFTWARE
Every embedded system is incomplete without its software, so is ours. This chapter
includes flow charts which describes the working of both hardware and software modules.
We have used Avr studio assembly language for programming purpose. 16K flash memory of
Atmega16 is used to store the program and Tutbo C is used for controlling the robot.
Flow Chart 1: Personal Computer Side
Start
Initialize Turbo C
and execute code
Is button
pressed?
N
Transmit the
corresponding data
Is obstacle
found ?
Control Spy Bot
N
Y
Y
8/2/2019 Go Pi
27/27
SPY BOT