Oracle Blog

David G. Simmons' Weblog. Mostly about Sun SPOTs

The GPS SPOT

I've finally finished working on the Sun SPOT Installer -- an experience I don't really wish to repeat -- and have had some time to go back to working on some Sun SPOT applications. This is what I'd much rather do, really.

So I ordered a bunch of parts from Spark Fun Electronics which, if you've never been there, is a really cool site. They have a great selection of very inexpensive sensors and gadgets and gizmos. So I ordered a bunch of stuff. The GPS Unit I got was even relatively cheap. A nice SIRF III unit, I couldn't wait to get it hooked up but was a little worried about the complexity.

I had met with a potential customer that had a grad student working on hooking up GPS units to Motes, and he had been at it for a while without much success, so I was not actually all that hopeful. Ah, ye of little faith!

Turns out that this unit puts out it's data as ASCII formatted NMEA Messages. Basically, a comma-separated message containing all the GPS data. So I had to get to a UART on the Sun SPOT. Arshan provided me with a hacked sensorboard firmware that gave me access to the on-board UART through a couple of the Digital I/O Pins on the board. Never one to be intimidated by stuff I know very little about, I plunged ahead.

I got the schematic for the GPS Unit and did a temporary wiring job using jumper wires, and wrote a quick bit of software, and ... guess what? It worked the first time!!! I got NMEA messages immediately. But what did they mean?? Well, luckily, there is a Reference Manual that explained how to interpret the messages.

Turns out that the hardest part of the whole project was going to be parsing the messages. Actually hooking up the GPS unit and getting data was dead-simple and took me less than an hour to hook it up and get data off of it. I'm currently only parsing the GPGGA messages, though I have parsers for all of them built in to the unit now. After I was sure it was working properly, I constructed a proper GPS SPOT. Check it out:

So that's the GPS unit hot-glued on top of a Sun SPOT (I drilled a hole in the 'Sun Roof' for the wires to go through) and it looks pretty cool!