Introduction: 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
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
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
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
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
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.
Attachments
Step 6: 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
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.
20 Comments
Question 3 years ago
I am using neo 6m gps i didn't receive any location can you please help me for this the led also blinking once and stops after some time
3 years ago
Iam doing a project using neo 6m GPS ,900 a GSM,16*2lcd,an emergency switch. The theme of the project is that on pressing the switch the location must be sent to the predefined mobile number in the code and the same to be displayed on the lcd. Please help me with the code.
http://bigbelectronics.in/product.php?product=waves-gps-module-neo-6m-gps-u-blox-neo-6m-gps-module-eprom-mwc-small-ceramic-antenna
Reply 3 years ago
Hii
iam also doing my major project using this gps module,and iam not able to understand the code properly so could you please guide me to understand the program.Could you explain me the entire code clearly.
5 years ago
I'm having an interesting issue, when I use this or any other example that comes with TinyGPS serial monitor outputs all values in a way that makes sense, mostly what I'm watching is speed, walking along it shows 2kmph which seems about right, but when I try to couple the code with an OLED screen it all goes hay wire. It either constantly reads speed as -1 or -1.00 and doesn't change or just flashes the screen a lot as it updates but doens't actually change from -1.00.
Any ideas where I'm going wrong here?
Reply 3 years ago
You need to hace a look at your variable assignments, for example try using floats or doubles
Question 4 years ago on Step 7
i keep getting no gps detected in my serial monitor
5 years ago
Is it ok to use Arduino Mega 2560 instead? if it is, what pin should i use? TX18 & RX19?
5 years ago
it shows latitude and longitude in different format $gprmc,,v,,,,,,,,,,*53
so plz help me to convert into right format
5 years ago
i think u can repalce void printFloat :
String latitude = String(lat,6);
String longitude = String(lon,6);
Serial.println(latitude+";"+longitude);
Question 5 years ago on Step 6
what about +5.30 time difference
Question 5 years ago
hi
i need sim 800l code for my project i search for the code but it is not executed .
so , plz help me in code ?????......
Answer 5 years ago
Hi venkat
I will upload gsm code in 1 or 2 hrs in my tutorial have a look.
Reply 5 years ago
hi
tq Ruchir Sharma
Question 5 years ago on Step 4
hi sir
this is venkat
my question is why this tinygps
this tinygps is not added to my arduino ide library
plz send the gy_neo6mv2 gps module code.
i am doing project using gps,gsm(sim800l),ultrasonic sensor and esp8266 wifi module
thanksyou
6 years ago
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
Reply 5 years ago
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
Reply 5 years ago
for UTC+05:30 what changes are to be done in these lines
Serial.print(" Time: "); Serial.print(static_cast<int>(hour+8)); Serial.print(":"); //Serial.print("UTC +08:00 Malaysia");
Serial.print(static_cast<int>(minute)); Serial.print(":"); Serial.print(static_cast<int>(second));
i.e in 92 and 93rd lines of the code
Reply 5 years ago
Hai Richaa.. I am facing the same problem. so do you manage to solve it ? please tell me how you solved it .. because i did as he said below but still same result
5 years ago
how to make it wireless?
6 years ago
Great tutorial, thnx!
I get the Lat and Long OK, but the ALT, SPEED, Course etc are all wrong.
Any ideas?
thnx
billd