Hello everyone
I've been trying to connect a gps module (NEO-7M Ublox) to an arduino (pro micro) as a part of a larger project.
the issue i have here is i've not gotten any input to the arduino from the gps
PS: the gps is live and locks on corresponding sats.
i'm using the tinygps library's examples and still no gain
i've tried to:
1- using the software serial (including swapping the rx & tx pins)
2- using the onboard serial connection
3- changing the baudrates of both the gps and the arduino (still no gain)
4- checked for voltage fluctuation on the arduino's rx pin (there IS a fluctuation and an input signal)
5- disconnected the arduino's tx and used only the rx connected to the gps tx
i downloaded U-center and connected the gps directly through a usb cable to make sure it works (it does work and i got perfect readings. it's brand new after all)
Post your annotated schematic and links to the hardware pieces you are using. I see no reason it should not work. Be sure to show all power sources and there ratings.
for the schematic, there's not a fixed wiring as i've said i've been trying different connections to get it to work
the gps is powered directly through the vcc 5v of the arduino (i tried using a li-ion battery but the voltage wasn't enough to fix positions)
I do not expect it to work very well and the Arduino will get very hot. A safe estimate for the pro micro is about 70 mA from the 5V pin max. Your Ublox can exceed 100 mA that leaves you overloaded before anything else is connected. RF devices are extremely sensitive to power supply variations and may not work if it is not stable enough. Use a separate power supply but be sure the grounds are connected.
One GPS module I received from Amazon was sending UBX format messages, but no NMEA messages. AFAIK the tinygps library only works with NMEA, not with UBX.
You may have damaged the Arduino, the GPS or both. There are plenty of tutorials on line showing correct ways to wire the two.
For informed help, please read and follow the posting directions in the "How to get the best out of this forum" post, linked at the head of every forum category.
i managed to finally get the gain i was looking for but that's only available for pins (9 &10)
.
i still have no idea why it doesn't work on other pins even though it's the same code
Some good suggestions here.
The U-centre software is very good.
I don't know much about the Neo-7M, but the popular Neo-6M certainly works with Arduino.
This forum item used the 7M module.
Connecting a GPS to Arduino Uno - General Guidance
if any of them was malfunctioning, the gps wouldn't work as it's supposed to on the U-center and the arduino wouldn't work as it's supposed to with a GSM module on a different project
.
I made sure they're not damaged nor have any dead connections
The best answer I could give is the declarations in the code are wrong. Without listing the code I have no idea of what the problem is as it appears the hardware is working?
#include <TinyGPSPlus.h>
#include <SoftwareSerial.h>
/*
This sample sketch demonstrates the normal use of a TinyGPSPlus (TinyGPSPlus) object.
It requires the use of SoftwareSerial, and assumes that you have a
4800-baud serial GPS device hooked up on pins 4(rx) and 3(tx).
*/
static const int RXPin = 9, TXPin = 3;
static const uint32_t GPSBaud = 9600;
// The TinyGPSPlus object
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
void setup() {
Serial.begin(115200);
ss.begin(GPSBaud);
Serial.println(F("DeviceExample.ino"));
Serial.println(F("A simple demonstration of TinyGPSPlus with an attached GPS module"));
Serial.print(F("Testing TinyGPSPlus 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();
}
How are you making the connections to the Pro Micro, directly soldered wires, jumpers to soldered headers, etc?
Try the following sketch with the NEO-7M connected to the Vcc, Gnd, and hardware Rx of the Pro Micro (no need to connect the Tx of the Pro Micro, that should not be directly connected anyway since the NEO-7M itself does not operate at 5V logic levels).
//change to whatever baud rate you are using
#define GPSbaud 9600
void setup() {
Serial.begin(115200);
Serial1.begin(GPSbaud);
}
void loop() {
while (Serial1.available() > 0) {
char c = Serial1.read();
Serial.write(c);
}
}
You should be able to see the NMEA sentences coming from the NEO-7M in the Serial monitor when the baud rate is set properly.