RPi Quadcopter blog

RPi Quadcopter blog
Click to open

May 3, 2014

NEO6MV2 GPS Module with Arduino Uno HOW-TO


Introduction

Using the NEO6MV2 GPS Module with Arduino is pretty straightforward. This tutorial uses TinyGPS Library by Mikal Hart. The library is only for data manipulation purposes, so it is not actually required to read the data from the module. SoftwareSerial library is used for the communication.

I got the module from DealExtreme: http://www.dx.com/p/gy-neo6mv2-flight-controller-gps-module-blue-232595

This tutorial should work with Ublox-NEO6MV2, GY-NEO6MV2...

Hardware

NEO6MV2 GPS module uses 3v3 logic compared to 5v which the Arduino uses. To convert the logic, we add two resistors in our wiring.


Parts


Wiring

image developed using Fritzing. For more circuit examples, see the Fritzing project page


Software

Download the TinyGPS library here: https://github.com/mikalhart/TinyGPS/releases/tag/v13.
Open the "test_with_gps_device.ino" from the examples folder.
This module uses baudrate 9600, so in the setup() method find the code "ss.begin(4800);
" and replace it with ss.begin(9600);. Now upload the code and open the serial monitor. If the module fails to get a fix, try to use it near a window or outdoors. The fix could take several minutes.

