Go Back
U-Blox Neo M8N Drotek
15th, May
U-Blox Neo M8N U-Center configuration and Arduino parser sketch

!! U-Blox Neo M8N configuration file and Arduino sketch available on my gitHub toskyRocker account !!

Today I’ll explain how to configure the outstanding U-Blox Neo M8N GPS/GLONASS receiver for multirotors usage.

Introduction to the U-Blox Neo M8N

Why this receiver?
Well, the answer is pretty simple: it’s one of the best receivers you can get for 50€ . It can be used with many concurrent navigation satellite systems, like GPS+GLONASS, allowing better performance.
Not all the boards including M8N have the same performance, I suggest you to buy the board developed by DroTek since it seems to have a better accuracy. Different boards with the same M8N receiver have been tested here:  DIY Drones forum.

First of all you need to:

  1. Download the free tool U-Center available on U-Blox Website.
  2. Install U-Blox Neo M8N driver
  3. Choose a way to connect the U-Blox to your PC. You can use either a FTDI Cable or the PL2303 USB to UART converter (this last needs its driver)

U-Blox Neo M8N configuration with U-Center

U-Center is a smart tool that allows you to choose the configuration you need for the GPS receiver and store it in its non volatile memory. With U-Center you can test the accuracy of the receiver with visual instruments displaying info about: satellites, DOP, output messages, baudrate, FIX mode etc..

U-Center

U-Center

There’s a simple way to upload a configuration on the non-volatile memory of the receiver.

    1. Connect the receiver to your PC and open U-Center

U-Center magic wand
Click on the magic wand to enable the autobauding. Then the connection status should turn green.

    1. Go to: Tools-> GNSS Configuration

U-Center GNSS Configuration
Then browse where Configuration_Ublox_Neo_M8N.txt is stored (download it from my gitHub) and click on “File>GNSS” . Now the configuration is permanently stored on the M8N receiver.
U-Center upload configuration

My configuration affects:

  1. Dynamic model configured on Pedestrian (low speed and acceleration)
  2. 10Hz refresh
  3. SBAS On. Be sure your area is covered by SBAS
  4. Static Hold 0.01 m/s
  5. Baudrate fixed to 115200

If you want to change many more parameters, go to View->Message View

U-Center Message View
Browse until UBX->CFG . Here you can set many parameters. Once you’ve done, click on Send (on left bottom-hand of the windows).

U-Center CFG

U-Center CFG

In order to make it permanent on M8N’s flash memory, go to Receiver->Action and select “Save Config”.
U-Center save configuration

Arduino parser for the U-Blox Neo M8N

Do you want to read GPS/GLONASS info on your Arduino?
You need to parse NMEA output strings from your GPS/GLONASS receiver!
Wire your receiver on whatever Arduino (e.g. Yun/Micro/Leonardo etc..) having the Atmega32u4. This is essential since we’re going to use Serial1, unfortunately unavailable on Arduino Uno (Atmega328).

Arduino wiring Ublox Neo M8N

Arduino wiring for Ublox Neo M8N

Now compile and run my sketch on Arduino and enjoy your M8N!

The parser takes into account 5 NMEA messages :

  • GNGGA: latitude, longitude, altitude, fix quality, HDOP, satellites in view, satellites in use
  • GNGSA: Fix Mode, PDOP, HDOP, VDOP
  • GPGSV: Satellites in view, elevation, azimuth, SNR, satellites info
  • GNRMC: Time, latitude, longitude, speed over ground, course, magnetic variation
  • GNVTG: Track made good e ground speed

June 13th, 2015 at 14:06 by Anthony

Reply



Thank you! Very useful post

July 31st, 2016 at 14:16 by thanapong

Reply



great…

August 8th, 2016 at 09:45 by Jose

Reply



This post is what I was waiting for! Thx!

September 22nd, 2016 at 16:48 by sadaiv

Reply



can i configure neom8n to send only GNRMC message ?

September 22nd, 2016 at 22:50 by AndrewTosky

Reply



Hi, I don’t think it is allowed..
In any case you can write a parser that reads only what you need i.e. only GNRMC messages.

November 8th, 2016 at 19:28 by sonny

Reply



Thank you very much and it’s working great, But i have one question. When i run the file on arduino ide , i have 12 rows in 1 second with the same infos in the serial port. The baud rate is 9600 and the datas are readable. I haved changed the arrays to single float and int. Sorry, but i’m no profi 😉

November 14th, 2016 at 21:36 by AndrewTosky

Reply



Hi! In my opinion you should increase the baudrate. 9600 bits per second are just not enough. Try with 115200 as you can see in my code.

PS You need to configure the Ublox accordingly

January 10th, 2017 at 22:55 by Winfried

Reply



