Thursday, December 14, 2006

iGPS Schematic

iGPS circuit diagram (click for full):

Some stressing, a few all-nighters, and a dream...

Against all odds, the iGPS came together in time for its demonstration. A source position is set using the clickwheel, and three display options, distance to source (m), time of trip, and velocity (m/s) are selected by turning the clickwheel. Cardinal directions to the source location are given by the four red LEDS between the display and the clickwheel, and the led to the right indicates whether or not the GPS device has a satellite fix.

The project is based around the Freescale 9S12C microcontroller. All coding was written in assembly using ASMIDE.

The weekend before the demo, we were walking through Target looking for an appropriately sized box to house our future project. Tupperware containers, tissue boxes, all considered, until we stumbled upon the iLamp. Apparently, this is an iPod integrated lamp, which we figured was just about the dumbest thing we've ever heard in our lives.

Naturally, we had to run with it.

We hit up Radio Shack and bought a project case with a metal grounding plate which we used as te project's actual back plate for that iPod feel. We painted the case white, drilled some holes for indicator lights and mounted a light dimmer switch 'clickwheel.' The dimmer was gutted for independent potentiometer and pushbutton functions.

The Lassen iQ GPS module from sparkfun.com arrived just before Thanksgiving weekend, giving us enough time to figure out the protocols before the real work began. The unit provides two serial outputs, with two choices of proprietary Lassen protocols on one port and NMEA on the other. NMEA requires no configuration and is the standard protocol for nearly all GPS hardware, so we went with it. GPS data is transmitted as a comma delimited ASCII string with coordinates as DDMM.mmmm.


In the meantime, Eric was hard at work on the SPI display. This proved to be little challenge and was integrated into the project with very little difficulty. We had a few large 7-segment displays laying around which we thought would work well, although soldering all... like... 39 pins turned out to be just about the biggest hassle in Ian's life. We're making the claim that this is the only GPS device ever built sporting 7-segment displays.

The most challenging problems we encountered were the conversions from hex to decimal and decimal to hex. This seems like it should be a relatively simple switch, but it took nearly a day to figure out. The GPS receiver transmitted data as ASCII strings, which were stored in memory as packed BCD numbers. Without a conversion, the squaring and square roots required to calculate distance and division to calculate velocity would be impossible. In the end, it all started working.

The last night of the project was a long one. Shown to the right is the first working prototype of the iGPS in a much larger housing. The space required by the microcontroller, PLDs, and SPI required three separate breadboards.








Testing the iGPS on a really cold December night.












The complete circuit












The SPI, bound in electrical tape.












Friday, December 1, 2006

Project Expense Update:

12 Channel Lassen IQ GPS Receiver with DGPS
$49.95

Lassen iQ Evaluation Board - RS232
$29.95

Antenna GPS Ultra-Compact Embedded HFL for Lassen IQ
$14.95

Shipping:
$3.83

Current Total: $98.68

NMEA: Protocol of Choice

After two days looking at serial dumps from TSIP and playing with Windows calculator, NMEA is the protocol of choice, it seems.
Why?
ASCII

NMEA Format:
$GPGGA,hhMMss.ms,XXXX.XXXX,D,XXXX.XXXX,D,otherdata

The important part here is the XXXX.XXXX,D, which are latitude, longitude, and direction (N/S, E/W). No floating point conversion necessary. Thanks Trimble.

The Trimble GPS unit gives three different output modes, TSIP (binary data), TAIP (ASCII), and NMEA (ASCII). TAIP seems somewhat difficult to configure, but NMEA transmits latitude, longitude, time (in a usable format), and direction right out of the box.

TSIP seemed to be the method of choice because of the output options it allowed (in particular, coordinates in XYZ), but working with floating point data might be a little out of the scope of this project.

NMEA transmits by default at 4800bps, so the SCI baud rate had to be changed from 0x009C to 0x0138. NMEA does not provide XYZ coordinates, so, no easy calculation of meters, but we're confident we can assemble some sort of reasonable approximation from latitude and longitude.


In an hour or so, Zach whipped up a simple prototype that correctly read in latitude and longitude data in packed BCD format, set this data, and provided the direction (North, South, East, West). It worked reasonably within the confines of his room.

Maybe someday we'll buy batteries.

Blue Team: It Begins

After considerably debate, we've finally settled on what exactly our project is going to do. The GPS receiver is connected to the microcontroller using the SCI. The data is received using the NMEA protocol, typically used for navigating ships. This information is converted from it's standard ASCII output and loaded into memory. A button or dial allows a current position to be set, and the device outputs direction and distance to the set position, or possibly to other presets.