Showing posts with label GPS. Show all posts
Showing posts with label GPS. Show all posts

Friday, April 16, 2010

UPDATE: Converting GPS Serial Output to TTL levels

I ordered a sample ADM232A which is a high-speed CMOS RS-232 Driver/Receiver. The chip was designed to take an RS232 signal and convert it to TTL levels and vice-versa. While our implementation using a rail-to-rail op-amp worked, the ADM232A is specifically designed to handle this task. I wired the circuit as shown below.


Using a function generator, I provided a 12 V peak-to-peak signal at 4800 Hz (the same signal as the output from the GPS we are using) as a simulated RS232 input. The output signal was from 0 - 5 V and inverted. The oscilloscope measurement can be seen below. The blue line is from the function generator, and the yellow line is output from the ADM232A.



Overall, I would recommend that we use the ADM232A instead of the op-amp solution. The ADM232A has very low power requirements (as configured, I measured the current draw between 2 - 3 mA), and it was made specifically to solve our RS232 - TTL voltage issue.

Monday, April 5, 2010

Converting GPS Serial Output to TTL levels

Not realizing the output voltage of the GPS we are using, I wired it directly up to our new Arduino. After three hours of it not working, it occurred to me that the voltage output may be at RS232 levels (plus or minus 3 to 15 volts) instead of TTL (0 through 5 volts) levels. A quick check on the oscilloscope confirmed that the Garmin unit we are using outputs at plus and minus 6 volts. I ordered a sample of an ADM232 which converts between RS232 levels and TTL levels. Temporarily, we are using an OPA2350 rail to rail op amp to limit the output from 0-5 volts. This solution works, and we are now able to read NMEA data through the Arduino.
Here is the schematic of the circuit that we are using:

Tuesday, March 9, 2010

Reading NMEA data from the Garmin 76CSx

Knowing that the Garmin 76CSx is capable of outputting NMEA data, I needed to figure out how to obtain such data in a way that is easy for a microcontroller to process. The 76CSx has 2 ports on the back: a USB port, and a proprietary serial port. Without any modifications, ussing PuTTY to establish a connection via USB failed. The reason for this is USB is, although a serial connection, is not a true serial port. A workaround to this problem is to use a program from Garmin called Spanner. Spanner creates a virtual serial port from a USB port, and allows a terminal session to send/receive data over USB. Although Spanner is not officially supported by Garmin for use with the 76CSx, it worked perfectly and NMEA data instantly filled my terminal window. While this established that it was possible to read NMEA data from the unit, it does not meet my requirement of being able to read the data from a microcontroller as Spanner requires Windows to run. The obvious solution would be to try reading from Garmin's proprietary serial port, but the cable is $40! Before I spend any kind of money on a glorified (simplified actually, the Garmin connector is only 4 pins) RS232 cable, I wanted to make sure that I could get the data I needed from the serial port.

Using the diagram below, I attached the 76CSx to a logic analyzer.



The waveform I captured is below.

The way NMEA data is formatted dictates that each command should begin with a dollar sign followed by a name identifier that is specific to the type of device; thus, the first 3 characters of each message should have been "$GP" without the quotes. Translated form ASCII to binary, the expected result is "0010 0100 X 0100 0111 X 0101 0000 X" where "X" is a stop bit. If you take the time to analyze the output from the logic analyzer, it does not appear that I received the correct data at all. There may be something I don't know about this type of serial connection; for example, the data may be sent last bit first, or I my waveform may be from the middle of a command etc.

Since I was encouraged that SOME kind of data was being output, Matt and I decided to fashion a very crude Garmin -> RS232 cable (not anything close to a permanent solution, we literally held the wires with our fingers), and see what happened. The attempt was successful and once again, I saw a terminal window fill with, what appeared to be, valid NMEA data.
(Pictures soon to follow)

Knowing that we could now use the Garmin serial connection, I decided to make a more permanent Garmin -> RS232 cable. I found a website that will send you a custom made, injection molded, silicon connector for any Garmin model, as long as you promise to send them some form of compensation The average user sends a paypal payment of $10, but they will accept other amounts. (tangible goods are also accepted). I ordered 2 plugs and will document the construction of my cable when they arrive.

Friday, February 19, 2010

NMEA 0183

NMEA 0183 (or NMEA for short) is a combined electrical and data specification for communication between marine electronic devices such as echo sounder, sonars, anemometer (wind speed and direction), gyrocompass, autopilot, GPS receivers and many other types of instruments. It has been defined by, and is controlled by, the U.S.-based National Marine Electronics Association.


Link to the wikipedia article.
Arduino NMEA device driver library.

Wednesday, February 17, 2010

Possible Contol System Components

Arduino USB Board
  • Used as the central microcontroller of the boat
  • Open source hardware
  • Open source software
  • Very large community support
  • Wide range of accessories
  • Low cost ($30)
  • Link to page at sparkfun

ArduPilot - Arduino Compatible UAV Controller w/ ATMega328
  • UAV controller for use in unmanned cars, planes, and boats
  • Plugs directly into the Arduino microcontroller
  • Comes with an unmanned vehicle operating system that is FOSS
  • Has an socket for a GPS receiver
  • Low cost ($25)
  • Link to page at sparkfun

20 Channel EM-406A SiRF III Receiver with Antenna
  • GPS receiver used with ArduPilot
  • Antenna included
  • Small form factor
  • 1 Hz update rate
  • 5 Volts
  • Very well documented
  • Link to page at spakfun

Official Ardupilot FTDI Cable
  • Needed to load firmware, etc... on the ArduPilot board
  • $20
  • Not worth it to make our own, I looked into it
  • Lab checkout doesn't have one either