Thursday 7 July 2011

PIC Basic-Interfacing with Polstar GPS

PIC Basic - Interfacing With Polstar GPS PMB-688 Having SiRF starIII IC   PRO134
Global Positioning System (GPS), now a days, is a widely found feature in a number of consumer goods. GPS is used for navigation and tracking and is available in cars to wrist watches. A number of educational and fun projects can be built using GPS modules. GPS modules are available in very small sizes 1 cm x I cm to larger sizes like 4cmx4cm. Most of the module comes with 4 to 6 wires and hence building the project is relatively simple. But getting it working is not that easy unless you have access to right information. The purpose of this project is to do exactly the same. Provide you with the right info in a concise fashion.
It is good to know a little bit about what GPS is and how it works before starting to work on the project. In essence GPS is a small module that directly receives signals from multiple GPS satellites using a small antenna. These GPS satellites are positioned around the globe and available pretty much every part of the world. The module processes the information received through the antenna and outputs the current time and date, current position (longitude and latitude), speed at which the module is moving and the altitude at which the module is currently located, in a text string format. Life is easy, just take this string and parse it to get all the info you want and use it in whichever way you want. The text string is output in standard format following NMEA standards, which is pretty easy to understand. To get additional information about GPS we strongly recommend you to read the following links:
In this project we are going to build a position information system that will display NEMA standard strings on an LCD display. We will use a PIC microcontroller 16F877A to receive and process the NMEA strings and POLSTAR PMB-688 as GPS module. This module comes with patch antenna (antenna stuck on to the top of the module) and also has provision to connect external antenna. The module was able to locate one satellite inside my room (second floor apartment room in Chennai, India) without an external antenna. When I moved to balcony the module was able to tune to three satellites.
PMB-688 has six terminals, of which two of them are for power supply; as soon as you connect them to a supply (3V -5V) as LED start blinking indicating that it started working. You can interact with GPS using two protocols viz UART and RS232. Using both protocols you can configure the GPS to filter out certain type of messages. If no configuration is done the GPS will start sending out NMEA message in default settings. In this project we are using UART as this protocol and it is supported by 16F877A.
UART uses one wire for transmission and another for receiving data at programmatically set baud rate. The default baud rate for PMB-688 is 4800 hence the PIC need to be configured to receive at 4800 Kbits/sec. Refer code to see details. Refer to 16F877 datasheet for more details on UART settings. The data from GPs can be read from the UART registers in poll mode or interrupt mode, In this program we are using interrupt mode to read data from the registers. If you are NOT planning modify the default settings of the GPS you need to connect only the TX (transmit) wire of the GPS to the RX (receive) pin of the PIC. See circuit diagram for details.
We are using a two line LCD JHD162A for displaying the NMEA strings. See project Three Wire Interfacing With an LCD Screen JHD162A for more details on this.
Youtube Demo
Login to see tips, download datasheets and view code
Downloads
  1. Download the datasheet for PIC16F877A to get a good understanding of other details of the microcontroller.
  2. Download the datasheet for PMB-688 to get a good understanding of other details of GPS Module.
  3. Download the NMEA Specification to get a good understanding of NMEA specification.
  4. The compiled HEX file. (this can be directly burned into your PIC) click here
TIPS
  1. Ensure that all unused pins of the PIC are set to output. Any unused pin set as input and left floating causes to create garbage in NMEA output string.
  2. Login for More...
Click to view PIC code
The C compiler used for this project is Hi-TECH light


LIST OF PARTS USED IN THE PROJECT
REFPART TYPEPART NAMEVALUECOUNTINFO
 Bat1BATTERYPACKBattery Pack 12V AA12V1See Picture
 C1,C2CAPACITORCapacitor 100n100n2See Picture
 C3,C4CAPACITORCapacitor 27pF27pF2See Picture
 C5,C7ELECCAPACITORElectrolytic Capacitor 220uF220uF2See Picture
 C6ELECCAPACITORElectrolytic Capacitor 0.1uF0.1uF1See Picture
 Cr1CRYSTALCrystal 10.0 MHz10MHz1See Picture
 GPSGPSMODULEGPS Polstar PB-688688PB1See Picture
 IC1ICPIC16F877APIC16877A1See Picture
 IC2ICIC LM78057805IC1See Picture
 IC3,IC4ICIC 7417474174IC2See Picture
 LCDDISPLAYLCDLCD 16x2 JHD162AJHD162ALCD1See Picture
 PCBPCBPCB Gen Purpose DD 4x34x3inch1See Picture
 POT1POTPot Meter 10K10K1See Picture
 R1RESISTORResistor 10K10K1See Picture

Approximate cost for building this project is Rs 3741.00

Note: In addition to the above components you may also require a breadboard and power supply / batteries for building this project.

Post a comment or question
Be the first one to make a comment or suggestion on this project:
Post Type:
Comment:
 Please login to post a comment or question 
Click here to login or register

No comments:

Post a Comment