Go Down

Topic: GPS Ublox M8N issue with arduino micro (Read 69 times) previous topic - next topic

arroiyyaan

hello everyone

im working on a project using arduino micro and GPS Ublox M8N. i found my arduino micro cannot read the GPS as the serial monitor shows "no GPS detected" while the wiring and the code (i use example code) were both correct as well. when i try to access the gps with another arduino such as arduino UNO and arduino NANO it goes well as supposed to be.
does anyone know what to do with this micro board, huge thanks

UKHeliBob

Show us the code that you are using and describe how the GPS is connected to the different boards.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

arroiyyaan

i use example code with little bit modifications in pin connection as below :

Code: [Select]

#include <TinyGPS++.h>
#include <SoftwareSerial.h>

static const int RXPin = 5, TXPin = 4;
static const uint32_t GPSBaud = 9600;

// The TinyGPS++ object
TinyGPSPlus gps;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

const char UBLOX_INIT[] PROGMEM = {
  0xB5, 0x62, 0x06, 0x08, 0x06, 0x00, 0x64, 0x00, 0x01, 0x00, 0x01, 0x00, 0x7A, 0x12, //(10Hz)
};

void setup()
{
  Serial.begin(57600);
  ss.begin(GPSBaud);

  for (int i = 0; i < sizeof(UBLOX_INIT); i++) {
    ss.write( pgm_read_byte(UBLOX_INIT + i) );
    delay(5);
  }

  Serial.println(F("DeviceExample.ino"));
  Serial.println(F("A simple demonstration of TinyGPS++ with an attached GPS module"));
  Serial.print(F("Testing TinyGPS++ library v. ")); Serial.println(TinyGPSPlus::libraryVersion());
  Serial.println(F("by Mikal Hart"));
  Serial.println();
}

void loop()
{
  // This sketch displays information every time a new sentence is correctly encoded.
  while (ss.available() > 0)
    if (gps.encode(ss.read()))
      displayInfo();

  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println(F("No GPS detected: check wiring."));
    while(true);
  }
}

void displayInfo()
{
  Serial.print(F("Location: "));
  if (gps.location.isValid())
  {
    Serial.print(gps.location.lat(), 6);
    Serial.print(F(","));
    Serial.print(gps.location.lng(), 6);
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F("  Date/Time: "));
  if (gps.date.isValid())
  {
    Serial.print(gps.date.month());
    Serial.print(F("/"));
    Serial.print(gps.date.day());
    Serial.print(F("/"));
    Serial.print(gps.date.year());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.print(F(" "));
  if (gps.time.isValid())
  {
    if (gps.time.hour() < 10) Serial.print(F("0"));
    Serial.print(gps.time.hour());
    Serial.print(F(":"));
    if (gps.time.minute() < 10) Serial.print(F("0"));
    Serial.print(gps.time.minute());
    Serial.print(F(":"));
    if (gps.time.second() < 10) Serial.print(F("0"));
    Serial.print(gps.time.second());
    Serial.print(F("."));
    if (gps.time.centisecond() < 10) Serial.print(F("0"));
    Serial.print(gps.time.centisecond());
  }
  else
  {
    Serial.print(F("INVALID"));
  }

  Serial.println();
}




and here the wiring connection :

GPS -- arduino micro

vcc -- 3v3
gnd -- gnd
tx -- RX
rx -- TX

i dont wire the i2c on GPS because its not necessary in what im doing on

thank you

-dev

Only NeoGPS will parse data from the the newest GPS devices, like the NEO-M8.  It's also smaller, faster and more accurate than all other libraries. 

Your sketch is similar to the NMEAsimple.ino example of NeoGPS, with the addition of the UBX 10Hz update rate command.  You could also try the example ubloxRate.ino.  It shows how to send other UBX commands for 1/5/10/16Hz update rate, different baud rates, and enable/disable sentences.

If you want to try it, NeoGPS is available from the Arduino IDE Library Manager, under the menu Sketch -> Include Library -> Manage Libraries.  Even if you don't try it, be sure to read the Troubleshooting page for other tips for GPS sketches.

I would also suggest NOT using SoftwareSerial.  It is very inefficient, because it disables interrupts for long periods of time.  This can interfere with other parts of your sketch, or with other libraries.

Instead, use AltSoftSerial on pins 8 (to GPS TX) and 9 (optional, to GPS RX through resistors).  It is very efficient... Strongly recommended!

2nd best is my NeoSWSerial on any two pins (5 and 4 are ok), but only at baud rates 9600, 19200 and 38400.

And because you are sending commands to the GPS device, be sure to do some kind of level-shifting.  The 5V Arduino pin can damage the 3.3V GPS RX pin.  Read more about it here.

Cheers,
/dev

srnet

hello everyone

im working on a project using arduino micro and GPS Ublox M8N. i found my arduino micro cannot read the GPS as the serial monitor shows "no GPS detected" while the wiring and the code (i use example code) were both correct as well. when i try to access the gps with another arduino such as arduino UNO and arduino NANO it goes well as supposed to be.
does anyone know what to do with this micro board, huge thanks
Well there is something you are not telling us perhaps.

TinyGPS++ will work correctly with the Ublox 8s, but you do need to send a UBX message at the start to turn off GLONASS mode.

Since I cannot see the correct UBX message in your code, all the Arduinos should not work.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

Go Up