Thursday, 2 April 2026

51 Testing a GPS, ublox NEO-M8U @02/4/26 (not finished)

Having purchased a cheap ublox GPS, I wired it up to a TTL RS232<->USB convertor, downloaded U-Center from Ublox and observed incoming packets at (the power up default) of 9600 Baud. As I wanted to add this to an arduino uno (Adafruit Metro actually) and keep the arduino's sole hardware uart for the convenience of using the Arduino IDE and the USB monitor, it was important that the GPS baud rate was low enough to use the "SoftSerial" library to allow a siftware uart to read data reliably. 

My USB-TTL-RS232 modules were 15 years old, but I found the data sheet on as RS Stock No.:

429-278


Wiring these up an using tera-term saw data coming out at 9600 baud. Downloading U-Center from ublox ( at https://www.u-blox.com/en/product/u-center allowed further experimentation, I did not update firmware or alter the GPS configuration, if it works, don't fix it...

Actually at a later date I may try and increase the update rate and a future application may want the 1pps output signal to be increased if possible. (for a GPS disciplined oscillator)

One feature of the U-center software is a deviation map, shown below, by the way it took many many minutes to get a cold start, but the u-center software did show more and more satellites coming into view and their status changing from blue to green (I assume thats a good thing) I wioll test warm start tomorrow!



Anyway, the arduino code I used was simply the Software Serial example with one print line commented out. Here it is, I wired the GPS TX pin to pin 10 on the arduino and the RX pin to pin 11 (although it is not used here)

/*
  Software serial multiple serial test

 Receives from the hardware serial, sends to software serial.
 Receives from software serial, sends to hardware serial.

 The circuit:
 * RX is digital pin 10 (connect to TX of other device)
 * TX is digital pin 11 (connect to RX of other device)

 Note:
 Not all pins on the Mega and Mega 2560 support change interrupts,
 so only the following can be used for RX:
 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

 Not all pins on the Leonardo and Micro support change interrupts,
 so only the following can be used for RX:
 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

 created back in the mists of time
 modified 25 May 2012
 by Tom Igoe
 based on Mikal Hart's example

 This example code is in the public domain.

 */
#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
 ////// mySerial.println("Hello, world?");
}

void loop() { // run over and over
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}
////////////////////////
Here is the output from the arduino IDE serial monitor


No comments:

Post a Comment