GPS Project
GPS Project
GPS Project
Chapter 1
INTRODUCTION
The development of GPS based systems play an important role in the building of automatic navigational vehicle. Since it can provide the required positioning and navigational information quickly, with great accuracy and at a low cost, waypoint navigation becomes very efficient to implement. We have built our project around the above principles. We have constructed an automatic (unmanned) navigational vehicle, which uses the co-ordinates obtained from the GPS receiver (using the GPS satellites), and travels to the desired locations. The data from the GPS receiver is obtained in the form of NMEA (National Marine Electronics Association) codes. These codes give the latitude, longitude, time, date, almanac data etc. Due to this, finding the path becomes much simpler as we can program the vehicle to move either in the north-south direction or east-west direction, as required. As we have also interfaced the vehicle with a wireless video camera, the area in which the vehicle is moving can be surveyed by transmitting the real time images to the base station instantly. Thus, the base station receives a continuous stream of data of two varieties. Firstly, this decoded data from the GPS receiver. Secondly, the continuous live video feed from the wireless camera on the vehicle. This system is developed for reconnaissance of a given area where, for some reason, human presence is unwelcome. Thus, this would be very useful for surveying and analysing such areas with remote accessibility.
Wireless Receiver
Wireless Transmitter
Antenna
Microcontrolle r
Fig. 1.1
Block Diagram
2
Moving Vehicle
GPS Receiver
under survey instantly to the base station where they can be analysed or stored for future use.
Chapter 2
Fig. 2.1
Chapter 3
This led to the development of Global Positioning System; initially the highest quality signal was reserved for military use, while the signal available for civilian use was intentionally degraded ("Selective Availability", SA). After Korean Air Lines Flight 007 was shot down in 1983 after straying into the USSR's prohibited airspace, President Ronald Reagan issued a directive making GPS freely available for civilian use as a common good. Selective Availability was ended in 2000, improving the precision of civilian GPS from about 100m to about 20m.
Space segment - satellites orbiting the Earth; Control segment - Control and monitoring stations on Earth; and User segment - The GPS receivers owned by users
GPS satellites broadcast signals from space that are picked up and identified by GPS receivers. Each GPS receiver then provides threedimensional location (latitude, longitude, and altitude) plus the time.
space as to be known 5. The last step is the correction of errors and delays the signal undergoes as it travels through the atmosphere
3.3.1
In order to explain the principle of triangulation, we take the following example of how GPS satellites fix the location of a given point. There are three basic steps in this method: Step 1:
Fig. 3.1
Triangulation Step 1
Knowing distance from one satellite places you somewhere on a spherical surface that's centered around the satellite. Here, let us assume this distance to be 11,000 miles. Step 2:
Fig. 3.2
Triangulation Step 2
Knowing distances from two satellites places you somewhere along a circle that's between the two satellites (defined by the intersection of their "distance spheres")
Step 3:
Fig.3.3
Triangulation Step 3
Distances from three satellites usually intersect at two points, and if we take the Earth's surface as the fourth sphere, this narrows it down to a single point. This process works by finding the intersection of your distances from three or more satellites. Thus, describing it as "trilateration" is actually better than "triangulation", but neither term seems precisely correct from a technical standpoint.
transmitted by the satellite. A data bit frame consists of 1500 bits divided into five 300-bit subframes. A data frame is transmitted every thirty seconds. Three six-second subframes contain orbital and clock data. Satellite vehicle (SV) Clock corrections are sent in subframe one and precise SV orbital data sets (ephemeris data parameters) for the transmitting SV are sent in subframes two and three. Subframes four and five are used to transmit different pages of system data. An entire set of twenty-five frames (125 subframes) makes up the complete Navigation Message that is sent over a 12.5 minute period. Data frames (1500 bits) are sent every thirty seconds. Each frame consists of five subframes. Data bit subframes (300 bits transmitted over six seconds) contain parity bits that allow for data checking and limited error correction. Clock data parameters describe the satellite clock and its relationship to GPS time. Ephemeris data parameters describe satellite orbits for short sections of the satellite orbits. Normally, a receiver gathers new ephemeris data each hour, but can use old data for up to four hours without much error. The ephemeris parameters are used with an algorithm that computes the satellite position for any time within the period of the orbit described by the ephemeris parameter set. Almanacs are approximate orbital data parameters for all Satellites. The ten-parameter almanacs describe satellite orbits over extended periods of time (useful for months in some cases) and a set for all satellites is sent by each satellite over a period of 12.5 minutes (at least). Signal acquisition time on receiver start-up can be significantly aided by the availability of current almanacs. The approximate orbital data is used to preset the receiver with the approximate position and carrier Doppler frequency (the frequency shift caused by the rate of change in range to the moving satellite) of each satellite in the constellation.
Dept. of Electronics and Communication, Sir M. VIT 10
Each complete satellite data set includes an ionospheric model that is used in the receiver to approximate the phase delay through the ionosphere at any location and time. Each satellite sends the amount of data to which GPS Time is offset from Universal Coordinated Time (UTC). This correction can be used by the receiver to set UTC to within 100 ns. Other system parameters and flags are also sent, that characterize details of the system.
DATA
IS
RECEIVED
IN
THE
GPS
The GPS data is received in the NMEA code format. A few examples of NMEA code format are discussed below. E.g.: 1 $GPGLL Geographic Position, Latitude / Longitude and time. eg1. $GPGLL,3751.65,S,14507.36,E*77 eg2. $GPGLL,4916.45,N,12311.12,W,225444,A
4916.46,N
12311.12,W Longitude 123 deg. 11.12 min. West 225444 A Fix taken at 22:54:44 UTC Data valid
eg3. $GPGLL,5133.81,N,00042.25,W*75
Dept. of Electronics and Communication, Sir M. VIT 11
1 1 2 3 4 5
4 5
$--GLL,lll.ll,a,yyyyy.yy,a,hhmmss.ss,A llll.ll = Latitude of position a = N or S yyyyy.yy = Longitude of position a = E or W hhmmss.ss = UTC of position A = status: A = valid data E.g. :2 $GPGSV GPS Satellites in view e.g. $GPGSV,3,1,11,03,03,111,00,04,15,270,00,06,01,010,00,13,06,292,00* 74 $GPGSV,3,2,11,14,25,170,00,16,57,208,39,18,67,296,40,19,40,246, 00*74 $GPGSV,3,3,11,22,42,067,42,24,14,311,43,27,05,244,00,,,,*4D $GPGSV,1,1,13,02,02,213,,03,-3,000,,11,00,121,,14,13,172,05*67 1 2 = Total number of messages of this type in this cycle = Message number
12
3 4 5 6 7
= Total number of SVs in view = SV PRN number = Elevation in degrees, 90 maximum = Azimuth, degrees from true north, 000 to 359 = SNR, 00-99 dB (null when not tracking)
8-11 = Information about second SV, same as field 4-7 12-15= Information about third SV, same as field 4-7 16-19= Information about fourth SV, same as field 4-7
13
Before GPS signals reach your antenna on the earth, they pass through a zone of charged particles called the ionosphere, which changes the speed of the signal. If your reference and rover receivers are relatively close together, the effect of ionosphere tends to be minimal. And if you are working with the lower range of GPS precisions, the ionosphere is not a major consideration. 4. Troposphere - change in the travel time of the signal: Troposphere is essentially the weather zone of our atmosphere, and droplets of water vapour in it can affect the speed of the signals. The vertical component of your GPS answer (your elevation) is particularly sensitive to the troposphere. 5. Satellite Geometry - general distribution of the satellites: Satellite Geometry - or the distribution of satellites in the sky - effects the computation of your position. This is often referred to as Position Dilution of Precision (PDOP). PDOP is expressed as a number, where lower numbers are preferable to higher numbers. The best results are obtained when PDOP is less than about 7. PDOP is determined by your geographic location, the time of day you are working, and any site obstruction, which might block satellites. 6. Satellite Health - Availability of Signal: While the satellite system is robust and dependable, it is possible for the satellites to occasionally be unhealthy. A satellite broadcasts its health status, based on information from the U.S. Department of Defence. Your receivers have safeguards to protect against using data from unhealthy satellites. 7. Signal Strength - Quality of Signal : The strength of the satellite signal depends on obstructions and the elevation of the satellites above the horizon. To the extent it is possible, obstructions between your GPS antennae and the sky should
Dept. of Electronics and Communication, Sir M. VIT 14
be avoided. The satellites which are close to the horizon have weaker signals. 8. Radio Frequency (RF) Interference: RF interference may sometimes be a problem both for your GPS reception and your radio system. Some sources of RF interference include: Radio towers Transmitters Satellite dishes Generators
One should be particularly careful of sources which transmit either near the GPS frequencies (1227 and 1575 MHz) or near harmonics (multiples) of these frequencies. 9. Loss of Radio Transmission from Base: If, for any reason, there is an interruption in the radio link between a reference receiver and a rover, then your rover is left with an autonomous position. It is very important to set up a network of radios and repeaters, which can provide the uninterrupted radio link needed for the best GPS results.
15
Vehicle tracking, including in-car navigation, fleet tracking and public safety applications
Precise positioning, including bridge sections, mining machinery, construction and the general area of 'outdoor robotics
Mapping and GIS data capture, including in-field mapping, GIS data collection and GIS data update
Photogrammetry-is the first remote sensing technology ever developed, in which geometric properties about objects are determined from photographic images.
16
Chapter 4
P89v51RD2 MICROCONTROLLER
The P89v51RD2 is an 8bit, 80c51 compatible, 5v, low power microcontroller with 64kb flash and 1024bytes of data RAM. Its key features are ISP and X2 mode option. The user can choose to run the application either using conventional 80c51 clock rate (12 clocks per machine cycle) or X2 mode(6 clocks per machine cycle). By using X2 mode we can achieve twice the same throughput at the same clock frequency. Flash memory supports both parallel and in serial in-system programming (ISP). Parallel programming mode offers gangprogramming at high speeds, thereby reducing programming costs and time to market. Whereas, ISP on the other hand, allows a device to be reprogrammed in the end product under software control. It is also In-Application Programmable (IAP), allowing flash program memory to be reconfigured even while the application is running.
4.1 Features
80c51 central processing unit 5v operating voltage from 0 to 40Mhz 64 Kb of on-chip Flash program memory with ISP (InSystem Programming) and IAP (In-Application Programming)
SPI (Serial Peripheral Interface) and enhanced UART PCA (Programmable Counter Array) with PWM and
Capture/Compare functions
Dept. of Electronics and Communication, Sir M. VIT 17
Four 8-bit I/O ports with three high-current Port 1 pins (16 mA each)
Three 16-bit timers/counters Programmable Watchdog timer (WDT) Eight interrupt sources with four priority levels Second DPTR register TTL- and CMOS-compatible logic levels Low power modes Idle mode
Fig. 4.1
Fig. 4.2
Pin Diagram
19
20
4.4 SERIAL
PROGRAMMING
OF
THE
MICROCONTROLLER
In this section we discuss the serial communication registers of the P89v51RD2 and also show how to program them to transfer and receive data serially. To allow data transfer between the PC and the microcontroller without any error, we must make sure that the baud rate of the microcontroller system matches the baud rate of the PCs com port (baud rate is defined as the number of signal changes per second). In this project, we use the Rx pin of the microcontroller to receive data from the GPS Rx, and we use the Tx pin of the microcontroller to transmit data through the XBee module. SBUF Register It is an 8-bit register used solely for serial communication in the microcontroller. For a byte of data to be transferred via the TxD line, it must be placed in the SBUF register. Similarly, SBUF holds the byte of data when it is received by the microcontrollers RxD line. SCON Register The SCON is an 8-bit register used to program the start bit, stop bit and data bits of data framing, among other things.
21
Fig. 4.3
4.4.1
XTAL=11.0592MHz)
22
The SCON register is loaded with the value 50H, indicating serial mode1, where an 8-bit data is framed with the start and stop bits.
TR1 is set to start the Timer1. For receiving the data serially RI flag is cleared and the RI flag is monitored continuously to see if an entire character has been received yet. When the RI is raised, SBUF has the byte.
For transferring the data serially TI flag is cleared and the character byte to be transferred is written into the SBUF register. The TI flag is monitored to see if the character has been transferred completely.
23
Fig. 4.4
TCON register It is a bit-addressable register. The TR0 and TR1 flags which are used to turn on or off the timers are part of a register called TCON (timer control). This register is an 8-bit register. As shown in table the upper four bits are used to store the TF and TR bits of both Timer0 and Timer1. The lower four bits are set aside for controlling the interrupt bits.
24
Fig. 4.5
4.6 TIMER 2
Timer 2 is a 16-bit Timer/Counter which can operate as either an event timer or an event counter, as selected by C/T2 in the special function register T2CON.
25
Fig. 4.6
4.7
TIMER (ALGORITHM)
Load the TMOD register with a value indicating which timer (Timer0 or Timer1) is to be used and which timer mode (0 3) is selected.
Load registers TL and TH with initial count values. Start the timer. Keep monitoring the timer flag to see if it is raised. Get out of the loop when TF becomes high.
26
Clear the TF flag for the next round. Go back to step2 to load TH and TL again.
4.8 RESET
A system reset initializes the Microcontroller and begins program execution at program memory location 0000H. The reset input for the device is the RST pin (pin 9). In order to reset the device, a logic level high must be applied to the RST pin for at least two machine cycles (24 clocks), after the oscillator becomes stable. At initial power up, the port pins will be in a random state until the oscillator has started and the internal reset algorithm has weakly pulled all pins HIGH. Powering up the device without a valid reset could cause the MCU to start executing instructions from an indeterminate location. Such undefined states may inadvertently corrupt the code in the flash.
Fig. 4.7 Power-on Reset Circuit When power is applied to the device, the RST pin must be held HIGH long enough for the oscillator to start up (usually several milliseconds for a low frequency crystal), in addition to two machine cycles for a
Dept. of Electronics and Communication, Sir M. VIT 27
valid power-on reset. An example of a method to extend the RST signal is to implement a RC circuit by connecting the RST pin to VDD through a 10 F capacitor and to VSS through an 8.2 kresistor as shown in figure. Note that if an RC circuit is being used, provisions should be made to ensure the VDD rise time does not exceed 1 millisecond and the oscillator start-up time does not exceed 10 milliseconds. For a low frequency oscillator with slow start-up time the reset signal must be extended in order to account for the slow start-up time. This method maintains the necessary relationship between VDD and RST to avoid programming at an indeterminate location, which may cause corruption in the code of the flash.
28
PWM (CCAPM.1) enables the pulse width modulation mode. Enabling this we generate PWM signal which is of 2 kHz. All of the PCA modules can be used as PWM outputs (fig 4.4). Output frequency depends on the source for the PCA timer. All of the modules will have the same frequency of output because they all share one and only PCA timer. The duty cycle of each module is independently variable using the modules capture register CCAPnL.When the value of the PCA CL SFR is less than the value in the modules CCAPnL SFR the output will be low, when it is equal to or greater than the output will be high. When CL overflows from FF to 00, CCAPnL is reloaded with the value in CCAPnH. This allows updating the PWM without glitches. The PWM and ECOM bits in the modules CCAPMn register must be set to enable the PWM mode.
Fig. 4.8
4.10
29
This is the ability of some programmable logic devices (PLDs), microcontrollers and other programmable electronic chips to be programmed while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system. The primary advantage of this feature is that it allows manufacturers of electronic devices to integrate programming and testing into a single production phase, rather than requiring a separate programming stage prior to assembling the system. This ISP facility consists of a series of internal hardware resources coupled with internal firmware to facilitate remote programming of RD2 through the serial port. The ISP function uses five pins (Vdd, Vss, TxD, RxD, and RST). Only a small connector needs to be available to interface your application to an external circuit in order to use this application.
4.10.1
Fig. 4.9
30
4.10.2
FEATURES
Flash Magic is a Windows compatible software from the Embedded Systems Academy that allows easy access to all the ISP features provided by the NXP devices. These features include: Erasing the Flash memory (individual blocks or the whole device) Programming the Flash memory Modifying the Boot Vector and Status Byte Reading Flash memory Performing a blank check on a section of Flash memory Reading the signature bytes Reading and writing the security bits Direct load of a new baud rate (high speed
communications)
Flash Magic provides a clear and simple user interface to these features and more.
4.10.3
Select the desired COM port from the drop down list. Then select the required baud rate, device, interfacing mode and its operating frequency.
2. Erasing Select each Flash block that is to be erased by clicking on its name. If you wish to erase all the Flash then check that option. Otherwise, programs might overlap and output may not be right. If you wish to erase only the Flash blocks used by the hex file you are going to select, then check that option. 3. Selecting the HEX file You can either enter a path name in the text box or click on the Browse button to select a Hex File by browsing to it. Also you can choose Open from the File menu.
4. Options This section is optional, however Verify After Programming, Fill Unused Flash and Gen Block Checksums may only be used if a Hex File is selected (and therefore being programmed), as they all need to know either the Hex File contents or memory locations used by the Hex File. 5. Performing the operations Clicking the Start button will result in all the selected operations in the main window taking place. They will be in order: Erasing Flash Programming the Hex File Verifying the Hex File Filling Unused Flash Generating Checksums
32
Programming the clocks bit Programming the Security Bits Executing the firmware
33
Chapter 5
SERIAL COMMUNICATION
Serial communication is the process of sending data one bit at a time, sequentially over a communication channel or computer bus. Serial communication is used for all long-haul communication and most computer networks. There are two pins in the microcontroller which are used specifically for transferring and receiving data serially. These pins are called TxD and RxD and they form a part of port3 of microcontroller. They are TTL compatible. In our project, the GPS data from the receiver is given to the microcontroller serially to make the process easier and cheaper. This is done by using RS232 (also called DB connector), which is an interfacing standard set by the Electronics Industries Association. This RS232 mainly provides compatibility between the two communicating devices. As this standard was set before the advent of TTL logic family, its input and output voltage levels are not TTL compatible. In RS232, a 1 is represented by -3 to -25v, while a 0 bit is +3 to +25v, making -3 to +3v undefined. For this reason to connect any RS232 to a microcontroller system we must use voltage regulators such as MAX232 (line drivers) to convert TTL logic to RS232 voltage levels, and vice versa.
5.1 RS232
RS232 mainly provides compatibility between the two communicating devices. To ensure fast and reliable data transmission between two devices, data transfer must be coordinated. Many of the pins are used for handshaking signals.
34
FIG.5.1
35
5.1.1
PIN DESCRIPTION
DTR (data terminal ready): when the terminal is on (Or a PC COM port), then it will undergo self-test and then it will send DTR signal indicating that it is ready for communication. If there is something wrong then the signal will not be activated. Is an active-low signal which is used to inform the modem that the computer is working.
DSR (data set ready): When the modem is on and has gone through self-test then it asserts DSR indicating that it is ready for communication. It is an active-low signal. By chance the modem is unable to get connected to the telephone then this signal remains inactive indicating that it cannot accept or send data.
RTS (request to send): This is an active-low output signal sent by the comp when it wants to transmit data to the modem.
CTS (clear to send): This is a response to RTS sent by the modem when it has space for storing the data it is to receive requested, indicating that it can receive.
DCD (data carrier detect): the modem asserts this signal to inform the comp that a valid carrier has been detected and that contact between it and the other modem has been established.
RI (ring indicator): This signal indicates that telephone is ringing. It goes on and off in synchronization with the ringing sound. This the least used handshaking signal.
36
5.2.1
FEATURES
Operates Up To 120 kbit/s Two Drivers and Two Receivers 30-V Input Levels Low Supply Current . . . 8 mA Typical MAX232 has two sets of line drivers for transferring and receiving
37
Fig. 5.2
There are two sets of line drivers for transferring data (T1 and T2) and that for receiving data (R1 and R2). In most of the applications only one of each line driver is used. For example, say T1 and R1 are used together for TxD and RxD of the microcontroller and the other two pins T2 and R2 are left unused. Here the T1 line driver has the designation of T1in and T1out on pin numbers 11 and 14 respectively, the T1in pin is the TTL side and is connected to the TxD of microcontroller while T1out is the RS232 side i.e. connected to the RxD pin of RS232 DB connector. The R1 line driver has the designation of R1in and R1out on pin numbers 13 and 12 respectively. R1in is the RS232 side connected to the TxD of RS232 DB connector, and R1out is the TTL side that is connected to the RxD pin of microcontroller.
38
Table 5.1
Function Tables
5.2.2
ADVANTAGES
The main advantage of using the MAX232 is that it uses the +5V power source which is the same as the source voltage for the microcontroller. i.e. with the single +5V of power supply we can power both RD2 and MAX232.
5.2.3
APPLICATIONS
Chapter 6
XBee RF MODULES
The XBee/XBee-PRO ZB OEM RF Modules are designed to operate within the ZigBee protocol and support the unique needs of low-cost,
39
low-power wireless sensor networks. The modules require minimal power and provide reliable delivery of data between remote devices. Fig. 6.1 XBee Chip
The modules operate within the ISM 2.4 GHz frequency band
6.1 FEATURES
High Performance, Low Cost Indoor/Urban: up to 300 (100 m) Outdoor line-of-sight: up to 1 mile (1.6 km), with high-gain antenna
Transmit Power Output: 100 mW (20 dBm) EIRP Receiver Sensitivity: -102 dBmRF Data Rate: 250,000 bps Low Power XBee-PRO TX Current: 295 mA (@3.3 V) RX Current: 45 mA (@3.3 V) Power-down Current: < 1 A @ 25oC
The normal version has a range of 100 feet indoors, and 300 feet outdoors (clear line of sight). The Pro version has a range of 300 feet indoors, and 1 mile outdoors (clear line of sight). The Pro version also consumes a bit more power than the normal version.
module which sends that data wirelessly to another XBee module, also presumably connected to a Make Controller, which can then read the data from the serial port. So, it's like a big, wireless serial connection between the two Make Controllers, hence the name. Clever, eh?
2. Packet mode. If you want to actually send messages to the
XBee module itself, however, you need a way to distinguish that from data that should be sent transparently. There are a few different kinds of packets, but we'll most concern ourselves here with IO packets and command packets. IO packets are what an XBee module sends when it has sampled its inputs. Command packets are used to set some configuration option for the module itself. Packet mode is nice because then we get to see a bunch of important information about each packet - who it came from, the signal strength, and things like that.
41
Fig. 6.2
6.3.1
SERIAL DATA
Data enters the module UART through the DIN (pin 3) as an asynchronous serial signal. The signal should idle high when no data is being transmitted. Each data byte consists of a start bit (low), 8 data bits (least significant bit first) and a stop bit (high). The following figure illustrates the serial bit pattern of data passing through the module.
Fig. 6.3
transmitted through the RF module: Example Data Format is 8 N1 (bits parity # of stop bits)
The module UART performs tasks, such as timing and parity checking, that are needed for data communications. Serial communications depend on the two UARTs to be configured with compatible settings (baud rate, parity, start bits, stop bits, data bits)
based on the IEEE 802.15.4-2003 standard for wireless personal area networks (WPANs), such as wireless headphones connecting with cell phones via short-range radio. The technology defined by the ZigBee specification is intended to be simpler and less expensive than other WPANs, such as Bluetooth. ZigBee is targeted at radio-frequency (RF) applications that require a low data rate, long battery life, and secure networking. The ZigBee Alliance is a group of companies which maintain and publish the ZigBee standard. These protocols are built on recent algorithmic research (Ad-hoc Ondemand Distance Vector, neuRFon) to automatically construct a lowspeed ad-hoc network of nodes. In most large network instances, the network will be a cluster of clusters. It can also form a mesh or a single cluster. The current profiles derived from the ZigBee protocols support beacon and non-beacon enabled networks. In non-beacon-enabled networks, an unslotted CSMA/CA channel access mechanism is used. In this type of network, ZigBee Routers typically have their receivers continuously active, requiring a more robust power supply. In beacon-enabled networks, the special network nodes called ZigBee Routers transmit periodic beacons to confirm their presence to other network nodes. Nodes may sleep between beacons, thus lowering their duty cycle and extending their battery life In general, the ZigBee protocols minimize the time so as to reduce power use. In beaconing networks, nodes only need to be active while a beacon is being transmitted. In non-beacon-enabled networks, power consumption is decidedly asymmetrical: some devices are always active, while others spend most of their time sleeping. They direct-sequence spread spectrum coding, which is managed by the digital stream into the modulator. BPSK is used in the 868 and
Dept. of Electronics and Communication, Sir M. VIT 43
915 MHz bands, and orthogonal QPSK that transmits two bits per symbol is used in the 2.4 GHz band. The raw, over-the-air data rate is 250 Kbit/s per channel in the 2.4 GHz band, 40 Kbit/s per channel in the 915 MHz band, and 20 Kbit/s in the 868 MHz band. Transmission range is between 10 and 75 (up to 1500 meters for ZigBee pro.) meters (33 and 246 feet), although it is heavily dependent on the particular environment. The maximum output power of the radios is generally 0 dBm (1 mW)
44
Chapter 7
DC MOTOR
The operation is based on simple electromagnetism. A current carrying conductor generates a magnetic field, when this is placed in an external magnetic field it will experiences a force proportional to the current in the conductor. The internal configuration of a DC motor is designed to harness the magnetic interaction between a currentcarrying conductor and an external magnetic field to generate rotational motion. The DC motor will rotate in one direction when the voltage is given and will rotate in the opposite direction when the voltage is reversed. This DC motor cannot be directly connected to the microcontroller as its current consumption is high, which may damage the circuit. It also does
not provide variable voltage capacity to run the motor with varying speed. Thus a motor driver circuit is used.
45
power. But power generates heat and since the microcontroller has no heat sink it will melt. The motor driver is used to avoid this. Examples: L293d, L298, SN754410.
7.1.1
L293D
The Device is a monolithic integrated high voltage, high current four channel motor driver designed to accept standard DTL (DiodeTransistor Logic) or TTL logic levels and drive inductive loads (such as DC motors) and switching power transistors.
7.1.1.1
FEATURES
600 mA output current capability per channel 1.2A peak output current (non repetitive) per channel Enable facility Logical 0 input voltage up to 1.5V (high noise immunity) Internal clamp diodes
7.1.1.2
INTERNAL CIRCUITRY
46
Fig. 7.1
Internal Circuitry
The block diagram of the motor driver is as shown in the figure. It has four channel drivers. Each pair of channels is equipped with an enable input. It includes internal clamp diodes which mean less additional components are required to implement the circuit.
7.1.1.3
PIN DETAILS
The L293D is assembled in a 16 lead plastic package which has 4 center pins connected together and used for heat sinking.
47
Fig. 7.2
Pin Diagram
7.1.1.4
PRINCIPLE OF OPERATION
The L293d is a four channel driver and each pair of channels are equiped with an enable input. Thus to select either of channel one or two enable1 should be set and enable2 should be reset and to select either of channel three or four enable1 should be reset and enable2 should be set respectively. Each pair of channel is given to a DC motor and thus one L293d is needed for every two motors. A operating voltage of 4.5V-36V can be given to the motor driver circuit. The normal operating voltage at an ambient temperature of 25
48
degrees celsius is Vs=24V (supply voltage) and Vss=5V (logic supply voltage). The truth table below gives the output possibilities for the different
input values.
Table 7.1 Truth Table Where H logic high L logic low Z high output impedance ( * ) relative to considered channel. The microcontroller sets and resets the respective enable and the input pins of the L293d and thus controls the rotation of the DC motor.
Chapter 8
receiver which is connected directly to a monitor, recorder or the other components of the receiving station. Though called wireless, these cameras are not totally wireless. Their name is slightly deceiving because it only refers to the video signal. Even though no video cable is needed for the wireless camera, it still requires power, which means another cable from the camera to the closest outlet. The transmission range of a Wireless Camera is usually rated by use the Line-of-Sight (LOS). Standard Wireless Video Cameras have a range of about 700 feet LOS. The signal can be transmitted through most solid objects including glass, plastic, wood, fiberglass, and some metals, but the signal is attenuated.
PARAMETERS
OF
50
System: PAL/CCIR NTSC/EIA Effective Pixel: PAL: 628X582 NTSC: 510X492 Image Area:PAL: 5.78X4.19mmNTSC: 4.69X3.45mm Horizontal Definition: 380 TV Lines Scanning Frequency: PAL/CCIR: 50HZNTSC/EIA: 60HZ Minimum Illumination: 3LUX Sensitivity: +18DB-AGL ON-OFF Output Electrical Level: 50MW Output Frequency: 1.2G/2.4G Transmission Signal: Video, Audio Linear Transmission Distance: 50-100M Voltage: DC+9V Current: 300mA Power Dissipation:<=640MW
PARAMETERS
OF
RECEIVING
Wireless Audio Receiver Receiving Method:Electronic Frequency Modulation Reception Sensitivity: +18DB Receiving Frequency: 1.2G/2.4G Receiving Signal: Video, Audio Voltage: DC 12V
51
Current: 500mA
52
Chapter 9
POWER SUPPLY
As it is customary to design and fabricate the complete power supply unit required for the project in order to make it sufficient. An ideal regulated power supply is an electronic circuit designed to provide pre-determined DC voltage +Vcc and Vcc i.e independent of current drawn from the Vcc, temperature causes variation in the line voltage. In our hardware we have made provision for both alternating current (AC) and direct current (DC). The AC is coverted to DC power supply using a bridge rectifier circuit. The volatge from the mains(230V) is converted into either a 12v AC or DC voltage using a adaptor and this 12V supply is inturn regulated in the hardware using 7809 and then 7805 regulator. This can be further varied using the LM317 variable voltage regulator. Thus the required voltages for the operation of the integrated chips are supplied. Ideally the microcontroller, MAX232(serial communication) and the motor driver should receive +5V supply for its normal operation while the XBee(wireless communication) requires +3.2V supply for its working. However a supply of 12V is required for the GPS receiver working.
9.1
REGULATORS
There are many designed possibilities for the regulator. Many
conventional regulators are best suited for constant voltage supply, but the number of discreet components and the circuit designed makes it not much attractive for dual power supply. Fixed voltage regulators that are effective and economical are available as three terminal regulator chips. These chips need no external components and operate well even under worst situations of the line or load. The 78xx series are the positive fixed voltage regulators with the output voltage specified
Dept. of Electronics and Communication, Sir M. VIT 53
by the last two digits and LM317 is a variable voltage regulator. To achieve the desired supplies national semiconductor, LM7809 (typically +9V) and LM7805 (typically +5V) regulators were used.
9.1.1
54
Chapter 10
10.1
EXPERIMENT 1:
In the straight line path experiment, there were two latitude values given as input to the program. The vehicle moved to the 1st point (1300.9000 N) and then came back to the 2nd point (1300.9100 N). The flowchart for this program is given below.
START
55
N A
STORE IN STRING
MOVE ACCORDINGLY
STOP
Fig. 10.1
56
The readings recorded during this experiment were tabulated and a graph plotted, as shown below. This shows the co-ordinates of the actual path taken by the vehicle, as compared to the desired coordinate path shown.
Straight
Line
Experiment
Graph
(latitude
vs
10.2
EXPERIMENT 2:
In the rectangular path experiment, there were two latitude values and 2 longitude values given as input to the program. The vehicle moved to the 1st point (1300.9070 N), then to the 2nd point (07733.7300 E), then the 3rd point (1300.9090 N) and finally to the 4th point (07733.6900). It then stops, thereby completing a rectangular path. The flowchart for this program is given below.
Dept. of Electronics and Communication, Sir M. VIT 57
START
STORE IN STRING
58
Fig. 10.3
59
The readings recorded during this experiment were tabulated and a graph plotted, as shown below. This shows the co-ordinates of the actual path taken by the vehicle, as compared to the desired coordinate path shown.
Fig. 10.4
Longitude)
10.2.1
SCHEMATIC REPRESENTATION
The schematic representation of the area where the rectangular path experiment was conducted is shown in fig 10.5
60
Perim eter of the experim area ent Actual latitude and longitude lines Chosen longitude range Chosen latitude range
Fig. 10.5
Schematic Representation
61
Chapter 11
11.1
CONCLUSION
This project has been a great learning experience for us. We have done extensive research and a lot of effort has been put into the implementation of the original idea that was given to us in Indian Institute of Science. This has increased our awareness of the importance of surveillance and navigation in todays world. The project has scope for usage in security systems, navigation and military applications. We live in a world where easy access to remote areas may not always be possible, whereas it may be important to have that access. This project is an endeavor to bring down limitations of this kind and allow areas to be surveyed without endangering human beings. The integrated GPS receiver ensures that the location of the area in question is accurate. The simple display ensures proper understanding of required data. The continuous video feed gives the option to either view the surroundings live, or to record it for future use. The automatic nature of the vehicle removes any need for remote assistance or control by the base station. Thus, this is a self-sufficient system which requires only a simple initial input from the user. In a world where one has to put together many parts in order to get a system to work, to get an integrated system is a big advantage. A lot of work has gone into this project to ensure that this is one such system. The testing has been extensive and the results satisfactory. More importantly, it has been enriching experience for us.
Dept. of Electronics and Communication, Sir M. VIT 62
11.1.1
APPLICATIONS
Military applications Surveillance and reconnaissance Accessing remote areas Accessing hostile regions where humans face danger
11.2
SCOPE
FOR
FURTHER
DEVELOPMENT
At present the terrain of working is assumed to be free of obstacles. This forms a major drawback as this is the complete opposite of the real world scenario. Thus a need arises to build the setup with an obstacle avoidance circuit. We have started our work on building an obstacle avoidance system. Initially we considered infrared sensors but this is a short range sensor and its output varies with the ambient light at the time of reading. This makes the obstacle avoidance circuit less efficient. Thus they were replaced by infrared proximity sensors. Although it has a longer range when compared to the infrared sensors, it is not efficient enough for high speed moving vehicles.
63
Fig. 11.1
IR Object Detection
The above figure illustrates the detection principle of the proximity sensors. Due to the listed disadvantages in using the IR range of sensors, we have started research on using ultrasonic sensors. These are much more efficient as compared to IR sensors. They have a higher range and are more accurate. They also do not get easily affected by the surroundings. The only condition is that the object in question has to be perpendicular to the sensor for effective detection. The only disadvantage of this sensor is that it is extremely expensive. It is not available in India, as a result of which the cost is very high. Thus, this limits its usage in our application.
64
LITERATURE SURVEY
This literature survey is a comprehensive documentation of the methodologies involved in researching this project. We began with the study of GPS and its operation. The first book we turned to for this was Satellite Communications, by Timothy Pratt, Charles Bostian and Jeremy Alnutt, John Wiley & Sons, Inc., 2 Edition, 2003. In this we learnt about the operation of the GPS. To gather more information on this topic we referred to many websites. Of these, the most useful was http://www.trimble.com/gps. Now that we learnt the working of the GPS, we needed to analyse the format of the data that was being received from the GPS receiver. For this purpose, we used the website of the leading GPS receiver manufacturer, GARMIN (http://www.garmin.com) to get the required manuals. We learnt that the data was obtained in the form of NMEA (National Marine Electronic Association) codes. The website, http://www.nmea.org, was helpful in parsing this code. Our project was initially intended to be built around the microcontroller 8051. But since we required In-System Programming, we used the P89v51RD2 microcontroller. This is based on the 8051 architecture and has similar functionalities but with extended memory and added features. To learn about its functions, we used The 8051 Microcontroller and Embedded Systems: Using Assembly and C, by M. A. Mazidi, Janice G. Mazidi and Rolin D. McKinlay, Pearson Education, Inc., 2 Edition, 2006. This microcontroller has flash memory which can be programmed using the In-System Programming (ISP) method when it is embedded in the circuitry. To learn about this, we used the software available at http://www.flashmagictool.com from NXP.
65
The GPS data which is received serially is incompatible with the microcontroller. To overcome this, we used a line driver: MAX232. Our research revealed that the microcontroller cannot provide
sufficient current to drive the DC motors that we used for the vehicle. Thus, we interfaced the microcontroller with the motor driver- L293D.
The operation, pin-details, functions and features of the required ICs were studied from their respective datasheets. These were sourced from http://www.digchip.com, http://www.vishay.com, and http://www.datasheetarchive.com. In order to make wireless transmission of data from the moving vehicle to the base station possible, we used the XBee modules. These are radio frequency transmitter-receiver modules. The necessary circuitry and other information was resourced from http://www.digi.com/products/wireless/zigbee-mesh/. Finally, to improve the functionality of the project as a whole, we referred numerous websites which furnished information about related projects which were done previously. A few of these websites are http://www.societyofrobots.com/, http://www.electronicsforu.com, and http://www.8051projects.info/forum/.
66
67
REFERENCES
Bibliography
M. A. Mazidi, Janice G. Mazidi and Rolin D. McKinlay, The 8051 Microcontroller and Embedded Systems: Using Assembly and C,Pearson Education, Inc., 2 Edition, 2006 Timothy Pratt, Charles Bostian and Jeremy Alnutt, Satellite
Websites
http://www.trimble.com/gps http://en.wikipedia.org/wiki http://www.garmin.com http://www.nmea.org http://www.flashmagictool.com http://www.digi.com/products/wireless/zigbee-mesh http://www.electronicsforu.com http://www.keil.com
Datasheets:
http://www.digchip.com http://www.vishay.com http://www.datasheetarchive.com
Software
68
Orcad and Schematics (to design circuit diagram and PCB) Keil Vision 3 (to write, execute and test programs) Flash Magic (to perform ISP) Hyper-terminal (to view serial data) Windmill comDebug Serial Instrumet Setup Utility (to view serial data) X-CTU (for XBee configuration)
69
APPENDIX
70