r/arduino • u/Longjumping-Rip-7449 • Sep 16 '26
Hardware Help GPS problem
So i bought an U blox M8-N neo with an HC-05 bluetooth unit, after programming the arduino and connecting it, it keeps saying connecting to satellites, connected the rx of the arduino to the TX of the GPS, and the TX of the arduino to the rx of the bluetooth module
Here's the code
include <SoftwareSerial.h>
include <Adafruit_GPS.h>
// Configurazione pin GPS: RX = 4 (collegato a TX GPS), TX = 5 (collegato a RX GPS) SoftwareSerial mySerial(4, 5); Adafruit_GPS GPS(&mySerial);
unsigned long lastSendTime = 0; const unsigned long SEND_INTERVAL = 100; // 100 ms = 10 Hz
void setup() { // Seriale Hardware per HC-05 (Bluetooth su pin 0 e 1) Serial.begin(9600);
// Avvio comunicazione con il modulo GPS u-blox a 9600 baud GPS.begin(9600);
// Configurazione output NMEA standard (solo frasi RMC e GGA per ridurre il traffico dati) GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
// Impostazione dell'update rate NMEA (1Hz / 5Hz standard per comandi PMTK) GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);
delay(1000); }
void loop() { // Lettura continua dei caratteri dal modulo GPS GPS.read();
// Se è stato ricevuto un pacchetto completo NMEA, esegui il parsing if (GPS.newNMEAreceived()) { GPS.parse(GPS.lastNMEA()); }
// Invio dei dati via Bluetooth ogni 100 ms (10 Hz) unsigned long currentTime = millis(); if (currentTime - lastSendTime >= SEND_INTERVAL) { lastSendTime = currentTime;
if (GPS.fix) {
// Conversione nodi in km/h (1 nodo = 1.852 km/h)
float speedKmh = GPS.speed * 1.852;
Serial.print(speedKmh, 1);
Serial.print(";");
} else {
Serial.print("Ricerca satelliti...;");
}} }
3
u/Looney-T Sep 16 '26
Without schematic and your code there's not a whole lot we can do, please post the schematic and code.
2
u/Standard_Grocery2518 Sep 16 '26
Dumb question, have you taken it outside?
1
u/Worldly-Device-8414 Sep 17 '26
GPS has to used outside.
GPS can take 10 minutes to find satellites & acquire data at power up. It's faster after that.
1
u/StuartsProject Sep 17 '26
A GPS that is working and has a good antenna should get a fix, when outdoors and with a good view of the sky, in 40 seconds or so.
A GPS will normally be putting out serial information even when it does not have a fix. Run this program to see in the Serial monitor what data the GPS is actually tranmitting;
#define RXpin 4 //this is the pin that the Arduino will use to receive data from the GPS#define TXpin 5 //this is the pin that the Arduino can use to send data (commands) to the GPS#include <SoftwareSerial.h>SoftwareSerial GPS(RXpin, TXpin);void loop(){while (GPS.available()){Serial.write(GPS.read());}}void setup(){GPS.begin(9600);Serial.begin(115200);Serial.println("GPS_Echo_SoftwareSerial Starting");}1
u/MJY_0014 Sep 18 '26
It's been a while since I've used GPS, but doesn't a 1hz blinking led mean it has already successfully gotten a fix, and is flashing in sync with the UTC time?