Thank you for your parser! Many pobular GPS libraries do not work with the u-blox M8N.
I have modified your example to work with SoftwareSerial on other Arduinos.
Two questions:
1. How do I get date and time information from the receiver (in which format)?
2. It seems that I have bought a clone M8N that can’t be updated to the latest u-blox M8N firmware 3.01 because of missing flash memory. You recommend the DorTec M8N Module. Do you know if this receiver is using the original u-blox M8N module and can be updated to the latest fimware 3.01 (capable of receiving Galileo)?!

January 14th, 2017 at 15:31 by AndrewTosky

Reply



Dear Winfried, sorry for my late reply.
1. In my parser you get (year, month, day) [from line 275] and
(hour, minute, second) [from line 335].
2. The M8N Drotek contains a genuine Ublox receiver.
You should be able to upgrade the firmware and see Galileo’s constellation.
https://forum.u-blox.com/index.php?qa=4762&qa_1=galileo-satellites-channel-flashers-but-strong-signal

January 16th, 2017 at 13:59 by Tangui

Reply



Hi ! First thank you a lot. Works great with serial1. But im not able to make it work with SoftwareSerial. Any idea ?

January 19th, 2017 at 00:06 by AndrewTosky

Reply



Hi!
What’s exactly your problem?

I know that SoftwareSerial’s baud limitation is 38400.
Maybe it’s not enough to handle GPS’s output 🙁

Cheers

January 19th, 2017 at 00:27 by Winfried

Reply



I was able to use the parser with SoftwareSerial and an Arduino Nano. The maximum rate that worked stable was 19200 baud.

February 13th, 2017 at 11:21 by Victor Johansen

Reply



I have a holybro m8n gps/compass according to what I have read my naz32 just wants the position info. help

February 16th, 2017 at 23:25 by AndrewTosky

Reply



Hi Victor,
which part of the tutorial is not clear?

Cheers
Andrea

March 24th, 2017 at 20:42 by Joe

Reply



I wire my GPS, run the sketch provided, and when i run it i get 0s on every category.

Note that i converted the Serial1 to software serial because I am running it on arduino uno. Baud rate is the same, and essentially nothing else has changed. What am i doing wrong?

March 25th, 2017 at 14:20 by AndrewTosky

Reply



Hi,
have you checked on U-Center you can actually receive GPS data?

March 28th, 2017 at 07:51 by Joe

Reply



Although I tried receiving GPS data, i was unsuccessful. GPS seems to be sending no data at all actually, Serial Screen is empty. For this test I am using the arduino mega because it supports hardware serial and I don’t have to use software serial. It still doesn’t make much sense. Also I haven’t been able to use any other parser so far.

March 28th, 2017 at 12:13 by AndrewTosky

Reply



Hi,
first of all, are you sure your M8N receives data at all?
Have you plugged it in U-Center and tried to receive data?
I don’t expect major changes in the latest firmware upgrade since the protocol used should be the same.
Which firmware version are you running now? Keep in mind that my parser and M8N configuration file date back to 2015.

March 31st, 2017 at 10:03 by Joe



After a lot of research I found out that my firmware was fine, and I was able to connect the receiver to u-center. I found out that the package that I needed was UBX NAV_PVT. It gives me latitude, longitude and heading of the vehicle (compared to the north). Now my problem is that i can’t get a valid fix, and the data i got so far has been inaccurate by several meters. Thanks.

March 31st, 2017 at 10:09 by Joe



Another question I have: does course on your parser refer to the heading (angle from the north)?

April 4th, 2017 at 14:08 by AndrewTosky



I’m glad you found a solution 🙂

If you parse GNVTG, you’ll then get both angles from True North and Magnetic North.
Have a look here (VTG section):
http://wiki.openseamap.org/wiki/OpenSeaMap-dev:NMEA

April 10th, 2017 at 16:21 by rue

Reply



Hello,
So this should also work on an Arduino Mega right? And I have to configure the M8N before I can read anything? Im quiet the newbie tho 🙂

July 1st, 2017 at 12:21 by fangy

Reply



Thank you Andrea for a VERY helpful post :-). I have followed your instructions, but I think I have made an error. When I view the Arduino serial monitor I get 4 arrays of zeros. When I had the neo8 plugged directly into u-centre, I had plenty of satellite fixes and resultant data streams. Is there a newbie mistake to be made somewhere that would give no apparent data being received to the logger board? (the blue Tx LED on the neo8 is rapidly flashing) Thank you.

July 2nd, 2017 at 11:10 by fangy

Reply



Solved it – I just had to match all the baud rates. 🙂

July 3rd, 2017 at 07:59 by AndrewTosky

Reply



Hi, sorry for my late reply! I’m glad you solved the problem.

Best
Andrea

July 3rd, 2017 at 08:15 by fangy

Reply



Hi Andrea,
No problemo 🙂
I am trying to put together a high precison GPS (using Doppler shift). I need to record these messages:

UBX-NAV-PVT, UBX-NAV-DOP, and UBX-NAV-SAT

My coding ability is poor 🙁 IF possible, could you please provide an example of how I would code for the above and then write it to an SD card?

I am using a Neo8 and Adalogger( feather32u4)

Thank you!
Ross