Friday, June 11, 2010

GPS

BACKSTORY:
Back sometime in 2006 I had a Nokia E70-2 cellphone that seemed pretty advanced for it's time, and it was. It had Bluetooth and Wi-Fi and an Internet browser. Very shortly after purchasing the phone I decided that I wanted to use it's "GPS" features. These features could be accessed via an external, Bluetooth adapter and Nokia sold one such model for way too much money. I decided on buying a Bluetooth-enabled Holux M-1200 model. Although the GPS unit worked, the phone had poor support for it and the GPS unit lived in a dark box somewhere... until recently.

THE GOOD STUFF:
The Holux M-1200 GPS unit also had a "GPS Mouse" feature. In nerd-speak (my language) this meant that it was very possible that there was a serial-connection available to the unit that could be used to connect to it to use it's GPS data. Holux sells a cable for $20 or so that would allow access to this feature. However, upon investigation, I was able to determine that the cable would be no different than the FTDI cable that I used with my BoArduino. The BoArduino has a serial port but at the much lower +5 TTL levels. Normal RS-232 voltages would kill it as the the standard uses +12V and −12V (or plus or minus 3 to 15 volts.) My FTDI cable used a USB port and provided a serial port at +5 TTL levels on the other end (Model TTL-232R-5.0v) I tested the outputs of the Holux GPS unit and was able to determine that it used +3.3v logic levels, but not +5v logic levels. I did some research on the FTDI cable and the Arduino chip (ATMEGA328P) and discovered that data could be received from the GPS unit safely as a "1" from the GPS unit would still be recognized as a "1" by the Arduino. Transmitting back to the GPS at the higher logic level (5v vs 3.3) may damage the GPS unit so I only hooked up the receive as that was all that I really needed. The GPS unit may have been able to tolerate the higher voltage coming at it but I decided that it wasn't really all that important to be able to talk to the GPS at this point. In the future I may use resistors or a logic-level-shifter to communicate with the GPS.

MOVING ON:
So, after hooking the mini USB plug end from one of those "universal USB cables" and then to the Arduino/FTDI, I was able to test the GPS unit. It worked and I then connected it to the Arduino and was able to see GPS strings from the unit. I soon found the TinyGPS Arduino library written by Mikal Hart. This quickly enabled me to interpret the GPS strings from my device (although I would like to create my own library that can interpret more types of GPS strings.) TinyGPS was easy to use after reading through the code and it got me up to speed pretty quickly. For the second part of the project, I wired in a Serial-LCD that I got from Sparkfun. I put together some Arduino code (sketch) and had the Arduino output the longitude and latitude, bearing and GPS time (+8 hours for my time zone) to the LCD screen.

The next 3 hours involved walking around my block with what essentially looked like a bunch of wires and glowing lights on a clipboard. Later on I made my first attempt at GEOCACHING... however, the coordinates from geocaching.com were NOT within the 1 mile radius that I requested. Seeing the signs for customs to Canada quickly encouraged me to do a reality check on those GPS coordinates and they turned out to be for CANADA! Next time I begin, I'll remember to do a reality check. :)

Thanks to Awesome Electronics Workshop w/ Joe Grand and Bre Pettis for the inspiration for this project.

REFERENCES:
http://blog.makezine.com/archive/2007/07/integrate_lcd_and_gps_mod_1.html
http://www.geocaching.com
http://arduiniana.org/libraries/tinygps/
http://arduiniana.org/libraries/newsoftserial/
http://en.wikipedia.org/wiki/RS-232
http://www.gpsinformation.org/dale/nmea.htm
http://www.sparkfun.com/datasheets/GPS/NMEA%20Reference%20Manual1.pdf
http://www.sparkfun.com/datasheets/LCD/SerLCD_V2_5.PDF


No comments:

Post a Comment

Keep it clean. :)