Holux GPSlim 236 on Seeeduino Mega (Arduino Mega)

On Saturday I received my Seeeduino Mega which is a Arduino compatible ATmega 1280 based board, which provides 70 (!) IO Ports. Thanks to Klaus Sander for the quick overnight delivery!

I followed Mikes example and connected the Serial TX of my GPSlim 236 to a (Soft) Serial RX Port of my Arduino.
The GPSlim 236 has a Mini-USB breakout which in fact is no USB but a serial port (thats the reason why you would need a converter cable (USB-to-Serial) if you want to connect the device via cable to your pc).
You will find GND on the black wire, TX on green, RX on white. You can supply +5V on the red wire to power the device and load the battery (when there is one in). If you want to use a USB adapter on breadboard or something similiar you can find the USB pinout here.
For the very basic beginning I connected only GND and TX, powered the GPS device via battery and looked if there is some data coming.

Because I am using a Mega board I had to modify some things (ie using the current beta 11 of NewSoftSerial).


/*
Testing Suite for Holux GPSlim 236 GPS on Seeduino Mega
by KaiK ()
Code last modified 29.07.2011

GPS serial pinout and inspiring code at http://mikenz.geek.nz/blog/gpslim236_arduino/

NewSoftSerial (Version 11) library compatible with "Megas" from http://arduiniana.org/2011/01/newsoftserial-11-beta/
Note: Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

TinyGPS (Version 10) NMEA parsing library from http://arduiniana.org/libraries/tinygps/
*/

#include
#include
#include

SoftwareSerial gpsNSS(50, -1); //Currently only Receiving data, no ACK or sending needed
TinyGPS gps;

void setup()
{
/* Serial output */
Serial.begin(38400);
Serial.println("Waiting for GPS");

/* Start GPS */
gpsNSS.begin(38400);
}

void loop()
{
while (gpsNSS.available()) {
if (gps.encode(gpsNSS.read())) {
float lat, lon, alt;
unsigned long age;
gps.f_get_position(&lat, &lon, &age);
alt = gps.f_altitude();

/* Display new GPS data when we get it */
Serial.print("Lat: ");
Serial.println(lat, 5);
Serial.print("Lon: ");
Serial.println(lon, 5);
Serial.print("Alt: ");
Serial.print(alt, 1);
Serial.println("m");

Serial.print("Fix age: ");
Serial.println(age);

}
}
}

It worked very fine.

After that I measured the current draw of the Holux GPSlim 236 to determine which power supply to use. In fact you cannot use the Arduino on board power for this. I soldered a little board/shield where I provide power and some pinouts. The whole device gets powered by some external source.

Maybe later I will use the RX port of the device to query a specific dataset or change configuration (ie refreshing rate) in live mode (see NMEA Data, ie $PSRF103 codes).
Note: For TX from Arduino you dont need a port with interrupt, so you can use every (!) port.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s