Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

GPS recommendation

Status
Not open for further replies.
I want to get into using GPS with my projects. Can someone please suggest a good, inexpensive GPS module to get started with?

I'm using PIC 16F uCs, and I code in assembly. I plan to really only need GPVTG (course over ground and ground speed) and GPGLL (Lat and Long). Is there a way to make the module stop sending all the other NMEA sentences -- I just don't won't to have to program ignoring the other ones.

How hard are these devices to initialize. I know I spent a while getting my asm program to properly initialize an RFM12B RF transceiver, but this looks much easier. It almost looks like as long as the module can see the sky and I have the PIC's UART working correctly, then I'll be seeing NMEA sentences. Is it really that easy?
 
GPS modules tend to be overpriced. USB and bluetooth GPS are cheaper and readily available. Many older handheld GPS have serial connections, that's mostly been replaced with USB on more recent models. (older models tend to be less acurate as well.)
 
Thanks for the replies guys.

Blars:
Can you tell me more about USB and Bluetooth GPS and how the differ from the GPS modules we are talking about? It seems to me like they are just a GPS module with added features, but I'm really ignorant in that respect. Can you please explain how they differ from say the modules that sparkfun has, why they are cheaper, and perhaps provide a link? Thank you.
 
Different interface, and they include case and power supply of some sort if it isn't purely usb. They are cheaper for the reasons many consumer products are cheaper than the main part -- mass production and lack of needing to support and document a complex part. **broken link removed** is a surplus place that frequently carries them, they only seem to have one $16 usb model at the moment.
 
I have a Venus module from Sparkfun that works very well. I got it from their free day. It's not that cheap, but cheap is relative.
Venus GPS with SMA Connector - SparkFun Electronics

I've also ordered this, and should get it soon. It shipped almost 2 weeks ago:
Cheap and easy SMS via GSM for your MCU - Hack a Day
**broken link removed**

EDIT:
For the Venus module, ya, it just sends NMEA records over UART. It's that easy. I don't think you can limit to just specific codes. Ignoring other sentences is not hard, and I stole code from an Arduino library and some other libraries for NMEA decoding. Cold and warm start wait times are in the datasheet. Just over a minute maybe for cold startup.
 
Last edited:
Thanks for the info guys.

That GPRS module is just cellular wifi if I'm not mistaken, not actual Global Positioning, correct? On the hackaday link is he just saying to get this module and tap in to the PL2303 on the PCB directly so that you can use it in an embedded system versus with USB on the computer? From there do you just throw in a SIM card and use the AT+ commands that is common to GSM modules and start sending text messages?
 
I've done a couple of GPS projects. Most GPS modules will output several strings. Although I think that they can be turned off, but I've just coded to wait for the $GPRMC or whatever. The meaning of all the numbers within a NMEA string depend on their position in the string so you need quite an involved bit of code to read the string anyhow, and there is very little extra complication in just waiting for the correct string. That is certainly easier than writing the code to tell a GPS module to stop sending the other signals.

$GPRMC has course, speed, lat and long in one string. The speed is in knots, but one multiplication is easier than reading a whole second string.

You can bypass the PL2303 so that you can send signal directly to the GSM modem, or you could buy a Telit module or similar.

It is still quite a lot of work to compose the text messages. I have done it with a 16F pic, but I found that a more powerful processor makes things much easier.

I have some uncased versions of these **broken link removed**. I think that they cost me $30 so you could have some for that plus postage if you want.

I'm attaching code that runs on an 18F pic. It is needs to be called repeatedly as it returns very quickly so that it can be run in a multitasking environment.
 

Attachments

  • gpsrmc.asm
    13.1 KB · Views: 130
Thanks for the info and example code Diver. I think the postage from the UK to the US would be steep, so I think I will hold off and see what I could come up with more locally. Thank you for the offer, though. May I ask you to share the GPS code on the 16F? That's all I program with, so I'd hope to not have to learn a new set of microcontrollers for the project.
 
Here is the code that decoded the strings on a 16F. It's 5 years since I did anything with it, and I don't know if there are any other subroutines that are needed for it, like multiply. I can't find the origianal program that included it.

The code also needs to be called lots of times as it is intended to be used in a PIC where other processes are running so it can't just hog the processor while waiting for more data.

Due to the limitations of the 16F, the programme has to decode the GPS strings as they arrive, rather than store the whole string and decode that. If you use a more powerful processor, you could store the whole string and decode it, which would certainly be easier to test on the MPLAB SIM. I had to change from a 16F to an 18F because I ran out of space, and then had to move onto a 24F.

The 24F pics do have a lot of nice features. To move an indexed array of data to an other indexed array using a loop in a 16F takes about 52 clock periods per byte and the loop is 12 lines of code. In a 24F, the same task takes 1 clock period per byte (16 bits moved every 2 clock periods) and the code is 2 lines long. Multiply and divide are also useful at times.

I have just noticed that I originally programmed it to decode the $GPGLL and $GPVTG strings. Hovwever, if you want MPH you have to scale the speed as it is in kmh or knots. I later decided to use $GPRMC which has all the information from those two, as long as you can handle the speed in knots.

I've since added $GPGGA decoding to get altitude and HDOP. That code is all in 24F pics.
 

Attachments

  • gps_decode.asm
    10.9 KB · Views: 130
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top