interfacing report between lassen sq and micro controller
DESCRIPTION
INTERFACE WITH LASSEN SQ GPS receiver, microcontroller and xy z coordinate display on LCDTRANSCRIPT
Prepared by Mr. Pradeep kumar Research scholar/IIT-Roorkee (Uttarakhand)
1. OBJECTIVE: Interfacing between the Lassen SQ GPS receiver, part no. (46240-00) and Atmel Microcontroller AT89C52 and to display x, y, z coordinates in LCD (2×16 line).
2. COMPONENTS REQUIRED FOR THE INTERFACING:
1- Lassen SQ GPS receiver (46240-00) with magnetic mount antenna
2- Atmel AT89C52 Microcontroller with 8K byte ROM memory.3- LCD (2×16) line operate in 8 Bit Mode4- Power regulators: LM 7805*1, LM317*1 for power regulation5- MAX 232 *2 converter, separately uses for AT89C52 Microcontroller and Lassen
SQ 6- Resistors- 390 E*1, 240E*1, 56K*1, 10K*1, 7- Capacitors- 10 µF/63 V *12, 47 µF/16 V*1, 33 pF *28- Ceramic crystal *1 (11.0592 MHz)9- 10 K SIL*1
10- 6 Jumpers for power distribution of whole circuit
11- Adapter of 12 v dc input or 12 v dc battery
2.1 DESCRIPTION ABOUT THE COMPONENTS:Need for Description:The Lassen SQ receiver receives the code from the satellites and transmits the code through TX and RX, pin no. 1 & 3. We want GPGGA massage from the receiver and receiver Lassen SQ is capable of interface protocol NMEA 0183. NMEA 0183 is an interface protocol so we have to analyze this work through interfacing with embedded technology. In the Lassen SQ receiver there are two interface protocols NMEA 0183 and TSIP, and through NMEA protocol we have to send the information to the LCD. But in
this process of display NMEA massage from the receiver, we take microcontroller for our embedded application with embedded programming. So in this interfacing work we select AT89C52 Microcontroller as comparison to AT89C51 because the memory of 52(8K) is too large as 51(4K). Operation of LCD can be used either in 8 bit mode or in 4 bit mode for displaying the data. Initially we have to do reduce the power 230 v AC into the 3.3 v DC, which will be used for the receiver input power, pin no. 7.So reducing the power supply we used 12 v dc / 500 mA adapter input supply for our system , after that two regulator 7805 and 317 used to reduce the power supply +5 v dc and 3.3 v dc for (microcontroller+ LCD) and receiver SQ respectively. In the network connection of power regulation we used capacitors; resistors and regulator are as follows:Resistor 390E:
Resistor 240 E:
Resistor 56 K:
Resistor 10 K:
Regulator 7805:Voltage regulator ICs are fixed (typically 5, 12 and 15 v) or variable output voltages. They are also rated by the maximum current they can pass. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current (overload protection) and overheating (thermal protection). It is fixed voltage regulator ICs have 3 leads and look like power transistor (7805, +5v)
Regulator LM 317:The LM317 series of adjustable 3-terminal positive voltage regulators is capable of supplying in excess of 1.5A over a 1.2V to 37V output range. They are exceptionally easy to use and require only two external resistors to set the output voltage. Further, both line and load regulations are better than standard fixed regulators. Also, the LM317 is packaged in standard transistor packages which are easily mounted and handled.
In addition to higher performance than fixed regulators, the LM317 series offers full overload protection available only in IC's. Included on the chip are current limit, thermal overload protection and safe area protection. All overload protection circuitry remains fully functional even if the adjustment terminal is disconnected.
Normally, no capacitors are needed unless the device is situated more than 6 inches from the input filter capacitors in which case an input bypass is needed. An optional output capacitor can be added to improve transient response. The adjustment terminal can be bypassed to achieve very high ripple rejection ratios which are difficult to achieve with standard 3-terminal regulators. Besides replacing fixed regulators, the LM317 is useful in a wide variety of other applications. Since the regulator is “floating” and sees only the input-to-output differential voltage, supplies of several hundred volts can be regulated as long as the maximum input to output differential is not exceeded, i.e., avoid short-circuiting the output.
Also, it makes an especially simple adjustable switching regulator, a programmable output regulator, or by connecting a fixed resistor between the adjustment pin and output, the LM317 can be used as a precision current regulator. Supplies with electronic shutdown can be achieved by clamping the adjustment terminal to ground which programs the output to 1.2V where most loads draw little current.
Fig 1.1: LM317
Capacitors:All the capacitors we used for our purposes are polarized. High value of capacitor stored more energy like 1 F as compare to the small value of the capacitors. Smoothing is performed by the electrolyte capacitor are polarized and they must be connected with correct way around, at least one of their leads marked + or – they are not damaged by heat when soldering. Smoothing significantly increases the average DC voltage to almost the peak value. Smooth the dc from varying greatly to small ripple, and to eliminate the ripple connect with regulator with fixed dc voltage.
47 µF /16 V Capacitor:
33 pF Capacitor:
Fig 1.2: conversion of AC into DC
CRYSTAL RESONATOR (1100592MHZ):The majority of clock sources for microcontrollers can be grouped into two types: those based on mechanical resonant devices, such as crystals and ceramic resonators, and those based on electrical phase-shift circuits such as RC (resistor, capacitor) oscillators. Silicon oscillators are typically a fully integrated version of the RC oscillator with the added benefits of current sources, matched resistors and capacitors, and temperature-compensation circuits for increased stability. Two examples of clock sources are illustrated in Figure 1. Figure 1a shows a Pierce oscillator configuration suitable for use with mechanical resonant devices like crystals and ceramic resonators, while Figure 1b shows a simple RC feedback oscillator.
Figure1.3: example of simple clock source (a) a pierce oscillator configuration and (b) an RC feedback oscillator.
2.1.1 LASSEN SQ GPS RECEIVER (46240-00): The Lassen SQ GPS receiver is a complete 8 channel- parallel tracking GPS receiver designed to operate with the L1 frequency, standard position service, and coarse acquisition code. Using two highly integrated Trimble custom integrated circuit, the receiver is designed in a modular format especially suited for embedded applications where small size and extremely low power consumption are required. The receiver feature Trimble’s latest signal processing code, a high gain RF section for compatibility with standard 27 dB active gain GPS antennas, and a CMOS TTL level pulse-per-second (PPS) output for a timing application or for use as a general purpose synchronization signal.
The Lassen SQ GPS receiver acquires a position fix with minimal delay after power cycling. The battery back up RAM is used to keep the Real Time clock (RTC) alive, and to store the following
1- Almanac 2- Ephemeris3- Last position
User setting such as port parameters and NMEA setting can be stored in the receiver’s non-volatile (flash) memory. These setting are retained without application of main power or bakery back-up power.
Lassen SQ GPS Receiver Modules (46240-00) GND (2) TXD (1) RXD (3)
3.3 V DC (7) Magnetic Mount Antenna (5m)Figure1.4: Diagram of 8 pin connector of Lassen SQ GPS receiver, pin (1, 2, 3, 7)
2.1.2 DIGITAL I/O CONNECTORS: The Lassen SQ GPS receiver module uses a single 8-pin (2x4) male header connector for both power and I/O connector, J2, is a surface mount micro terminal strip. This connector uses 0.09 inch (2.286mm) high pins on 0.05 inch (1.27mm) spacing. The manufacturer of this connector is Samtec, part no.ASP-69533-01.
Fig1.5: FFSD CONNECTOR MOUNT ON GPS RECEIVER
2.1.3 DIGITAL IO/POWER CONNECTOR PIN OUT: Table 1.1 List of The digital IO/power connector pin out informationPin number Function Description1 TXD A Serial port A transmit, CMOS/TTL2 GND Ground, Power and signal3 RXD A Serial port A receive, CMOS/TTL4 PPS Pulse per second, CMOS/TTL5 Reserve Not connect6 Reserve Not connect7 Prime Power (VCC) +3.3 VDC to ± 0.3 VDC8 Battery Backup Power +2.5 VDC to + 3.6 VDC
2.1.3 INTERFACE PROTOCOL: The Lassen SQ GPS receiver operates using one of two protocol- Trimble standard interface protocol (TSIP) (Trimble Standard Interface Protocol) and NMEA 0183 (National Marine Electronics Association).
The Lassen SQ GPS receiver has a single configurable serial I/O communication port. The Lassen SQ GPS receiver can also be configured to output NMEA messages. The industry standard port characteristics for NMEA are:
a. Baud Rate : 4800b. Data Bits : 8 c. Parity : Noned. Stop Bits : 1e. No Flow Control
2.1.3.1 NMEA: NMEA 0183 is an industry standard protocol common to marine application. NMEA provides direct compatibility with other NMEA- capable device. The Lassen SQ GPS receiver support most NMEA massages for GPS navigation. NMEA messages and output rates can be user selected as required.
HARDWARE CONNECTION:
The hardware interface for GPS units is designed to meet the NMEA requirements. They are also compatible with most computer serial ports using RS232 protocols, however strictly speaking the NMEA standard is not RS232. They recommend conformance to EIA-422. The interface speed can be adjusted on some models but the NMEA standard is 4800 b/s (bit per second rate) with 8 bits of data, no parity, and one stop bit. All units that support NMEA should support this speed. Note that, at a b/s rate of 4800, you can easily send enough data to more than fill a full second of time. For this reason some units only send updates every two seconds or may send some data every second while reserving other data to be sent less often. In addition some units may send data a couple of seconds old while other units may send data that is collected within the second it is sent. Generally time is sent in some field within each second so it is pretty easy to figure out what a particular GPS is doing. Some sentences may be sent only during a particular action of the receiver such as while following a route while other receivers may always send the sentence and just null out the values. Other difference will be noted in the specific data descriptions defined later in the text.
At 4800 b/s you can only send 480 characters in one second. Since an NMEA sentence can be as long as 82 characters you can be limited to less than 6 different sentences. The actual limit is determined by the specific sentences used, but this shows that it is easy to overrun the capabilities if you want rapid sentence response. NMEA is designed to run as a process in the background spitting out sentences which are then captured as needed by the using program. Some programs cannot do this and these programs will sample the data stream, then use the data for screen display, and then sample the data again. Depending on the time needed to use the data there can easily be a lag of 4 seconds in the responsiveness to changed data. This may be fine in some applications but totally unacceptable in others. For example a car traveling at 60 mph will travel 88 feet in one second. Several second delays could make the entire system seem unresponsive and could cause you to miss your turn.
The NMEA standard has been around for many years (1983) and has undergone several revisions. The protocol has changed and the number and types of sentences may be different depending on the revision. Most GPS receivers understand the standard which is called: 0183 version 2. This standard dictates a transfer rate of 4800 b/s. Some receivers also understand older standards. The oldest standard was 0180 followed by 0182 which transferred data at 1200 b/s. An earlier version of 0183 called version 1.5 is also understood by some receivers. Some Garmin units and other brands can be set to 9600 for NMEA output or even higher but this is only recommended if you have determined that 4800 works ok and then you can try to set it faster. Setting it to run as fast as you can may improve the responsiveness of the program.
In order to use the hardware interface you will need a cable. Generally the cable is unique to the hardware model so you will need an cable made specifically for the brand and model of the unit you own. Some of the latest computers no longer include a serial port but only a USB port. Most GPS receivers will work with Serial to USB adapters and serial ports attached via the pcmcia (pc card) adapter. For general NMEA use with a gps receiver you will only need two wires in the cable, data out from the gps and ground. A third wire, Data in, will be needed if you expect the receiver to accept data on this cable such as to upload waypoints or send DGPS data to the receiver.
GPS receivers may be used to interface with other NMEA devices such as autopilots, fish finders, or even another GPS receiver. They can also listen to Differential Beacon Receivers that can send data using the RTCM SC-104 standard. This data is consistent with the hardware requirements for NMEA input data. There are no handshake lines defined for NMEA
DECODE OF SELECTED POSITION SENTENCE:
The most important NMEA sentences include the GGA which provides the current Fix data, the RMC which provides the minimum gps sentences information, and the GSA which provides the Satellite status data.
GGA - essential fix data which provide 3D location and accuracy data.
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
Where: GGA Global Positioning System Fix Data 123519 Fix taken at 12:35:19 UTC 4807.038, N Latitude 48 deg 07.038' N 01131.000, E Longitude 11 deg 31.000' E 1 Fix quality: 0 = invalid 1 = GPS fix (SPS) 2 = DGPS fix 3 = PPS fix
4 = Real Time Kinematics
5 = Float RTK 6 = estimated (dead reckoning) (2.3 feature)
7 = Manual input mode 8 = Simulation mode
08 Number of satellites being tracked 0.9 Horizontal dilution of position 545.4, M Altitude, Meters, above mean sea level 46.9, M Height of geoids (mean sea level) above WGS84 Ellipsoid (Empty field) time in seconds since last DGPS update (Empty field) DGPS station ID number *47 the checksum data, always begins with *
If the height of geoids is missing then the altitude should be suspect. Some non-standard implementations report altitude with respect to the ellipsoid rather than geoids altitude. Some units do not report negative altitudes at all. This is the only sentence that reports altitude.
2.1.4 POWER REQUIREMENT:
The Lassen SQ GPS module requires + 3.3 VDC to ± 0.3 VDC at 33 mA, typically excluding the antenna. The on board capacitance is 10 µF. An important design consideration for power is the module’s internal clock frequency at 12.504 MHz to ± 3 KHz. Interference spurs on prime power in this narrow frequency band should be kept to less than 1Mv.
2.2 ABOUT MICROCONTROLLER 8051/52:The AT89C52 is a low power, high performance CMOS 8-bit microcontroller with 8K bytes of flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry standard 80C51 and 80C52 instruction set and pin out. The on chip flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with flash on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer which provides a highly-flexible cost effective solution to many embedded control application.
8051/52 PIN OUT: Power – Vcc, Vss Reset - RST Crystal – XTAL [1, 2] External device interfacing – EA, ALE, PSEN, WR, RD I/O Port – P0 [7:0], P1 [7:0], P2 [7:0], P3 P3 is shared with control lines – serial I/O RxD, TxD External interrupts INT0, INT1 Counter control T0, T1 P0 and P2 are multiplexed with Address and Data Bus
Figure1.6: Basic circuit of 8051/52 Atmel microcontroller
BASIC CIRCUIT – WHICH MAKES 8051/52 WORKS:
Fig1.7: Microcontroller performance
EA/VP PIN: The EA on pin 31 is tied high to make the 8051/52 executes program from internal ROM.RESET CIRCUIT: RESET is an active high I/P when RESET is set to high, 8051/52 go back to the power on state.The 8051/52 is reset by holding the RST high for at least two machine cycles and then returning it low.POWER ON SET: - Initially charging of capacitor makes RST high - When capacitor charges fully it block DC.
Fig 1.8: Capacitor arrangement for DC supplyMANUAL RESET: Closing the switch momentarily will make RST high. After a reset, the program counter is loaded with 0000H but the content of on- chip RAM is not affected.
Table 1.2
Register Content Register Content
Program counter 0000h IP XXX00000b
Accumulator 00h IEv 0XX00000b
B register 00h All timer registers 00h
PSW 00h SCON 00h
SP 07h SBUF 00h
DPTR 0000h PCON (HMOS) 0XXXXXXXbv
All ports FFh PCON (CMOS)v 0XXX0000b
Note: Content of on- chip RAM is not affected by reset.
HOW FAST 8051/52 WORKS? A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes one machine cycle to execute, it will take 12 pulses of the crystal to execute. Since we know the crystal is pulsing 11,059,000 times per second and that one machine cycle is 12 pulses, we can calculate how many instruction cycles the 8051 can execute per second:
11,059,000 / 12 = 921,583
USING PORT FOR I/O OPERATION: 8051/52 is a TTL logic device. TTL logic has two levels: logic “HIGH” (1) and logic “LOW” (0). The voltage and current involved for the two levels are as follows:
Table 1.3
Level Voltage Current
High Above 2.4V Virtually no current flow
Low Below 0.9V1.6mA Sinking current from TTL input to ground(Depends on logic family)
PORT FUNCTION:Table 1.4
PORT FUNCTIONPort 0Pin (32-39)
Dual – purpose port – 1.genreal purposes I/O port. 2. multiplexed address and data bus open drain O/Ps
Port 1 Pin (1- 8)
Dedicated I/O port – used solely for interfacing for external devices internal pull- bus.
Port 2Pin (21-28)
Dual purpose port – 1. general purpose I/O port 2. A multiplexed address and data bus. Internal pull- ups
Port 3Pin (10 -17)
Dual purpose port - 1. general purpose I/O port 2. pins have alternate purpose related to special Feature of the 8051 internal pull- ups
Figure 1.9: the internal circuitry for the 8051/52 port pins
GPS SERIAL O/P: Most GPS are capable of sending information through a simple serial link. Only the TxD and GROUND pins need to be connected. The GPS must be set at 9600 bps (or 4800 bps), 8 bit, no parity, and 1 stop bit.
NAND gate as 2:1 Mux.Which connects Rx of GPS receiver according to select bit logic level (pin 1.0 of uC)
SERIAL COMMUNICATION:
Figure 1.10: TTL/CMOS Serial logic waveform
The diagram above shows the expected waveform from the UART when using the common 8N1 format. 8N1 signifies 8 Data bits, no parity and 1 stop bit. The RS-232 line, when idle is in the Mark State (Logic 1). A transmission starts with a start bit which is Logic 0). Then each bit is sent down the line, one at a time. The LSB (least significant bit) is sent first. A stop bit (Logic 1) is then appended to the signal to make up the transmission.
The data is sent using this method, is said to be framed. That is the data is framed between a Start and Stop Bit.
RS-232 voltage levels:1. +3 to +25 volts to signify a “space” (Logic 0)2. –3 to -25 volts for a “mark” (Logic 1).3. Any voltage in between these regions (i.e. between -3 to +3
volts) is undefined.
The data byte is always transmitted least- significant -bit first.The bits are transmitted at specific time intervals determined by the baud rate of the serial signal.This is the signal present on the RS-232 Port of your computer, shown below
Fig 1.11: RS-232 Logic Waveform
1.3 ABOUT LCD 2 LINE:This is the first interfacing example for the Parallel Port. We will start with something simple. This example doesn't use the Bi-directional feature found on newer ports, thus it should work with most, if no all Parallel Ports. It however doesn't show the use of the Status Port as an input. So what are we interfacing? A 16 Character x 2 Line LCD Module to the Parallel Port. These LCD Modules are very common these days, and are quite simple to work with, as all the logic required running them is on board.
SCHEMATIC:
Fig 1.12: LCD (2*16)
CIRCUIT DESCRIPTION:
Above is the quite simple schematic. The LCD panel's Enable and Register Select is connected to the Control Port. The Control Port is an open collector / open drain output. While most Parallel Ports have internal pull-up resistors, there are a few which don't. Therefore by incorporating the two 10K external pull up resistors, the circuit is more
portable for a wider range of computers, some of which may have no internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we hard wire the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on the data lines. As a result we cannot read back the LCD's internal Busy Flag which tells us if the LCD has accepted and finished processing the last instruction. This problem is overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel.
CRITERIA FOR CHOOSING COMPONENTS
In Lassen SQ GPS receiver, the pin no. 7 operates only in 3.0 to 3.3 v dc as an output according to data sheet. So we have to develop a small circuit for power reducing of output 3.3 v dc. In this process we have taken directly 12 v dc batteries or 12 v dc output adapter except transformer and diode combination because here we no need of AC to DC conversion. If we consider making a configuration with the help of AC/DC refer figure 1.2
VC C
C 210uF _25V
U 2 LM3173
1
2V IN
AD J
VO U T 3V 3
C 110uF _25V
G N D
U 1 7805
1 3V IN VO U T
R 1240E
VC CJ 1
12V _ IN PU T
12
C 347uF _16V
R 2390E
P LU S 5V
Fig 1.13: LM 7805 and LM 317 used to reduce the power for GPS pin no. 7
Salient steps for converting 12v to 3.3v:So according to our main focus to generate 3.3 v dc output voltages through SQ receiver pin no. 7 so we have to arrange a circuit diagram with the help of following component:
1- 12 v dc initially power supply through AC adapter (12 v dc o/p at 100 mA) to the PCB board.
2- Take LM 7805 to regulate the voltage +5 v dc along with C1 capacitor of capacity 10 µF_25V.
3- Then +5 v dc output goes to the input of LM 317 , and pin no. 1,2 of LM 317 connected with R1 resistor with capacity 240 E and R2 resistor with capacity 390 E along with capacitor with capacity 47 µF_16V.
4- Finally we got output voltage 3.3 v dc for the pin no. 7 of Lassen SQ GPS receiver.
3. METHODOLOGY FOR INTERFACING: The interfacing among the three main components GPS receiver (Lassen SQ), 8052 Microcontroller, LCD (2 line) involves ten broad steps are as follows
PROCEDURE 1 Draw a circuit diagram manually in circuit maker software (free in Google).
VC C
C 210uF _25V
U 2 LM3173
1
2V IN
AD J
VO U T 3V 3
C 110uF _25V
G N D
U 1 7805
1 3V IN VO U T
R 1240E
VC CJ 1
12V _ IN PU T
12
C 347uF _16V
R 2390E
P LU S 5V
Figure 1.14: Diagram of power regulation from 12 v dc to 3.3 v dc
U 4MAX232
1345
16
15
26
1 29
1110
138
147
C 1+C 1 -C 2+C 2 -
VCC
GND
V +V -
R 1O U TR 2O U T
T1 INT2 IN
R 1 INR 2 IN
T1O U TT2O U T
C 1310uF
G PS 3
G PS 7
VC C
3V 3J 4
G PS
1234
C 1510uF
C 510uF
3V 3
VC C
C 1710uF
C 1110uF
C 1410uF
G PS 7
C 1010uF
MC U _R XD
G PS 2G PS 1
MC U _TXD
VC C
G PS 1
U 5MAX232
1345
16
15
26
1 29
1110
138
147
C 1+C 1 -C 2+C 2 -
VCC
GND
V +V -
R 1O U TR 2O U T
T1 INT2 IN
R 1 INR 2 IN
T1O U TT2O U T
C 910uF
C 1610uF
C 1210uF
G PS 2
G PS 3
Figure 1.15: Connection with GPS receiver and MAX 232 converters
VC CY 111 . 0592MH z
R 3 10K
LC D _R D
J 7
C O N 16
12345678910
11
12
13
14
15
16
V C C
VC C
VC CLC D _E
J 3 10K _S IL123456789
C 833pF
R 456K
LC D _R S
LC D _R SMC U _TXD
U 3AT89C 52
9
1819
2930
31
12345678
2122232425262728
1011121314151617
3938373635343332
R ST
XTA L2XTA L1
PSENA LE /PR OG
EA /V PP
P 1 .0 /T2P 1 . 1 /T2 -E XP 1 . 2P 1 . 3P 1 . 4P 1 . 5P 1 . 6P 1 . 7
P 2 . 0 /A 8P 2 . 1 /A 9
P 2 . 2 /A 10P 2 . 3 /A 11P 2 . 4 /A 12P 2 . 5 /A 13P 2 . 6 /A 14P 2 . 7 /A 15
P 3 . 0 /R XDP 3 .1 /TXDP 3 .2 / IN T0P 3 . 3 / IN T1
P 3 . 4 /T0P 3 . 5 /T1
P 3 . 6 /W RP 3 .7 /R D
P 0 .0 /AD 0P 0 . 1 /AD 1P 0 . 2 /AD 2P 0 . 3 /AD 3P 0 . 4 /AD 4P 0 . 5 /AD 5P 0 . 6 /AD 6P 0 . 7 /AD 7
VC C
C 61uF _16V
MC U _R XDLC D _R D
MCU SECTION
VC C
LC D _E
C 733pF
C 410uF
Figure 1.16: Microcontroller 8052 work with TX, RX pins and display data in 2 lines LCD in 8 bit mode
PROCEDURE 2 Designing the PCB lay out
Figure 1.17: PCB lay out with 6 Jumpers for power distribution in the whole circuit
Step 1. Design PCB
We use initially OrCAD software for PCB design.
http://www.orcad.com
PROCEDURE 3 Print the PCB lay out on the PCB board.
Figure 1.18: Whole circuit connection on the PCB board with square box represent pin no.1 for all IC’s
Step 2. Print the PCB design.
Take an inkjet printout on a normal paper and get it photocopied on the glossy paper.
Fig1.19: Print the PCB lay out on the PCB base
Remember; take the mirror image of top layer (if you have any). And keep the bottom layer as it is.
Don’t scale the image while printing.
Step 3. Transfer the design to the blank PCB.
Place the glossy printout on the copper side of the PCB, and iron the back side of the printout. It will take around 3-5 minutes for the design to get transferred. Don’t over iron. Sometimes large blisters pop out on the PCB rendering it useless. Make sure the printout doesn’t move when you iron it.
Fig 1.20: Place the PCB on copper layer
Any corrections can be made using any alcohol based permanent marker (We used a Luxor OHP marker). (Appearing as red marks in the photograph above)
Step 4. Cut the PCB. We used a hacksaw blade.
Fig 1.21: Cutting the desired PCB from the copper sheet
Step 5. Make the ‘Etchant’
Heat some tap water. Dissolve some FeCl3 and fill the plastic trough with the gooey browny solution. (Atleast 2-3 cm)
This is not rocket science; just add enough crystals to start etching.
Fig1.22: Dissolve the PCB in liquid solution
Step 6. Etching
Put your ‘to be etched PCB’ in the trough and keep stirring. Take out the PCB every 3-4 minutes and pour some peroxide solution on it. Make sure you do all this in a well ventilated area with the gloves on.
The solution starts eating up copper on the sides and proceeds towards the center, and “the rate of eating up copper” speedens up towards the end of the process.
Step 7. Cleaning.
Clean you freshly etched PCB in flowing tap water. Use some acetone to remove the toner off the copper tracks. I had to go to the extent of using a sandpaper to scrape it off.
Fig 1.23: Remove the PCB copper from the outside of the circuit line
Drill the PCB hole by the drilling machine.
Step 8. Drilling.
I used a 0.8mm drill bit and a hand-drill.
It is recommended to drill holes using a PCB drill.
Fig 1.24: Drilling on the PCB board by drilling machine
Step 9. Give yourself a pat on the shoulder. Yes you are holding probably the first on the second. Or the nth PCB “made by you” in your hands.
Fig 1.25: Required component mount on the PCB Board
The final circuit board.
Note: Do not dispose the chemical waste generated in the complete process by pouring it into the drain. “FeCl3 and stuff” is very harmful for the environments.
PROCEDURE 4Number of components mounted on the PCB board.
Fig 1.26: 31 components with their value mounted /design on the PCB board
PRODEDURE AFTER GETTING 3.3 V DC OUTPUT FOR GPS: After generating 3.3 v dc voltage, we use firstly MAX 232 converter of 16 pin, the pin description as follows which use in the hardware setup:
Table 1.5
When we got of 3.3 v dc power from LM317 & LM7805 to the GPS receiver pin no. 7 as well as MAX 232 converter, pin no. 16 (Vcc) along the combinations of capacitors with capacity 10 µF_63V(C5).GPS pin no. 3 (Rx) connected with MAX 232 converter pin no. 9 (R2OUT) that’s why MAX 232 , pin no 9, receive the signal through GPS pin no. 3 and GPS pin no. 1(TX) connected with MAX 232 , pin no.10 (T2IN) that’s why GPS pin no. 1 transmit the signal through pin no. 10 of MAX 232.GPS pin no. 2 (GND) connect with pin no. 15 (GND) of MAX 232 at 0 voltages. In this connection 2 capacitor C9, C10, of capacity (10 µF_63V) connected with pin no. 1, 3 and 4, 5. C11 capacitor of 10 µF_63V connected with pin no. 2 and 3.3 v dc. , another C12 capacitor of same capacity connected with pin no. 6 of MAX 232 and GPS pin no. 2 join with ground, pin no. 15.
After completed one step process we take another component MAX 232 for microcontroller purposes. The output pin no. of first MAX 232 converter are 8 (R2IN) and 7 (T2OUT). The GPS pin no. 3 (RX) output pin no. 8 goes to the input of MAX 232 pin no. 7 (T2OUT) and GPS pin no. 1(TX) output pin no.7 goes to the input of MAX 232 pin no.8 (R2IN), that is transmit signal and receive signal goes to 7 to 8 and 8 to 7 respectively on MAX 232 first converter to another MAX 232 converter.
PIN NUMBER FUNCTION1 C1+3 C1-4 C2+5 C2-2 V+6 V-8 R2IN10 T2IN15 GND16 VCC9 R2OUT7 T2OUT
U 4MAX232
1345
16
15
26
1 29
1110
138
147
C 1+C 1 -C 2+C 2 -
VCC
GND
V +V -
R 1O U TR 2O U T
T1 INT2 IN
R 1 INR 2 IN
T1O U TT2O U T
C 1310uF
G PS 3
G PS 7
VC C
3V 3J 4
G PS
1234
C 1510uF
C 510uF
3V 3
VC C
C 1710uF
C 1110uF
C 1410uF
G PS 7
C 1010uF
MC U _R XD
G PS 2G PS 1
MC U _TXD
VC C
G PS 1
U 5MAX232
1345
16
15
26
1 29
1110
138
147
C 1+C 1 -C 2+C 2 -
VCC
GND
V +V -
R 1O U TR 2O U T
T1 INT2 IN
R 1 INR 2 IN
T1O U TT2O U T
C 910uF
C 1610uF
C 1210uF
G PS 2
G PS 3
Figure 1.28: Work done after the getting power 3.3 v dc to the GPS receiver
In the second MAX 232 converters we give the supply of +5 v dc to the pin no. 16 (Vcc) from the output of LM 7805 regulator and 2 capacitor C14, C15 with capacity 10 µF_63V connected with pin no. 1,3 and 4,5 respectively to the MAX 232. The output voltage Vcc of +5v goes from LM 7805 output to the input of MAX 232 pin no. 2 and 1 along with capacitor with 10 µF_63V capacity. Pin no. 6 and 15 of MAX 232 interconnected with 10 µF_63V capacitor and finally join with GND at 0 voltages.WHY WE USE 2 MAX 232 CONVERTERS: The first MAX 232 used for the GPS purposes and second MAX 232 used for the microcontroller i.e. they handled separately two major component of Lassen SQ receiver
and AT89C52 Microcontroller. In the first MAX 232 we have to given the supply of 3.3 v dc which is operate on the GPS receiver pin no. 7 power and another MAX 232 operate on the +5 v dc supply which is operate on the Microcontroller power supply.Interface of TX and RX signals from GPS receiver to the Micro controller (AT89C52)
It is the very important task of interfacing. In this process the second MAX 232 converter pin no. 9 (R2OUT) and pin no. 10 (T2IN) output goes to the input of AT89C52 ,pin no.10 (P3.0/RXD) and pin no. 11 (P3.1/TXD) , that is the transmit and receiving signal (TX, RX) of Lassen SQ GPS receiver finally communicate with microcontroller’s TX and RX signal through serial communication.In the process of signals transmitting and receiving by the Microcontroller, it requires +5 v dc supply on the pin no. 31 (EA/VPP) and pin no. 9 (RST) along with one resistor R4 having capacity 56 K and one capacitor having capacity 1µF_16V. At pin no. 18, 19(XTAL2, XTAL1) we use a ceramic crystal Y1 (11.0592MHz) and join with 2 capacitor C7 and C8 of sane capacity of 33pf along with GND because with the help these combination AT89C52 do work fast.
VC CY 111 . 0592MH z
R 3 10K
LC D _R D
J 7
C O N 16
12345678910
11
12
13
14
15
16
V C C
VC C
VC CLC D _E
J 3 10K _S IL123456789
C 833pF
R 456K
LC D _R S
LC D _R SMC U _TXD
U 3A T89C 52
9
1819
2930
31
12345678
2122232425262728
1011121314151617
3938373635343332
R ST
XTA L2XTA L1
PSENA LE /PR OG
EA /V PP
P 1 . 0 / T2P 1 . 1 / T2 -E XP 1 . 2P 1 . 3P 1 . 4P 1 . 5P 1 . 6P 1 . 7
P 2 . 0 /A 8P 2 . 1 /A 9
P 2 . 2 /A 10P 2 . 3 /A 11P 2 . 4 /A 12P 2 . 5 /A 13P 2 . 6 /A 14P 2 . 7 /A 15
P 3 . 0 /R XDP 3 .1 / TXDP 3 . 2 / IN T0P 3 . 3 / IN T1
P 3 . 4 / T0P 3 . 5 / T1
P 3 . 6 /W RP 3 .7 /R D
P 0 . 0 /A D 0P 0 . 1 /A D 1P 0 . 2 /A D 2P 0 . 3 /A D 3P 0 . 4 /A D 4P 0 . 5 /A D 5P 0 . 6 /A D 6P 0 . 7 /A D 7
VC C
C 61uF _16V
MC U _R XDLC D _R D
MCU SECTION
VC C
LC D _E
C 733pF
C 410uF
Figure 1.29: Main signal TX and RX flow trough microcontroller AT 89C52INTERFACING OF LCD 2 LINES WITH AT89C52 IN 8 BIT MODES:The pin no. 3 of LCD connected with R3 with capacity 10 K and one side of resistor connect with +5 v dc supplies; another side connects with GND at 0 voltage, and 10K_SIL pin no.1 connect with VCC(+5 v dc) along with C4 capacitor having capacity 10µF_63V and join with GND.In between the microcontroller and LCD we insert a 10K_SIL as a power source of 10 pin component. The pin no. configuration for LCD and Microcontroller which as follow:
Table 1.6
MCU PIN NO.
FUNCTION LCD PIN NO.
FUNCTION
39 P0.0/AD0,Adress data line
14(8 Bit Mode Pin)
Display data
38 P0.1/AD1,Adress data line
13(8 Bit Mode Pin)
Display data
37 P0.2/AD2,Adress data line
12(8 Bit Mode Pin)
Display data
36 P0.3/AD3,Adress data line
11 (4 Bit Mode Pin)
Display data
35 P0.4/AD4,Adress data line
10 (8 Bit Mode Pin)
Display data
34 P0.5/AD5,Adress data line
9 (8 Bit Mode Pin)
Display data
33 P0.6/AD6,Adress data line
8(8 Bit Mode Pin)
Display data
32 P0.7/AD7,Adress data line
7(8 Bit Mode Pin)
Display data
20 0 Input Voltage 1,15 GND31 5Volt input
supply16,2,3 +5 V DC
PROCEDURE 5 Write the program in c/c++ code according to suitable format#include<conio.h>#include<string.h>#include<stdio.h>#include<iostream.h>#include<fstream.h>#include<io.h>#define col 21#define row 11
// to write extracted data
ofstream strout("out.txt",ios::app);char c;
//functions for processing
void process(char a[row][col]);void print(char a[row][col],int low,int up, int column);
void write(char a[row][col],int first,int second,char sign1,char sign2,int len,int cnum);void makenull(char a[row][col]);
// the sentences: void AAM(char a[row][col]);void ALM(char a[row][col]);void BWC(char a[row][col]);void DTM(char a[row][col]);void GGA(char a[row][col]);void GLL(char a[row][col]);void GRS(char a[row][col]);void GSA(char a[row][col]);void GST(char a[row][col]);void GSV(char a[row][col]);void MSK(char a[row][col]);void MSS(char a[row][col]);void RMC(char a[row][col]);void VTG(char a[row][col]);void ZDA(char a[row][col]);
// function body:
void process(char a[row][col]){cout<<"\n";if(a[3][0]=='R'&& a[4][0]=='M' && a[5][0]=='C')
{RMC(a);}
else if(a[3][0]=='A'&& a[4][0]=='A' && a[5][0]=='M') {
AAM(a); }
else if(a[3][0]=='A'&& a[4][0]=='L' && a[5][0]=='M') {
ALM(a); }
else if(a[3][0]=='D'&& a[4][0]=='T' && a[5][0]=='M') {
DTM(a); }
else if(a[3][0]=='B'&& a[4][0]=='W' && a[5][0]=='C') {
BWC(a); }
else if(a[3][0]=='G'&& a[4][0]=='L' && a[5][0]=='L') {
GLL(a); }
else if(a[3][0]=='G'&& a[4][0]=='G' && a[5][0]=='A') {
GGA(a);}
else if(a[3][0]=='G'&& a[4][0]=='S' && a[5][0]=='V'){GSV(a);}
else if(a[3][0]=='G'&& a[4][0]=='S' && a[5][0]=='A'){GSA(a);}
else if(a[3][0]=='G'&& a[4][0]=='S' && a[5][0]=='T'){GST(a);}
else if(a[3][0]=='G'&& a[4][0]=='R' && a[5][0]=='S'){GRS(a);}
else if(a[3][0]=='M'&& a[4][0]=='S' && a[5][0]=='K') {
MSK(a); }
else if(a[3][0]=='M'&& a[4][0]=='S' && a[5][0]=='S'){MSS(a);}
else if(a[3][0]=='V'&& a[4][0]=='T' && a[5][0]=='G')
{VTG(a);}
else if(a[3][0]=='Z'&& a[4][0]=='D' && a[5][0]=='A'){ZDA(a);}
}
//funtion to print and write the data to filevoid print(char a[row][col],int low,int up, int column,char wr){int l; char k;for(l=low;l<up;l++)
{k=a[l][column];cout<<k;
if(wr=='y'||wr=='Y'){strout.put(k);}
}
cout<<"\n";}
//function to set all the elements of array to nullvoid makenull(char a[row][col]){int l,m;for(l=0;l<21;l++) { for(m=0;m<11;m++) { a[m][l]='\0'; } }}
//funtion to write data in specific format to filevoid write(char a[row][col],int first,int second,char sign1,char sign2,int len,int cnum){int l=0;char k;
for(l=0;l<first;l++){
k=a[l][cnum];strout.put(k);}
strout.put(sign1);for(l=first;l<second;l++){k=a[l][cnum];strout.put(k);}
strout.put(sign2);for(l=second;l<len;l++){k=a[l][cnum];strout.put(k);}
l=0;c='\0';}
void AAM(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" Waypoint Arrival Alarm\n";
cout<<"Status (A if Arrival circle entered): ";strout<<"Status (A if Arrival circle entered): ";print(a,0,1,1,'y');strout<<"\n";
cout<<"Status (A if perpendicular passed at waypoint): ";strout<<"Status (A if perpendicular passed at waypoint): ";print(a,0,1,2,'y');strout<<"\n";
cout<<"Arrival circle radius: ";strout<<"Arrival circle radius: ";print(a,0,3,3,'y');strout<<"\t";
cout<<"Unit of radius: ";print(a,0,1,4,'y');strout<<"\n";
cout<<"Waypoint ID: ";
strout<<"Waypoint ID: ";print(a,0,4,5,'y');strout<<"\n";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,6,'y');strout<<"\n end of sentence \n\n";
}
void ALM(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" GPS Almanac Data\n";
cout<<"Total Number of Messages: " ;strout<<"Total Number of Messages: " ;print(a,0,3,1,'y');strout<<"\n";
cout<<"Message Number: ";strout<<"Message Number: ";print(a,0,3,2,'y');strout<<"\n";
cout<<"Satellite PRN number: ";strout<<"Satellite PRN number: ";print(a,0,2,3,'y');strout<<"\n";
cout<<"GPS Week Number : ";strout<<"GPS Week Number : ";print(a,0,3,4,'y');strout<<"\n";
cout<<"SV health: ";strout<<"SV health: ";print(a,0,2,5,'y');strout<<"\n";
cout<<"Eccentricity: ";
strout<<"Eccentricity: ";print(a,0,4,6,'y');strout<<"\n";
cout<<"Almanac Reference Time: ";strout<<"Almanac Reference Time: ";print(a,0,2,7,'y');strout<<"\n";
cout<<"Inclination Angle: ";strout<<"Inclination Angle: ";print(a,0,4,8,'y');strout<<"\n";
cout<<"Rate of Right Ascension: ";strout<<"Rate of Right Ascension: ";print(a,0,4,9,'y');strout<<"\n";
cout<<"Root of semi-major axis: ";strout<<"Root of semi-major axis: ";print(a,0,6,10,'y');strout<<"\n";
cout<<"Argument of perigee: ";strout<<"Argument of perigee: ";print(a,0,6,11,'y');strout<<"\n";
cout<<"Longitude of ascension node: ";strout<<"Longitude of ascension node: ";print(a,0,6,12,'y');strout<<"\n";
cout<<"Mean anomaly : ";strout<<"Mean anomaly: ";print(a,0,6,13,'y');strout<<"\n";
cout<<"F0 Clock Parameter: ";strout<<"F0 Clock Parameter: ";print(a,0,3,14,'y');strout<<"\n";
cout<<"F1 Clock Parameter: ";strout<<"F1 Clock Parameter: ";
print(a,0,3,15,'y');strout<<"\n";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,16,'y');strout<<"\n end of sentence \n\n";
}
void DTM(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" Datum Reference\n";
cout<<"Local datum code: ";strout<<"Local datum code: ";print(a,0,3,1,'y');strout<<"\n";
cout<<"Local datum subcode: ";strout<<"Local datum subcode: ";print(a,0,1,2,'y');strout<<"\n";
cout<<"Latitude offset (minutes): ";strout<<"Latitude offset (minutes): ";print(a,0,4,3,'y');strout<<" ";
cout<<"Direction : ";print(a,0,1,4,'y');strout<<"\n";
cout<<"Longitude offset (minutes): ";strout<<"Longitude offset (minutes): ";print(a,0,4,5,'y');strout<<" ";
cout<<"Direction : ";print(a,0,1,6,'y');strout<<"\n";
cout<<"Altitude offset in meters: ";strout<<"Altitude offset in meters: ";print(a,0,3,7,'y');strout<<"\n";
cout<<"Datum name: ";strout<<"Datum name: ";print(a,0,5,8,'y');strout<<"\n";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,9,'y');strout<<"\n end of sentence \n\n";
}
void BWC(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" Bearing using Great Circle route \n";
cout<<"UTC time of fix: ";strout<<"UTC time of fix: ";print(a,0,10,1,'n');write(a,2,4,':',':',10,1);strout<<" UTC\n";
cout<<"Latitude of waypoint: ";strout<<"Latitude of waypoint: ";print(a,0,10,2,'n');write(a,2,9,'d','`',9,2);strout<<"\t";
cout<<"Latitude Hemisphere:";print(a,0,2,3,'y');strout<<"\n";
cout<<"Longitude of waypoint :";strout<<"Longitude of waypoint :";print(a,0,11,4,'n');write(a,3,11,'d','`',11,4);strout<<"\t";
cout<<"Longitude Hemisphere: ";print(a,0,2,5,'y');strout<<"\n";
cout<<"Bearing to waypoint, degrees :";strout<<"Bearing to waypoint, degrees :";print(a,0,3,6,'y');strout<<"\t";
cout<<"Type(T= True): " ;print(a,0,1,7,'y');strout<<"\n";
cout<<"Bearing to waypoint, degrees :";strout<<"Bearing to waypoint, degrees :";print(a,0,3,8,'y');strout<<"\t";
cout<<"Type(M= Magnetic): " ;print(a,0,1,9,'y');strout<<"\n";
cout<<"Distance to waypoint :";strout<<"Distance to waypoint( N indicating Nautical miles) :";print(a,0,3,10,'y');strout<<"\t";
cout<<"Unit( N indicating Nautical miles): " ;print(a,0,1,11,'y');strout<<"\n";
cout<<"Waypoint ID :";strout<<"Waypoint ID :";print(a,0,3,12,'y');strout<<"\t";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,13,'y');
strout<<"\n end of sentence \n\n";
}
void GGA(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" Global Positioning System Fix Data \n";
cout<<"Time:";strout<<"Time: ";print(a,0,10,1,'n');write(a,2,4,':',':',10,1);strout<<" UTC\n";
cout<<"Latitude: ";strout<<"Latitude: ";print(a,0,10,2,'n');write(a,2,9,'d','`',9,2);strout<<"\t";
cout<<"Latitude Hemisphere:";print(a,0,2,3,'y');strout<<"\n";
cout<<"Longitude :";strout<<"Longitude :";print(a,0,11,4,'n');write(a,3,11,'d','`',11,4);strout<<"\t";
cout<<"Longitude Hemisphere: ";print(a,0,2,5,'y');strout<<"\n";
cout<<"Position Fix Indicator: ";strout<<"Position Fix Indicator: ";print(a,0,2,6,'y');strout<<"\n";
cout<<"Number Of Satellites in Use: ";
strout<<"Number Of Satellites in Use: ";print(a,0,3,7,'y');strout<<"\n";
cout<<"Horizontal Dilution of Precision: ";strout<<"Horizontal Dilution of Precision: ";print(a,0,4,8,'y');strout<<"\n";
cout<<"MSL Altitude: ";strout<<"MSL Altitude: ";print(a,0,8,9,'y');strout<<" ";
cout<<"Unit: ";print(a,0,2,10,'y');strout<<"\n";
cout<<"Geoidal Height: ";strout<<"Geoidal Height: ";print(a,0,6,11,'y');strout<<" m \n";
cout<<"Differential GPS , number of seconds since last update: ";strout<<"Differential GPS , number of seconds since last update: ";print(a,0,3,12,'y');strout<<'\n';
cout<<"FAA Mode: ";strout<<"FAA Mode: ";print(a,0,2,13,'y');strout<<'\n';
cout<<"Station ID: ";strout<<"Station ID: ";print(a,0,5,14,'y');strout<<'\n';
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,15,'y');strout<<"\n end of sentence\n \n";
}
void GLL(char a[row][col])
{cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" Geographic Position, Latitude / Longitude and time.\n";
cout<<"Latitude: ";strout<<"Latitude: ";print(a,0,10,1,'n');write(a,2,9,'d','`',9,1);strout<<"\t";
cout<<"Latitude Hemisphere:";print(a,0,2,2,'y');strout<<"\n";
cout<<"Longitude :";strout<<"Longitude :";print(a,0,11,3,'n');write(a,3,11,'d','`',11,3);strout<<"\t";
cout<<"Longitude Hemisphere: ";print(a,0,2,4,'y');strout<<"\n";
cout<<"Time:";strout<<"Time: ";print(a,0,10,5,'n');write(a,2,4,':',':',10,5);strout<<" UTC\n";
cout<<"Status( A: Valid, V: Invalid): " ;strout<<"Status( A: Valid, V: Invalid):";print(a,0,2,6,'y');strout<<"\n";
cout<<"FAA mode :";strout<<"FAA mode :";print(a,0,2,7,'y');strout<<"\n";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,8,'y');
strout<<"\n end of sentence \n \n"; }
void GRS(char a[row][col]){int i;
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" GPS Range Residuals\n";
cout<<"UTC time of associated GGA fix:";strout<<"UTC time of associated GGA fix: ";print(a,0,10,1,'n');write(a,2,4,':',':',10,1);strout<<" UTC\n";
cout<<"Mode: ";strout<<"Mode: ";print(a,0,1,2,'y');strout<<"\n";
for(i=0;i<12;i++){ cout<<"Satellite "<<i<<" residual in meters :"; strout<<"Satellite "<<i<<" residual in meters :"; print(a,0,2,3+i,'y'); cout<<"\n"; strout<<"\n";}
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,15,'y');strout<<"\n end of sentence \n\n";
}
void GSA( char a[row][col]){int i;
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" GPS DOP and active satellites \n";
cout<<"Mode 1: ";
strout<<"Mode 1: ";print(a,0,2,1,'y');strout<<"\n";
cout<<"Mode 2: ";strout<<"Mode 2: ";print(a,0,2,2,'y');strout<<"\n";
for(i=0;i<12;i++){cout<<"PRN Numberof the satellite used in solution "<<i+1<<" :";//1strout<<"PRN Numberof the satellite used in solution "<<i+1<<" :";//1print(a,0,3,3+i,'y');strout<<"\n";}
cout<<"PDOP-Position Dilution of Precision: ";strout<<"PDOP-Position Dilution of Precision: ";print(a,0,5,15,'y');strout<<"\n";
cout<<"HDOP-Horizontal Dilution of Precision: ";strout<<"HDOP-Horizontal Dilution of Precision: ";print(a,0,5,16,'y');strout<<"\n";
cout<<"VDOP-Vertical Dilution of Precision: ";strout<<"VDOP-Vertical Dilution of Precision: ";print(a,0,5,17,'y');strout<<"\n";
cout<<"Checksum: ";strout<<"Checksum: ";print(a,0,4,18,'y');strout<<"\n end of sentence \n\n";
}
void GST(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');
strout<<" GPS Pseudorange Noise Statistics\n";
cout<<"Time:";strout<<"Time: ";print(a,0,10,1,'n');write(a,2,4,':',':',10,1);strout<<" UTC\n";
cout<<"RMS deviation:";strout<<"RMS deviation: ";print(a,0,3,2,'y');strout<<"\n";
cout<<"Semi-major deviation:";strout<<"Semi-major deviation: ";print(a,0,3,3,'y');strout<<" m\n";
cout<<"Semi-minor deviation:";strout<<"Semi-minor deviation: ";print(a,0,3,4,'y');strout<<" m \n";
cout<<"Semi-major orientation:";strout<<"Semi-major orientation: ";print(a,0,4,5,'y');strout<<"true north degrees\n";
cout<<"Latitude error deviation:";strout<<"Latitude error deviation: ";print(a,0,3,6,'y');strout<<" m\n";
cout<<"Longitude error deviation:";strout<<"Longitude error deviation: ";print(a,0,3,7,'y');strout<<" m\n";
cout<<"Altitude error deviation :";strout<<"Altitude error deviation: ";print(a,0,4,8,'y');strout<<" m\n";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,9,'y');strout<<"\n end of sentence \n\n";
}
void GSV(char a[row][col]){int n=0;int i;char r='0';char u;
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" GPS Satellites in view \n";
cout<<"Total number of sentences to be transmitted : ";strout<<"Total number of sentences to be transmitted : ";print(a,0,2,1,'y');strout<<"\n";
cout<<"Number of Messages: " ;strout<<"Number of Messages: " ;print(a,0,2,2,'y');strout<<"\n";
cout<<"Total number of satellites in view :";strout<<"Total number of satellites in view :";print(a,0,3,3,'y');strout<<"\n";
u=a[0][1];n=0;i=0;
while(r<=u){cout<<"Satellite PRN number "<<(n+1)<<" :";strout<<"Satellite PRN number "<<(n+1)<<" :";print(a,0,3,(4+i),'y');strout<<"\n";
cout<<"Satellite Elevation (deg) "<<(n+1)<<" :";strout<<"Satellite Elevation (deg) "<<(n+1)<<" :";print(a,0,3,(5+i),'y');
strout<<"\n";
cout<<"Satellite Azimuth (deg) "<<(n+1)<<" :";strout<<"Satellite Azimuth (deg) "<<(n+1)<<" :";print(a,0,4,(6+i),'y');strout<<"\n";
cout<<"Signal to Noise Ratio (dB)"<<(n+1)<<" :";strout<<"Signal to Noise Ratio (dB)"<<(n+1)<<" :";print(a,0,3,(7+i),'y');strout<<"\n";r++;n++;i=4*n;}
cout<<"Checksum: ";strout<<"Checksum: ";print(a,0,4,20,'y');strout<<"\n end of sentence \n \n";
}
void MSK(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" Send control for a beacon receiver\n";
cout<<"Frequency to use: ";strout<<"Frequency to use: ";print(a,0,3,1,'y');strout<<" Hz? \n";
cout<<"Frequency mode, A=auto, M=manual: ";strout<<"Frequency mode, A=auto, M=manual: ";print(a,0,1,2,'y');strout<<" Hz? \n";
cout<<"Beacon bit rate: ";strout<<"Beacon bit rate: ";print(a,0,3,3,'y');strout<<"\n";
cout<<"Bitrate, A=auto, M=manual: ";strout<<"Bitrate, A=auto, M=manual: ";print(a,0,1,4,'y');strout<<"\n";
cout<<"Frequency for MSS message status (null for no status) : ";strout<<"Frequency for MSS message status (null for no status): ";print(a,0,3,5,'y');strout<<"\n";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,5,'y');strout<<"\n end of sentence \n\n";
}
void MSS(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" Beacon Receiver Status \n";
cout<<"Signal strength (dB 1uV) : ";strout<<"Signal strength (dB 1uV) : ";print(a,0,2,1,'y');strout<<"\n";
cout<<"Signal to noise ratio (dB) : ";strout<<"Signal to noise ratio (dB) : ";print(a,0,2,2,'y');strout<<"\n";
cout<<"Beacon frequency (kHz) : ";strout<<"Beacon frequency (kHz) : ";print(a,0,3,3,'y');strout<<"\n";
cout<<"Beacon data rate (BPS) : ";strout<<"Beacon data rate (BPS) : ";print(a,0,3,4,'y');strout<<"\n";
cout<<"Unknown integer value : ";
strout<<"Unknown integer value : ";print(a,0,3,5,'y');strout<<"\n";
cout<<"Checksum: ";strout<<"Checksum: ";print(a,0,4,6,'y');strout<<"\n end of sentence \n \n";
}
void RMC(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" Recommended minimum specific GPS data \n";
cout<<"Time:";strout<<"Time: ";print(a,0,10,1,'n');write(a,2,4,':',':',10,1);strout<<" UTC\n";
cout<<"Status( A: Valid, V: Invalid): " ;strout<<"Status( A: Valid, V: Invalid):";print(a,0,2,2,'y');strout<<"\n";
cout<<"Latitude: ";strout<<"Latitude: ";print(a,0,10,3,'n');write(a,2,9,'d','`',9,3);strout<<"\t";
cout<<"Latitude Hemisphere:";print(a,0,2,4,'y');strout<<"\n";
cout<<"Longitude :";strout<<"Longitude :";print(a,0,11,5,'n');write(a,3,11,'d','`',11,5);strout<<"\t";
cout<<"Longitude Hemisphere: ";print(a,0,2,6,'y');strout<<"\n";
cout<<"Speed Over Ground (knots): ";strout<<"Speed Over Ground : ";print(a,0,7,7,'y');strout<<"knots \n";
cout<<"Course Over Ground(degrees, true): ";strout<<"Course Over Ground(true): ";print(a,0,6,8,'y');strout<<"degree \n";
cout<<"Date :";strout<<"Date :";print(a,0,7,9,'n');write(a,2,4,'/','/',6,9);strout<<"\n";
cout<<"Magnetic Variation : ";strout<<"Magnetic Variation : ";print(a,0,6,10,'y');strout<<"\t";
cout<<"Unit :";print(a,0,2,11,'y');strout<<'\n';
cout<<"FAA mode :";strout<<"FAA mode :";print(a,0,2,12,'y');strout<<"\n";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,13,'y');strout<<"\nend of sentence\n \n";
}
void VTG(char a[row][col]) {
cout<<"fix:";strout<<"fix : ";
print(a,1,8,0,'y');strout<<" Track made good and ground speed\n";
cout<<"Track degree -I : ";strout<<"Track degree -I : ";print(a,0,4,1,'y');strout<<"\t";
cout<<" Type of Track degree: " ;print(a,0,2,2,'y');strout<<"\n";
cout<<"Track Degree -II: ";strout<<"Track Degree -II: ";print(a,0,4,3,'y');strout<<"\t";
cout<<"Type of Track Degree: ";print(a,0,2,4,'y');strout<<"\n";
cout<<"Speed Over Ground : ";strout<<"Speed Over Ground : ";print(a,0,6,5,'y');strout<<"\t";
cout<<"Unit: ";print(a,0,2,6,'y');strout<<"\n";
cout<<"Speed Over Ground: ";strout<<"Speed Over Ground: ";print(a,0,7,7,'y');strout<<"\t";
cout<<"Unit: ";print(a,0,2,8,'y');strout<<"\n";
cout<<"FAA mode :";strout<<"FAA mode :";print(a,0,2,9,'y');strout<<"\n";
cout<<"Checksum :";strout<<"Checksum :";
print(a,0,4,10,'y');strout<<"\n end of sentence \n\n";
}
void ZDA(char a[row][col]){
cout<<"fix:";strout<<"fix : ";print(a,1,8,0,'y');strout<<" UTC Date / Time and Local Time Zone Offset\n";
cout<<"Time:";strout<<"Time: ";print(a,0,10,1,'n');write(a,2,4,':',':',10,1);strout<<" UTC\n";
cout<<"Day : ";strout<<"Day : ";print(a,0,2,2,'y');strout<<"\n";
cout<<"Month : ";strout<<"Month : ";print(a,0,2,3,'y');strout<<"\n";
cout<<"Year : ";strout<<"Year : ";print(a,0,4,4,'y');strout<<"\n";
cout<<"Local Zone Description : ";strout<<"Local Zone Description : ";print (a,0,3,5,'y');strout<<" hrs ";
cout<<"Local Zone Minutes Description";print(a,0,2,6,'y');strout<<" min";strout<<"\n";
cout<<"Checksum :";strout<<"Checksum :";print(a,0,4,7,'y');
strout<<"\n end of sentence \n\n";
}
PROCEDURE 6 HARDWARE TESTING
In the circuit diagram of GPS interfacing with Microcontroller there are 6 jumpers for power distribution, they have arranged for GPS receiver, Microcontroller and LCD power supply which are as follows:
a- 2 jumpers of 3.3 v dc for input supply to the GPS receiver, pin no. 7 and MAX 232, pin no. 16.
b- 3 jumpers of 5 v dc power supply to AT89C52 Microcontroller, 2 lines LCD, MAZ 232 converter.
c- 2 jumpers used for communicating the TX and RX signal for one MAX 232 converter to another MAX 232 converter.
According to our specification data sheet of Lassen SQ GPS receiver part no. (46240-00), we require 3.3 ± 0.3 v dc input for receiver module and +5v dc supply for Microcontroller and LCD.In the testing phase we test the power supply (a) by the multimeter (AC/DC) and got it power of 3.0 v dc, which is correctly match the our data sheet of GPS receiver module and 4.97 v dc supply for (b), (c) respectively.
PROCEDURE 7SOFTWARE TESTING:The testing of software component mainly performed on the desktop computer with simulator. Each individual subroutine of he software has been simulated on top view simulator. The serial communication program has been simulated on simulator and a stream of data has been taken from the .dat file while the LCD part and data extraction part also separately tested on the same simulator. The bytes are received by the
microcontroller and the information of position is extracted by the controller and the longitude, latitude and altitude information is shown in the LCD
NO
YES
Flow Chart 1 Single GPGGA Sentence Display on LCD
START
READ DATA SET FROM GPS GPS RECEIVER
If GPGGA
Extracting information and arrange
Print relevant information on LCD
END
PROCEDURE 8
Flashing the program code in 8052 Microcontroller through Programmer.
PROCEDURE 9 INTEGRATED TESTING
in the whole integrated testing of the designing is basically depends on the two communication , first is communication with initially max 232 converter of Lassen SQ based to desktop pc and last communication with two MAX 232 to the LCD.In this process we take out three flying leads of first MAX 232 converter output lines TX, RX and GND. After that MAX232 output connection connect with DB 9 pin female connecter by 1:1 connection. The communication checked by the two software TSIPCHAT and IQ-MONITOR and procedure is as follows:
Procedure for setting NMEA output on Lassen SQ Module1) Use TSIPCHAT software from Trimble.Start by running it from a command prompt under Windows 95/98/2000/XP as:tsipchat.exe –c1Where c1 is for COM1, -c2 is for COM2 etc.
2) The Lassen SQ ships with the following default settings:Baud rate: 9600
Parity: OddStop bits: 1Protocol in: TSIPProtocol out: TSIPIn the TSIPCHAT software, hold down the SHIFT key and hit U to get the ‘Port Configure’ screen up. Use the spacebar to toggle between settings and enter to select setting.
Set the software to the default settings and say yes to ‘change PC configuration to match’. After this, you will see TSIP data onthe screen as above.
3) Change NMEA output stringsThe NMEA configuration screen is accessed by pressing q. Hit space bar to cycle to ‘set’ and press enter. By pressingCycle and enter, choose the strings that you require as per picture below:
4) Next, we want to change from TSIP output to NMEA output. This is done by holding down the SHIFT key and hit Uto get the ‘Port Configure’ screen up again.We want to change to the following port settings:Baud rate: 4800Parity: NoneStop bits: 1Protocol in: TSIPProtocol out: NMEA
Afterwards, you should see NMEA strings on the screen. In the above example, I only chose to output the RMC string.
5) Lastly, we want to save the new settings to the EPROM on the Lassen SQ. If we did not do this, the Lassen Sq wouldlose these settings once power was removed.To save the settings to flash in TSIPCHAT, press the ‘equals’ sign to get to the super packets menu and press the‘enter’ key as shown below.
The software will not respond saying the write is ok, as the SQ is set to NMEA output (and the SQ can only talk to theTSIPCHAT software when it is set to TSIP output.To verify that this has worked, unplug the Lassen SQ from the baseboard/starter kit etc for 10 minutes. Then, refit the unit andsee if it still outputs the NMEA strings as above.PROCEDURE 10
Extract the NMEA 0183 sentence in terms of x, y; z coordinates on the 2 line LCD
CONCLUSIONS AND FUTURE WORK:
The main objective of this interfacing to determine the position of the point with respect to the GPS based module. In order to achieve this objective, there are some sub objectives as follows:Power consumption is a key factor in a hardware setup. This setup has been designed to consume few watts of power as the GPS embedded module and GPS antenna consumes only 100mwW and 133mA at 3.3 v. Power consumption of the other devices and component is the prototype is also low.
Cost is also one of the prime factors in any design processes. During the design process, it has been strived to maintain a respectable prototype cost. If this device is to make it to the production line, the cost of this device would be reduced dramatically to ensure its competitiveness in the market place due to the fact that it would be an integrated custom PCB device that has an on board GPS module, LCD and other components.
Further work regarding the GPS based module can include other additional components as keyboard, alarm with their additional integrated software programming.
REFERANCES:
1- Mazidi, M.A. (2006), “The 8051 microcontroller and Embedded system”, Pearson Hall, New Delhi.
2- Sirf NMEA reference manual (2005), available at http://www.sirf.com3- Lassen SQ GPS system designer reference manual, (2005) available at
http://www.trimble.com4- Ma Chao & Lin Ming (2003), “GPS GSM mobile Navigator”, Atmel Application
journal, pp 20-265- Novatel GPS reference manual, (2007) http://www.novatel.com/support.com6- Universal general purposes experiment board a manual available on
www.spectrocamindia.com7- Embedded system engineering (ESE), May 2005, Volume 13.3basco, reference
manual available at www.sbs.com/AMC.8- BASCOM basic c compiler of 8051, version 1.00, available at www.sistudio.com.9- Kiel compiler/ assembler to writing code available at www.kiel.com.10- MIDE – 51 assembler .version 1.00, july 29.08 ,available at
www.mide.com/assembler