Introduction: Tutorial to Communicate Neo-6M GPS to Arduino

Picture of Tutorial to Communicate Neo-6M GPS to Arduino

Description

This is an updated GPS module that can used with ardupilot mega v2. This GPS module uses the latest technology to give the best possible position information, allowing for better performance with your Ardupilot or other Multirotor control platform. You may require to configure this module for use with your flight controller (MultiWii Copter I2C GPS board requires 115200 baud). You will require a USB to FTDI adaptor board to do this. Please note that this module ships with defualt settings and a buad rate of 38400.


Specification

• Standalone GPS receiver

• Under 1 second time-to-first-fix for hot and aided starts

• SuperSense ® Indoor GPS: -162 dBm tracking sensitivity

• Anti-jamming technology

• Support SBAS (WAAS, EGNOS, MSAS, GAGAN)

• U-blox 6 50 channel positioning engine with over 2 million effective correlators

• 5Hz position update rate

• Operating temperature range: -40 TO 85°C

• UART TTL socket

• EEprom to store settings

• Build in 18X18mm GPS antenna

Step 1: Material Preparation

Picture of Material Preparation

In this tutorial, you will need to prepare as below :

1. NEO-6M GPS Module

2. Arduino Uno Board and USB

3. Female-Male Jumper Wire

4. GPS Antenna (optional, allow you to get signal more easily)

Step 2: Pinout Details

Picture of Pinout Details

You could see the pinout labeled at the back of the module. It has 5 pins that is VCC, GND, RX , TX and PPS. VCC and GND are for power supply and RX and TX are for serial communication between microcontroller and GPS module.

Step 3: Pin Connection

Picture of Pin Connection

Connect GPS Module to Arduino UNO as following :

  • VCC to 5V
  • GND to GND
  • RX to 9
  • TX to 10

Then, Connect your Arduino UNO Board to your computer via USB Cable.

Step 4: Libraries

Picture of Libraries

SoftwareSerial is a library of Arduino which enables serial data communication through other digital pins of Arduino. The library replicates hardware functions and handles the task of serial communication. TinyGPS is a library that converts all those NMEA messages into a readable format by stuffing the character sequences into variables. To be able to interface GPS Module with arduino, you will have to download these libraries and extract it into your Arduino's libraries.

Step 5: Sample Source Code

Picture of Sample Source Code

Download the sample source code below and open it on your Arduino IDE. Select the correct board and port. Then, upload it into your Arduino Uno Board.

Step 6: Editing Hour

Picture of Editing Hour

Some country have different time zone and some share the same time zone. Thus, you have to change the hour in the sample source code to make it exactly the same with your country's time zone unless you are from Malaysia or Singapore. As for Malaysia, it is UTC +08:00 (refer image above). Thus you can find the code below in the sample source code in the previous step.

Serial.print(static_cast(hour+8));

UTC is the time standard commonly used across the world. You can check your country's UTC +##:## on your computer's or phone's time zone.

Step 7: Result

Picture of Result

After you has succesfully uploaded your source code, open your serial monitor. Serial monitor will display the data that your gps required. If you didnt get anything, make sure your connection is correct and try it outside or near the window where it is easy to get the signal. Signal may not reach inside a building.

Comments

HafiziH (author)2017-09-19

how to make it wireless?

levarii made it! (author)2017-08-03

hi.


In the example you gave above, the height figure is incorrect. I noticed that GPGGA data is too short and therefore the altitude figure does not appear.

How can I fix it?
levarii@walla.com
Richaa6 (author)2017-05-25

HI,

I tried your code. But it doesnt give e the full output. Lat & log values are not loading

The output i get:

uBlox Neo 6M
Testing TinyGPS library v. 13
by Mikal Hart
Sizeof(gpsobject) = 115

SanjuhsH (author)Richaa62017-07-31

i think in the code that was downloaded :- in the first few lines the author has putit as

SoftwareSerial mySerial(10, 11);

change it to

SoftwareSerial mySerial(10, 9);

also preferably use a new ublox-6m gps module and also do attach an antenna . otherwise gps.encode() will not work [ i think!?]

even i encounterd a similar problem and if you still get the same reading then

//Serial.print(c); // uncomment to see raw GPS data

prefrebly uncomment the raw gps data

hoai phuc made it! (author)2017-07-26

Please help me!
I tried this code but There's some trouble like this. I don't know how to do!

GlenL22 made it! (author)2017-02-17

Thank you....of all the pages I had to go through to see if my unit worked....your code is the only one that output data I could see on the serial monitor. Thanks :-)

BillD120 (author)2016-12-02

Great tutorial, thnx!

I get the Lat and Long OK, but the ALT, SPEED, Course etc are all wrong.

Any ideas?

thnx

billd