Tuesday, October 26, 2010

Using the GeoShield to build an Open Source Hardware GPS

I've been trying to get a GPS sensor working with my Arduino for a long time. And without fail, they just don't work. Don't get me wrong - the ones that other people have made work, but they're spotty, and you have to be in the right corner, the right place at the right time. And if a leaf flitters off a tree at just the right time, the dew moisture creates enough interference that the signal's lost. And just when the signal comes back, it fails again just as quickly and then I barely get enough data points to recreate anything interesting.

Not any more >:-)

There may be cheaper GPS shields out there, but that's not the point. The point of the GeoShield is that it works, and it's competitive with commercial off-the-shelf GPS's. Out of the box. No coding, no digging around, it just works. And if you combine it and a TouchShield Slide, you have a completely portable DIY GPS... that is as powerful as most of the mainstream GPS's out there you can buy off the shelf.
This is the only GPS shield I've been able to test reliably in cities, from cars, and inside cases. So the steps to create an Arduino GPS with the GeoShield are pretty straight forward. You'll need:
The Lithium BackPack goes in back of the DoubleWide ExtenderShield next to the Arduino, and the TouchShield Slide and the GeoShield go on top. Like this:

Here's a side angle:
And here's a funky perspective shot:
As you can see from the pictures, the GeoShield has a GPS sensor smack dab in the middle of the shield, with retro wireless solder pads emanating from it, as if to replicate a 1940's moving picture radio tower. On top of the GeoShield are a line of 4 user-controllable I/O pins (for debugging, of course), and then a GPS Rx and Tx pin, and finally a power white LED that tells you when it's powered up and has a signal. It's specifically designed this way because of all my hours of frustration with other GPS shields, wondering, "Does this thing ever work? Is it even powered on?" So this shield is designed to eliminate variables quickly, and get you up and running as quickly as possible. Oh yeah, and it also has a built in 3-axis accelerometer and compass, so it deserves it's name, "GeoShield".

Here's a link to the Open Source App Store app code that shows off a simple Night Rider program, plus polling of the GPS, Compass and 3-axis Accelerometer. The heart of the code is built into the Antipasto Arduino IDE function set:

void loop() {

   gps_msg = geo.readGPS();
   /* Print the GPS data */
   /* Parse GPS data and send to the PC */
   //for (int i=0; i< strlen(gps_msg); i++) {
   //  handleGPS(gps_msg[i]);

   /* Print the Compass heading, Accel X, Accel Y, Accel Z data */
   sprintf(out, "$GEO,H%d,X%d,Y%d,Z%d\n", comp, x, y, z);  
comp = geo.readCompass();
x = geo.readAccelX();
y = geo.readAccelY();
z = geo.readAccelZ();

//   delay(100);
   Sensor.print("co", comp);
   Sensor.print("xa", x);
   Sensor.print("ya", y);
   Sensor.print("za", z);

Here's a video showing it off:

The coolest part is that if you load up the pass-through sketch onto the Arduino, you can uncomment the coupe of lines that say, "print out to the PC", and then you can plug it in, load up a program like GPSFox, and get this:
Voila! Proof that it works - even from inside a friend's apartment!

Justin just uploaded the GeoShield over onto the Liquidware Shop, here...


Rich said...

Any interest in adding on XML parsing to display geocaching data files?




Unknown said...

Nice project!

Do you know the approximate battery life with the setup?

Unknown said...

Awesome! Just added these components to my wish list. :) Question: where I can get GPSFox? All the google results I'm getting are some german company and an app for Android/Blackberry...

Unknown said...

To get the knightrider sketch to compile I had to add the AFSoftSerial header to the HardwareSensor directory. Any idea why that is?

Unknown said...

I too am looking for the GPSFox mentioned. A link would be nice.

mschaub said...

GPS Fox can be downloaded from Pololu's website here:


flakefrost said...

that's awesome! the next project should be a wifi sniffing tool. integrating signal strengh, ssid and geolocation while logging and mapping each node :)