I am new with using Arduino IDE and working on one of a GPS module named Reyax RYS8830 and connected it to ESP32 Dev Module through its UART port/pins (RX/TX, 16/17) with using a proper signal level shifter from Texas Instruments named TXS0108E. I tried to upload the code successfully to ESP32 using Arduino IDE and run serial monitor window to check for the GPS data from connected GPS module, but no success in receiving the data from GPS module and getting "NO GPS DETECTED: CHECK WIRING” message in Arduino's serial monitor window as per the uploaded code, even checked for the proper wiring twice and found no wiring issue at all. While Reyax RYS8830 GPS module works fine with providing the GPS data under its own Evaluation board without any issue at all . Could anybody here assist me further to fix this issue and/or got the same no GPS detected issue? Any help to fix this issue be appreciated greatly. Thanking you.
These level shifters are apparently notoriously difficult to use: see Problem with TXS0108E Logic Level converter (post #18)
For the GPS module, you don't actually need a bi-directional level converter.
To receive the data from the GPS module, a 1.8 volt device, you could use an NPN and PNP transistor and a few resistors. If you are transmitting configuration information from the ESP32 to the GPS module, a voltage divider using two resistors is sufficient.
Hello @6v6gt! Thank you very much for your feedback. I have been gone through your mentioned post #18 before to fix the issue with TXS0108E level shifter and been studied and tried every configuration with using TXS0108E from its data sheet and other posts to make it work. I'm not sure, but I think level shifter is working properly when check for the change in logic level at its pins. I would look for your second option mentioned for GPS module with transistor and resistors.
Secondly, if there would be an issue with logic level shifter can it affect the baud rate also, by not showing the GPS data on serial monitor? As an electronics enthusiast I would first prefer to find out the fault to fix it whether its because of hardware and/or software (uploaded codes) issue before using another circuit design for signal level shifter. Hope you understand my concern and bear with me on this. Thanks.
How are pins that you are using marked on the ESP32 board (RX2 / TX2) ?
You have effectively crossed these over via the level shifter so TX on the GPS module is connected to RX2 on the EXP32 ?
If you have any doubt about what baud rate the GPS module uses, then post details of the evaluation board you have used. Generally, though, 9600 is a common default.
If you still have trouble, post your sketch and a wiring diagram.
Hello @6v6gt! Thanks for keep assisting. I connected Reyax RYS8830 GPS module with ESP32 Dev. board through its UART ports pin no. (RX2/TX2, 16/17) with using a proper signal level shifter i.e from ESP32 TXD signal level pin 3.3v -> 1.8 signal level at RXD pin of RYS8830 and 1.8 -> 3.3V signal level from TXD pin of RYS8830 to RXD pin of ESP32 and I have double checked that its effectively crossed.
The default baud rate of RYS8830 GPS module is 115200 as per its data sheet.
Please check for the uploaded sketch code and pics to be reviewed by you.
#include <TinyGPS++.h>
#include <HardwareSerial.h>
HardwareSerial uart(2);
TinyGPSPlus gps;
void setup()
{
Serial.begin(115200);
uart.begin(115200, SERIAL_8N1, 17, 16);
Serial.println(F("DeviceExample.ino"));
Serial.println(F("A simple demonstration of TinyGPS++ with an attached GPS module"));
Serial.print(F("Testing TinyGPS++ 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 (uart.available() > 0)
if (gps.encode(uart.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();
}
Normally RX precedes TX in such a parameter list. That is 17 and 16 should be reversed.
Can you provide a link to the example ESP32 sketch you are using to access RX2 and TX2.
I have uploaded the sketch code from this link: problems with tiny GPS on esp32 - ESP32 Forum. It has some errors in this sketch which i have corrected before uploading and tested with the sketch. I have tested with uploading and run the sketch with RX preceding TX in the parameter list, but no luck at all.
Can you check the resistor from the level shifter OE is connected to GND. It appears from the picture to have one side connected to ESP32 gpio 15.
You chose an odd example sketch. It was a non working one from a problem report. This may be better: How to connect GPS to ESP32 | QuadMeUp
It seems like connected to ESP32 gpio 15 in picture, but it isn't actually. I have double checked with it and its connected to GND. Uploaded is the more clear wiring diagram i have designed to be reviewed by you.
Also, I'll check with uploading the sketch details in the link provided by you.
Thanks for keep assisting.
I have uploaded and run the code as described in the link and still serial monitor didn't show any GPS data.
#include "types.h"
#include "TinyGPS++.h";
#include "HardwareSerial.h";
TinyGPSPlus gps;
HardwareSerial SerialGPS(1);
void setup() {
Serial.begin(115200); //Serial port of USB
SerialGPS.begin(9600, SERIAL_8N1, 16, 17);
}
void loop() {
while (SerialGPS.available() >0) {
gps.encode(SerialGPS.read());
}
Serial.print("LAT="); Serial.println(gps.location.lat(), 6);
Serial.print("LONG="); Serial.println(gps.location.lng(), 6);
Serial.print("ALT="); Serial.println(gps.altitude.meters());
}
Well, you are getting something on that serial port otherwise you would see no output at all. However, you still have to adjust the baud rate in the sketch, currently 9600, to 115200 to match your GPS module.
Hello kpin404
Did the GPS-module can "see" some GPS satellites or only the celling of your room ?
Have a nice day and enjoy coding in C++.
Дайте миру шанс!
Hello @paulpaulson! Nice to get your feedback in helping me to fix this issue.
Yes, i am testing with GPS-module in open outdoor location with clear sky. Please have check with the screenshot for your reference. Thanks.
Yes! i got something and its better than nothing at all.
Well! i have already been tried with changing the baud rate from 9600 to 115200 to match with GPS module, but no luck at all and getting the same serial monitor window again as attached here. Thanks.
Try changing the loop() to this to see exactly what is coming over the serial port.
void loop() {
while (SerialGPS.available() >0) {
Serial.print(SerialGPS.read());
}
}
That is not surprising since you have not copied the suggested code sample very carefully:
It should be:
void loop() {
while (SerialGPS.available() >0) {
Serial.print(SerialGPS.read());
}
}
I've just looked again. That code in post #10 would anyway produce output even if there was no serial activity so actually it is still not clear if the GPS module / Level shifter combination is delivering any output to the ESP32.
If you have an oscilloscope or a logic analyser the trouble shooting would be relatively easy but I guess you would have said before if you possessed such things.
Apart from the ESP32, have you another Arduino (or a USB/TTL adaptor) so as to verify the correct behaviour of that serial port ?
Yes! you may be right. I think so after going through every bit of fault finding processes with expected outcome results there may be the hardware communication issue between GPS module and ESP32 due to level shifter and next comes to me with the procedure of fault finding process.
Yes! I do have an 50MHz dual channel oscilloscope, but i would need to have setup this first at the workbench from my electronics store.
Yes! apart from the ESP32 I do have this USB- to-TTL Module Serial Adaptor.
Now, lets verify the correct behavior of that serial port next. Thanks.