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..



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
  • 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

June 13th, 2015 at 14:06 by Anthony


Thank you! Very useful post

July 31st, 2016 at 14:16 by thanapong



August 8th, 2016 at 09:45 by Jose


This post is what I was waiting for! Thx!

September 22nd, 2016 at 16:48 by sadaiv


can i configure neom8n to send only GNRMC message ?

September 22nd, 2016 at 22:50 by AndrewTosky


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


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


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


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


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.

December 20th, 2018 at 23:51 by Jai


Can you share your software serial modified code for Arduino uno or nano?

January 16th, 2017 at 13:59 by Tangui


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


What’s exactly your problem?

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


January 19th, 2017 at 00:27 by Winfried


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


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


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


March 24th, 2017 at 20:42 by Joe


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


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

March 28th, 2017 at 07:51 by Joe


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


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):

April 10th, 2017 at 16:21 by rue


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


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


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

July 3rd, 2017 at 07:59 by AndrewTosky


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


July 3rd, 2017 at 08:15 by fangy


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


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!

September 27th, 2017 at 17:19 by chewyiching


this GPS module can connect with arduino uno?

September 28th, 2017 at 08:25 by AndrewTosky


You can, but I’d rather choose a board with atmega32u4, like Leonardo and Micro, because they have got 2 real serial connections. Useful if you want to both debug with a Pc and receive data as quick as you can from the GPS receiver.

September 28th, 2017 at 10:02 by Chew yi ching


Thx for help me…i am a biginner in using arduino..where i can obtain the coding for gps module n8m with aruini uno? Isit it can connect same like gps module neo 6m…because very seldom ppl upload and post thing and the video about arduino uno with neo m8n most of the post related with arduino uno with neo 6m…can help me ?

September 28th, 2017 at 19:43 by AndrewTosky


Mainly you have to replace Serial1 with SoftwareSerial . It should work, even though it will be slower.
I’m sure there are plenty of examples on the internet if you look for Ublox GPS receiver and Arduino UNO.


August 24th, 2018 at 13:31 by vergleich lebens versicherung


Aw, thos was aan extremely good post. Takinbg a few minutes and actual effort to generate a gredat article… but what can I
say… I procrastinate a lot and never seeem to
get anything done.

January 7th, 2019 at 22:27 by Nicola


Hi and thanks for this.

I tried to do the configuration via “messages view”. There I can also change the sample rate. It was already at 10 hz, but my n8m gps module keeps sampling at 1 Hz, why this?
Thanks allot!

January 7th, 2019 at 23:19 by Jino


Hi Andrew,
Thanks much for sharing the code. Whether this code can be used for SAM-M8Q?

April 17th, 2019 at 02:49 by donald


This Mateksys GPS I have output data into U-Center perfectly. But my working arduino code, does not hook up to it. How do I configure it, via U-center, so that the output format can be parsed via tinyGPS++?

Many thanks.

June 4th, 2019 at 15:53 by Hashem Shahsavani


Hi, Dear. Unfortunately your code does not work! and give just 0,0,0,0

August 3rd, 2020 at 03:04 by Gyoosuhn


Very useful and exact information about Ublox M8N.
Thanks alot!