Ublox NEO M8N serial communication

Hi everyone,
In my project I am using GPS module which is based on ublox NEO M8N. Module has RX Tx pin and a USB port also. It is working correctly via USB cable but isn't working with serial communication.
I uploaded empty sketch to my Arduino and connect GPS module to normal RX TX pins. But in my serial monitor couldn't process NMEA correctly. My output is showing as follows,

au⸮@⸮⸮8⸮2#p=⸮@
<⸮⸮9A⸮
9⸮2⸮⸮⸮⸮⸮i

I have changed baud rate and tried but it is giving same result. It is totally find through USB and showing NMEA in serial monitor but it cant connecting to Arduino form USB port. So I need your help to find the solution.
Thank You.

Do you mean pins 0 and 1 ?
Which Arduino board are you using ?

Please post your full sketch here, using code tags when you do

@UKHeliBob
Yes 0 and 1 pins. I used Arduino NANO board. No special sketch used. Just empty sketch was uploaded before connect GPS module.

You will need to run a sketch that reads the serial input and if data is available, prints it to the Serial monitor

Pins 0 and 1 are not a good choice on the Nano because they are used by the hardware Serial interface with the Serial monitor and for uploading code

Consider using SoftwareSerial on 2 other pins of your choice

#include "SoftwareSerial.h"

SoftwareSerial gpsSerial(2, 3); //Rx, Tx, but you choose
void setup()
{
  Serial.begin(115200);   //must match the Serial monitor
  gpsSerial.begin(9600);  //change if required
}

void loop()
{
  if (gpsSerial.available())
  {
    Serial.write(gpsSerial.read());
  }
}
1 Like

@UKHeliBob I used this sketch. But couldn't get result.

#include <SoftwareSerial.h>
SoftwareSerial mySerial(4, 3);

void setup() {
  Serial.begin(115200);
  mySerial.begin(9600);
}

void loop() { 
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
}

Output

⸮C⸮@⸮⸮TD@⸮L&⸮@"⸮⸮⸮D"x⸮⸮LBB⸮⸮⸮0@⸮⸮⸮F⸮⸮B@L&⸮BN⸮⸮⸮⸮DLzbyB@C⸮I⸮@B⸮BEtB⸮@svM⸮BB⸮a⸮@⸮⸮⸮⸮

I cant understand what's happening. :thinking: :thinking:

What baud rate does the GPS use ?
What baud rate have you got selected in the Serial monitor. It must match the value in Serial.begin()

@UKHeliBob
I checked several baud rates. but working only 9600. Other baud rates did not reach at least this level.

What about the Serial monitor baud rate ?
Is it set to 115200 ?

@UKHeliBob
Yes.

A checklist :

  • you have a SotwareSerial object named gpsSerial
  • GPS module connected to pins 4 and 3
  • pin 4 is Rx and pin 3 is Tx in gpsSerial.begin()
  • Tx of the GPS connected to pin 4 of the Arduino
  • Rx of the GPS connected to pin 3 of the Arduino
  • nothing connected to pins 0 and 1 of the Arduino
  • no other devices connected to the Arduino
  • Serial.begin() set to 115200
  • gpsSerial.begin() set to 9600
  • sketch compiles and uploads OK
  • a message printed in setup() is displayed correctly in the Serial monitor

Please confirm that everything is as above

Please post a link to the GPS module that you are using
*

1 Like

@UKHeliBob Thanks for your support and I am really appreciate that.
Yes. everything is the same as you mentioned. But same result is happening.
I am using module which was ordered from this web site. https://tronic.lk/product/ublox-neo-8m-gps-module
Thank You.

Have you got any sort of manual for the GPS, particularly any details of the Serial interface ?

@UKHeliBob I found the problem and solved it. Anyway I am really appreciate your support.

M8N module is programmable and you can configure it through u-blox u-center. In u-center you can control ports as what are the ports, baud rates and what are the output formats as well (See UBX-CFG-PRT). Then you can select output port and other parameters as well. If anyone is facing same problem above mentioned, try this way and this may be your solution..
Thank You.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.