A cheap, functioning GPS

IMG_20140502_211444

I have to admit, I was quite sceptical this would all work. Firstly, the GPS chip that I am using has minimal documentation and the pinout is only available from a previously mentioned blog post.

Secondly, the antenna I used is actually a bluetooth antenna from a 2009 Mac Mini. It works alright, getting a fix in under several minutes which then wanders at a speed of about 0.5km/h. The accuracy is good too, better than I expected; two or three meters while indoors.

Here is a gallery showing the connections with the case:

Only 4 pins were used in my project. Ground, VCC, TX, and RX. Ground went to ground, VCC to 3.3v (I didn’t want to risk even trying to hook it up to 5v), TX to pin 2, RX to pin 3 (although most GPS units are hooked up with the TX and RX pins reversed). Here is the pin layout.

The hard part was trying to figure out how to hook it up using the software. The Arduino Uno can only receive and send through one serial connection. This meant that if I was to hook up the GPS, that I would not be able to see the output on my laptop. This problem was overcome by using the SoftwareSerial.h library, which is included with versions of Arduino 1.0 and up.

The first thing I had to do software wise was install the TinyGps library. This was hard to do as the creator’s website was iffy at the time. I ended up downloading it from github and renaming it to get rid of the dash and numbers before putting it into my library folder. Thanks to Mikal Hart for his galvanizing effort!

I used one of the examples (test_with_gps_device) with a few crucial changes:

/* This sample code demonstrates the normal use of a TinyGPS object.
It requires the use of SoftwareSerial, and assumes that you have a
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/

TinyGPS gps;
SoftwareSerial ss(2, 3);

As you can see, the pins 2 and 3 are defined to be used with the software serial. And in the void loop():

Serial.begin(4800);

and

ss.begin(9600);

Basically these two lines are the ones that had me scratching my head for a bit. The first serial begin opens a port between the computer and the Arduino. If you hit Ctrl+Shift+M you will need to select the 4800 baud rate. The second line opens up a software serial port with a 9600 baud rate to the GPS, (which is what the GPS uses).

IMG_20140429_224004

If your project does not work, don’t fret. I had lots of trouble getting this darn chip to work. If you see Chars from RX this is good. That means that any moment you should get a fix. If you see Chars and Checksum fail, this is bad. Maybe you’ve got the wrong baud rate for the card. If you don’t get any Chars at all, that means the chip isn’t connected or the antenna is causing the chip to fail (a short circuit would cause that).

I also tried out a dipole antenna with no luck. It worked (near instant fix), but the position kept moving 300+ meters per second. Not recommended.

Vladislav Pomogaev

I'm a highschooler who is interested in technology, science, and engineering. In my spare time I work on projects that allow me to learn new skills and concepts. - Vlad

4 thoughts on “A cheap, functioning GPS

  1. How did you fix the checksum errors? Im getting RX chars and some fails – mine GPS just arrived, I haven’t changed anything. Is the default rate really 9600?

    1. The default rate should be 9600 baud. Mine was, and I haven’t changed it. Be sure you have the TX and RX the right way (switch them).

Leave a Reply

Your email address will not be published. Required fields are marked *