VCC: Power supply voltage (typically 3.3V or 5V).
GND: Ground connection.
TXD: UART transmit pin for sending data from the GPS module to the microcontroller (e.g., RP2040 board).
RXD: UART receive pin for receiving data from the microcontroller (e.g., RP2040 board) to the GPS module.
Connected pins as such:
module -> pico
VCC -> 3V3
GND -> GND
TXD -> GP1
RXD -> GP0
I've used many code samples as such:
#include <Arduino.h>
// Define the hardware UART pins
#define GPS_SERIAL Serial1
void setup() {
// Start the hardware UART at 9600 bps
GPS_SERIAL.begin(9600);
Serial.begin(115200); // Initialize Serial for debugging
}
void loop() {
// Check if data is available from GPS
if (GPS_SERIAL.available()) {
// Read the incoming GPS data
String gpsData = GPS_SERIAL.readStringUntil('\n');
// Process the GPS data
// ...
// Print the GPS data for debugging
Serial.println(gpsData);
}
}
GPS module on board LED blinks meaning that a fix was adquired and data is available (as I've readed)
However looks like the problem is with the UART communication since GPS_SERIAL.available() retrieves 0 always.
#include <Arduino.h>
// Define the hardware UART pins
#define GPS_SERIAL Serial2
void setup() {
// Start the hardware UART at 9600 bps
GPS_SERIAL.setRX(5);
GPS_SERIAL.setTX(4);
GPS_SERIAL.begin(9600);
Serial.begin(115200); // Initialize Serial for debugging
}
void loop() {
// Check if data is available from GPS
if (GPS_SERIAL.available()) {
// Read the incoming GPS data
String gpsData = GPS_SERIAL.readStringUntil('\n');
// Process the GPS data
// ...
// Print the GPS data for debugging
Serial.println(gpsData);
} else {
Serial.println("gps not available");
}
}
Serial output shows gps not available all the time. Even though the GPS module blinks. UART communication seems to be broken :\
Yes, and to use it you would have the GPS_SERIAL.available() line
in the code, but you have already said that bit of code never sees characters from the GPS, but this would be the code ..................
hello mates, it appears that the issue behind the GPS module not providing any data was related to its power needs since the NEO-6M module draws up to 40ma and the pico was only providing 16. I had the same issue with other modules.
Now the issue is that the module is providing encoded data..
I am sure that they did. Mistakes, once made, are often propagated and, of course, once code has been written to use what is defined then it is very difficult to change the definition without breaking an unknown amount of code