GPS Experiment With Arduino

This is the post excerpt.

Advertisements

[ GPS Experiment With Arduino ]

Ultimate GPS module, so we named it that. It’s got everything you want and more:

GPSModule.jpg

  • -165 dBm sensitivity, 10 Hz updates, 66 channels
  • 5V friendly design and only 20mA current draw
  • Breadboard friendly + two mounting holes
  • RTC battery-compatible
  • Built-in datalogging
  • PPS output on fix
  • Internal patch antenna + u.FL connector for external active antenna
  • Fix status LED

Arduino Wiring

 

Download the PDF of GPS Module with Arduino Wiring

Once you’ve gotten the GPS module tested with direct wiring, we can go forward and wire it up to a microcontroller. We’ll be using an Arduino but you can adapt our code to any other microcontroller that can receive TTL serial at 9600 baud. Arduino Wiring

Connect VIN to +5V, GND to Ground, RX to digital 2 and TX to digital 3.

gps_softserialwire

Next up, download the Adafruit GPS library. This library does a lot of the ‘heavy lifting’ required for receiving data from GPS modules, such as reading the streaming data in a background interrupt and auto-magically parsing it. To download it, visit the GitHub repository or just click below

rename the uncompressed folder Adafruit_GPS. Check that theAdafruit_GPS folder contains Adafruit_GPS.cpp andAdafruit_GPS.h

Move Adafruit_GPS to your Arduino/Libraries folder and restart the Arduino IDE. Library installation is a frequent stumbling block…if you need assistance, our All About Arduino Libraries guide spells it out in detail!

Leonardo & Micro Users: We have special example sketches in the Adafruit_GPS library that work with the Micro/Leo!

Open up the File→Examples→Adafruit_GPS→echo sketch and upload it to the Arduino. Then open up the serial monitor. This sketch simply reads data from the software serial port (pins 2&3) and outputs that to the hardware serial port connected to USB.

Open up the Arduino IDE Serial Console and make sure to set the Serial baud rate to 115200

You can configure the GPS output you see by commenting/uncommenting lines in the setup() procedure. For example, we can ask the GPS to send different sentences, and change how often it sends data. 10 Hz (10 times a second) is the max speed, and is a lot of data. You may not be able to output “all data” at that speed because the 9600 baud rate is not fast enough.

// You can adjust which sentences to have the module emit, below

// uncomment this line to turn on RMC (recommended minimum) and GGA (fix data) including altitude

GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);

// uncomment this line to turn on only the "minimum recommended" data for high update rates!

//GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCONLY);

// uncomment this line to turn on all the available data - for 9600 baud you'll want 1 Hz rate

//GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_ALLDATA);

// Set the update rate

// 1 Hz update rate

//GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);

// 5 Hz update rate- for 9600 baud you'll have to set the output to RMC or RMCGGA only (see above)

GPS.sendCommand(PMTK_SET_NMEA_UPDATE_5HZ);

// 10 Hz update rate - for 9600 baud you'll have to set the output to RMC only (see above)
//GPS.sendCommand(PMTK_SET_NMEA_UPDATE_10HZ);
In general, we find that most projects only need the RMC and GGA NMEA’s so you don’t need ALLDATA unless you have some need to know satellite locations.

gpssch

 

Author: iotmaker

I am interested in IoT, robot, figures & leadership. Also, I have spent almost every day of the past 15 years making robots or electronic inventions or computer programs.

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