The baud rates will be different because the GPS is using 9600 whilst @srnet has chosen to use 115200 for the hardware Serial interface
Did you set your serial monitor to the 115200 baud rate?
Did you see this:
GPS_Echo_Hardware_Serial Starting
Why should it not be ?
Yes I did set the serial monitor to 115200 but it doesn't show:
GPS_Echo_Hardware_Serial Starting
Assuming the connection below is correct:
Arduino 33 IOT RX0 -> Neo TX,
Arduino 33 IOT TX1 -> Neo RX,
Arduino 33 IOT 3.3V -> Neo VCC,
Arduino 33 IOT GND -> Neo GND,
I'd unplug the GPS and run it again. Until you can get the Starting message printed, you have bigger problems.
+1.
I unplugged the GPS and just connected the Arduino Nano 33 board only to print the message but nothing comes out. But when I test the built-in accelerometer with the relevant sketch, it prints out the accelerometer x,y,z values.
Still unsure where the problem is.
Post that sketch.
Sketch below to test the accelerometer:
#include <Arduino_LSM6DS3.h>
void setup() {
Serial.begin(9600);
while (!Serial);
if (!IMU.begin()) {
Serial.println("Failed to initialize IMU!");
while (1);
}
Serial.print("Accelerometer sample rate = ");
Serial.print(IMU.accelerationSampleRate());
Serial.println(" Hz");
Serial.println();
Serial.println("Acceleration in G's");
Serial.println("X\tY\tZ");
}
void loop() {
float x, y, z;
if (IMU.accelerationAvailable()) {
IMU.readAcceleration(x, y, z);
Serial.print(x);
Serial.print('\t');
Serial.print(y);
Serial.print('\t');
Serial.println(z);
}
}
Serial monitor output:
OK, add this after your serial begin:
while (!Serial);
See if you get the message now. Later you'll need the same thing for Serial1 I expect.
I don't understand why there should not be any characters coming in on the Serial port.
If there's no NMEA characters, how do I ensure that the GPS is functioning?
If you are not getting any output from the GPS then it is not functioning ? Has the GPS got a lock ?
Have you tried the u-centre application on the PC
The GPS is able to function well with Arduino Uno board and is able to lock onto the satellite signal with NMEA messages printing constantly. But that's not the case when I tried with the Arduino Nano 33 IoT board.
If there is no serial characters coming from the GPS, and a scope would tell you, then the GPS is not functioning or you have it wired wrong.
Try adding the same while loop for serial1.
Added the while for Serial1. If that's what you mean;
void loop()
{
while (Serial1.available())
{
Serial.write(Serial1.read());
}
}
void setup()
{
Serial1.begin(9600); //GPS on this port
while (!Serial1);
Serial.begin(115200);
while (!Serial);
Serial.println();
Serial.println("GPS_Echo_Hardware_Serial Starting");
}
The output is the same:
I finally got a working Nano 33 IOT and GPS module together in the same place
This very simple sketch
void setup()
{
Serial.begin(115200);
Serial1.begin(9600);
}
void loop()
{
if (Serial1.available())
{
Serial.write(Serial1.read());
}
}
works OK and outputs the GPS data ad expected
Rx on the GPS is connected to TX1 on the Nano
Tx on the GPS is connected to RX0 on the Nano
The GPS is powered from 3V3 and GND on the Nano
I set the baud rate of the GPS using u-center
Have you got it working ?
That’s great. Are you able to post your GPS output?
Output
$GPRMC,133829.00,A,1234.02120,N,54321.27717,E,0.569,,300621,,,A*78
$GPVTG,,T,,M,0.569,N,1.053,K,A*2E
$GPGGA,133829.00,1234.02120,N,54321.27717,E,1,08,1.13,62.4,M,45.7,M,,*65
$GPGSA,A,3,22,27,08,01,32,10,21,23,,,,,2.08,1.13,1.74*07
$GPGSV,3,1,10,01,41,267,23,03,08,211,05,08,71,167,29,10,36,054,15*74
$GPGSV,3,2,10,14,22,316,,21,67,275,27,22,33,208,29,23,06,044,19*71
$GPGSV,3,3,10,27,39,140,30,32,27,101,21*76
$GPGLL,1234.02120,N,54321.27717,E,133829.00,A,A*6D
$GPRMC,133830.00,A,1234.02097,N,54321.27703,E,0.757,,300621,,,A*77
$GPVTG,,T,,M,0.757,N,1.402,K,A*21
$GPGGA,133830.00,1234.02097,N,54321.27703,E,1,08,1.13,62.4,M,45.7,M,,*65
$GPGSA,A,3,22,27,08,01,32,10,21,23,,,,,2.08,1.13,1.74*07
$GPGSV,3,1,10,01,41,267,23,03,08,211,06,08,71,167,30,10,36,054,16*7C
$GPGSV,3,2,10,14,22,316,,21,67,275,27,22,33,208,30,23,06,044,18*78
$GPGSV,3,3,10,27,39,140,35,32,27,101,22*70
$GPGLL,1234.02097,N,54321.27703,E,133830.00,A,A*6D
$GPRMC,133831.00,A,1234.02091,N,54321.27696,E,0.451,,300621,,,A*78
$GPVTG,,T,,M,0.451,N,0.836,K,A*2E
$GPGGA,133831.00,1234.02091,N,54321.27696,E,1,08,1.13,62.1,M,45.7,M,,*6A
$GPGSA,A,3,22,27,08,01,32,10,21,23,,,,,2.08,1.13,1.74*07
$GPGSV,3,1,10,01,41,267,24,03,08,211,,08,71,167,30,10,36,054,18*73
$GPGSV,3,2,10,14,22,316,04,21,67,275,27,22,33,208,30,23,06,044,19*7D
$GPGSV,3,3,10,27,39,140,33,32,27,101,22*76
$GPGLL,1234.02091,N,54321.27696,E,133831.00,A,A*67
and so on
Note that I have obfuscated the lat/long values