67 comments:

  1. Hello, I have an example and I changed to 9600 but when I run I jump Error "'TinyGPS' does not name a type." it can be?

    ReplyDelete
  2. It looks like Arduino IDE is not recognizing TinyGPS library.

    Have you downloaded TinyGPS library?
    Where did you extracted it?
    Which version of Arduino IDE are you using?

    ReplyDelete
    Replies
    1. you need to restart your IDE after installing a libarary. otherwise navigate to your root directory of your IDE, open the folder library and paste your extracted lib in there. hope that helps

      Delete
    2. Hey there.
      Can u please help me know more about this module if I can put my own coordinates in this for better accuracy .
      I mean as I m dealing with a small campus so for navigation thing what will be best suited since the world's gps is not that accurate when it comes to precision. So please help me out in this ..
      Thank u ..
      Anmol

      Delete
  3. hello,
    nice tutorial
    i have bought this module
    http://www.aliexpress.com/item/Free-shipping-Ublox-NEO-6M-GPS-Module-Aircraft-Flight-Controller-For-Arduino-MWC-IMU-APM2-3336/1881734794.html

    should there be any LED indication when i just supply 3.3v keeping the TX and RX open?
    I see a on-board surface mounted LED
    does it glow when i just provide the Power?

    ReplyDelete
    Replies
    1. Hi

      It is not a power led. The led indicates that the module has an active fix on gps satellites. It will blink while it has active fix, and will be off at all other times.

      Delete
  4. Hello. i have some doubts regarding this module. At first i connected it using 5v without the resistors. Now i am using your method to do it. But still its not working. Does it implies that i have damaged the gps module by using 5v?
    Please reply. Also accept my friend request on facebook

    ReplyDelete
    Replies
    1. Well done. You destroyed it. It uses 3.3V, not 5V.

      Delete
  5. It has a 3v3 regulator on-board - so can be powered from 5V - However, you need level translation on the serial data connections

    ReplyDelete
  6. tis sentence is printed in serial com:
    CHARS=0 SENTENCES=0 CSUM ERR=0
    ** No characters received from GPS: check wiring **
    What happen?
    Thank you

    ReplyDelete
  7. Hello.

    This is what i Get after following the instructions:

    Testing TinyGPS library v. 13
    by Mikal Hart

    Sats HDOP Latitude Longitude Fix Date Time Date Alt Course Speed Card Distance Course Card Chars Sentences Checksum
    (deg) (deg) Age Age (m) --- from GPS ---- ---- to London ---- RX RX Fail
    -------------------------------------------------------------------------------------------------------------------------------------
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 6 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 210 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 414 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 618 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 822 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 1026 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 1230 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 1434 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 1638 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 1842 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 2046 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 2267 0 0


    What is the meaning of that?

    Thanks.
    Hanan.

    ReplyDelete
    Replies
    1. Hi Hanna,
      i am also getting the same output just like yours,...

      have u found any solution for GY-NEO6MV2.....


      Plz guide me to solve the problem...
      Thanks & Regards
      Rajesh

      Delete
    2. Same problem.

      When using the tinygps simple test and printing the GPS sentences I get lots of $GPTXT lines but nothing else!

      Any help or suggestions would be appreciated.

      Delete
    3. This is a very much restart. Connect to the +5V to the GPS VCC.
      I can use 3.3V on my UNO but need to connect to 5V on my NANO.

      Delete
    4. Try to change "...find the code "ss.begin(4800)" and replace it with ss.begin(9600')" as stated bove.
      It worked (got a reading instead of *) for me.

      Delete
    5. So I am getting the same output, and yes i changed the 4800 to 9600. Can anyone help me out with this ?

      Delete
    6. I have same issue and i get CHARS=9306 SENTENCES=0 CSUM ERR=0 when i run simple test

      Delete
    7. Do the following step by step surely it will work:
      Step I : Download the zip and unzip it any directory.
      Step II : Edit the ss.begin(4800) to ss.begin(9600) in the file "test_with_gps_device.ino" in the unzipped folder
      Step III : Now copy the entire unzipped folder(after editing it) i.e "TinyGPS-13" to the "libraries" directory of your IDE
      Step IV : Now open your IDE and in File option go to examples. In that go to TinyGPS-13 and choose "test_with_gps_device" and upload.
      Surely it will run.

      Delete
    8. **Edited** Do the following step by step surely it will work:
      Step I : Download the zip and unzip it in any directory.

      Step II : Edit the ss.begin(4800) to ss.begin(9600) in the file "test_with_gps_device.ino" in the unzipped folder

      Step III : Now copy the entire unzipped folder(after editing it) i.e "TinyGPS-13" to the "libraries" directory of your IDE

      Step IV : Now open your IDE and in File option go to examples. In that go to TinyGPS-13 and choose "test_with_gps_device" and upload.
      Surely it will run.
      :)

      Delete
    9. I can confirm that I had to wire the GPS device to the 5V pin on my Arduino Nano for it to work, got a fix within a few seconds with the antenna attached. When wired to the 3.3V pin the device never got a fix.

      Delete
  8. wow, ,it's good,thanks for Introduction NEO6MV2 GPS Module with Arduino Uno HOW-TO.Realy good

    ReplyDelete
  9. can I use arduino Duemilanove ATMega 328P instead of the arduino UNO? thanks

    ReplyDelete
    Replies
    1. Yes this should work with any arduino board. The title says UNO, because I used UNO board in the wiring drawing.

      Delete
    2. Remember to check duemilanove rx and tx pins and use those (maybe 3=tx, 2=rx ?)

      Delete
  10. ok I have the pins correctly connected, but I am not getting anything on the Ser. Monitor. The only value thats changing is the RX Chars, any help? thanks alot

    ReplyDelete
  11. Thanks for posting.
    The last 3 fields of my serial output (Chars RX, Sentences RX, Checksum Fail) are: 20223, 0, 1
    Does this mean its working but not getting a fix?
    Thanks

    ReplyDelete
    Replies
    1. check the speed betwen the gps and the card i ve replace 4800 with 9600
      and it works now

      Delete
  12. Somebody send config command to GPS? I need to decrease the rate from 1sec to 30sec

    ReplyDelete
  13. Hi, where can I find the NEO6-MV2 part file for fritzing you used to draw your schema?
    Thanks.

    ReplyDelete
    Replies
    1. Hi.
      I had the same question with you before. But I realized that the author used another module GPS in Fritzing to draw and just put the label NEO6-MV2 on it.
      I also could not find this part on the internet too.
      He might find it, so let's wait for his reply.
      :)

      Delete
    2. Thats right, I couldn't find it so I took some other gps module and just put the label on it.

      Delete
    3. which gps module did you put the label on and how did you put the label?

      Delete
  14. you are the best, nice resistor scheme, manufacture dont show this and without this the gps dont show lat/long.
    congratulations
    Sorry my english.

    ReplyDelete
  15. Hi I got the GPS to work, thank you. I'm wondering if anyone know how to use the code with servos. Right now whenever the GY-GPS6MV2 is transmitting to the Arduino my servos twitch and can't be controlled. Any help will be welcomed

    ReplyDelete
  16. hey i am totally new..in using gps module i have purchase one ublox gps module..here my problem is in the gps circuit board in provide littlebit hole for vcc,ground,and tx,rx..but how to connect with control this circuit board ..bcozzz hwre only hole provide ...

    ReplyDelete
  17. worked 100% for me, with no resistors, and with 5v directly, thank you so much :)

    ReplyDelete
  18. Abdelilah you wanna blow up the gps of the others it does not work without resistors

    ReplyDelete
  19. Hi I used this gps with out the resistor with simple code on atmega and it shows the result this very simple to test the module.
    void setup() {
    // initialize both serial ports:
    Serial.begin(9600);
    Serial1.begin(9600);
    }

    void loop() {
    // read from port 1, send to port 0:
    if (Serial1.available()) {
    int inByte = Serial1.read();
    Serial.write(inByte);
    }

    // read from port 0, send to port 1:
    if (Serial.available()) {
    int inByte = Serial.read();
    Serial1.write(inByte);
    }
    }

    ReplyDelete
  20. https://www.arduino.cc/en/Tutorial/MultiSerialMega

    ReplyDelete
  21. wow, thanks for the review NEO6MV2 GPS Module with Arduino Uno. really helpful for me

    ReplyDelete
  22. This comment has been removed by the author.

    ReplyDelete
  23. hi, I connected everything and released tinygps code get this one: C:\Users\Kris\Downloads\AFF540DC.Unpacker_v7353qx4kg3sa!App\TinyGPS-13 (1).zip\TinyGPS-13\examples\test_with_gps_device\test_with_gps_device.ino:3:21: fatal error: TinyGPS.h: No such file or directory

    #include

    ^

    compilation terminated.

    exit status 1
    Error compiling for board Arduino/Genuino Uno.


    what should I do? I'm really new at this stuff

    ReplyDelete
    Replies
    1. You need to install tinyGPS library. Search on google for tinyGPS library and install it.

      Delete
  24. Hi!
    Try the Ublox ucenter gps program. works fine. Can be downloaded from Ublox webside for free.

    ReplyDelete
  25. Ive connected it all up as per the instructions but am just getting all this endless text in the serial monitor???
    É# öZ É# öZ É# öZ É# öZ
    Made a post about it on the Arduino Forums, Check it out for pics
    http://forum.arduino.cc/index.php?topic=402850.0
    Help :\

    ReplyDelete
    Replies
    1. Hi Peter.H
      Have you tried to install uBlox uCenter on your Pc and connect the gps, to test and see that all works and that you get a fix on your location?
      If that works, then it must be a sketch issue.
      (Sorry for bad gramma)

      Delete
  26. This comment has been removed by the author.

    ReplyDelete

  27. How long does it take GY - GPS6MV2 to be in use ? or LED indicator active satellite ?

    ReplyDelete
    Replies
    1. It should start after a few seconds and start to get fix on satellites after about 30 seconds. but if you are inside a building it could be an issue, try to take it outside or out a window for a test.

      Delete
  28. Thanks! Very helpful input from all contributors helped me to get this running! Without it, I would have been very confused, and the Blue Smoke Monster would have claimed another victim!!! It works from Serial rate 9600 through to 115200 - with the TinyGPS 'test_with_gps_device' sketch. I've tweaked it to give Time & Date to a 2.8" TFT Screen.

    ReplyDelete
  29. Using the resistors and an ATmega2560 and Software Serial could not get it working so I tried different baud rates and still no success. So I tried the hardware Serial1 (Pins 19 and 18) on the 2560 and 9600 baud and it finally worked.

    ReplyDelete
  30. Hello!
    Nice post! Thank you.
    However, I was thinking about the reason to use these 2 resistors... You did say in the post that they are to convert the logic, but its not clear for me.
    Can you explain better?

    Thanks in advance1

    ReplyDelete
  31. Finally it worked with me keep bandrate of gps 9600 😀😀😀😀😀

    ReplyDelete
  32. Really helpful information. Managed to start my NEO6MV2 GPS by following the steps from abowe. Thank you!

    ReplyDelete
  33. Hi I am struggling to make my GPS module work. I am using it with Arduino Uno and I seem to be getting the following output.

    0
    * ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    * ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    Testing TinyGPS library v. 13
    by Mikal Hart

    Sats HDOP Latitude Longitude Fix Date Time Date Alt Course Speed Card Distance Course Card Chars Sentences Checksum
    (deg) (deg) Age Age (m) --- from GPS ---- ---- to London ---- RX RX Fail
    -------------------------------------------------------------------------------------------------------------------------------------
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0
    **** **** ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 0 0 0

    I have checked the wiring and infact I returned the first module back to amazon thinking it was not working. The second module behaves exactly the same.

    Seeing others have faced similar problems, I need some assistance please. Please advice. Thank you

    ReplyDelete
    Replies
    1. Just an update to mention that after all these dyas I have managed to get it to work with code from here. http://arduiniana.org/libraries/tinygpsplus/

      Thank you

      Delete
  34. Just to let you know that I managed to get things working thanks to your explanation. Thanks a million!

    ReplyDelete
  35. This comment has been removed by the author.

    ReplyDelete
  36. fritzing diagram is wrong.
    change the pins as
    tx => pin 4
    rx => pin 3

    ReplyDelete
  37. This is what appears on my serial monitor. PLEASE HELP

    Testing TinyGPS library 0
    * ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 46678 0 0
    * ********* ********** **** ********** ******** **** ****** ****** ***** *** ******* ****** *** 46678 0 0
    Ö´”jiöB å �È

    ReplyDelete
  38. I cannot understand what is the meaning of using resistors when connecting RX in order to make it work on 3,3 Volt and you directly connect TX on the arduino, which operates on 5 Volts!

    ReplyDelete
  39. Tx of module gives signal while arduino is here to recieve it so there is no harm if ardiuno recieves 3.3 voltage signal but when arduino transmites its signal, it has to be reduced to 3.3 V by voltage divider formed by resistor for safe operation of module

    ReplyDelete
  40. This comment has been removed by the author.

    ReplyDelete
  41. hi there i m using NEO-6M GPS module and it is showing satellite count=0 in serial monitor and only 1 led is glowing on gps module we cant understand the problem can u help...?

    ReplyDelete