D
D
Denis Yulamanov2020-05-22 17:43:37
Arduino
Denis Yulamanov, 2020-05-22 17:43:37

How to connect GPS module to Arduino?

Need to connect 3.3-5V TTL UAR GPS Module GN-801 GPS GLONASS to Arduino UNO? Needed to correct time.
The GPS module has 6 pins (GND, VCC, TXD, RXD, PPS, EN) connected only 4 pins of them.
If there is no way without them, then where to connect them (PPS, EN)?
On the Internet, all GPS modules with 4 pins (GND, VCC, TXD, RXD if I'm not mistaken) and there is no diagram and sketch for the module that I have.

Used this code:

#include <SoftwareSerial.h>
#include <TinyGPS.h>
TinyGPS gps;
SoftwareSerial gpsSerial(0, 1);
bool newdata = false;
unsigned long start;
long lat, lon;
unsigned long time, date;
void setup()
{
gpsSerial.begin(9600); // скорость обмена с GPS-приемником
Serial.begin(9600);
Serial.println("Waiting data of GPS...");
}
void loop()
{
// задержка в секунду между обновлениями координат
if (millis() - start > 1000)
{
newdata = readgps();
if (newdata)
{
start = millis();
gps.get_position(&lat, &lon);
gps.get_datetime(&date, &time);
Serial.print("Lat: "); Serial.print(lat);
Serial.print(" Long: "); Serial.print(lon);
Serial.print(" Date: "); Serial.print(date);
Serial.print(" Time: "); Serial.println(time);
}
}
}
// проверка наличия данных
bool readgps()
{
while (gpsSerial.available())
{
int b = gpsSerial.read();
//в TinyGPS есть ошибка: не обрабатываются данные с \r и \n
if('\r' != b)
{
if (gps.encode(b))
return true;
}
}
return false;
}


But it outputs:
$GNRMC,144234.00,A,5253.33266,N,05⸮⸮bR⸮*5
19:42:34.256 -> $GPGSV,4,3,13,21,87,080,17,26,17,123,17,27,33,299, 17,⸮⸮⸮ѥ⸮⸮⸮data of GPS...

Although in the example it only displays the location (latitude, etc.)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lonelymyp, 2020-05-22
@lonelymyp

Banned on google? Nothing, Yandex also has everything.
PPS is a second output, there pulses jump once a second, you can connect an LED for beauty to blink. EN is the control signal of the module, you can turn the module on and off.
The purpose of the pins is described in the documentation.
The data that the module outputs to the port is configured in the U-center program, you can hide the unnecessary and display only what you need, how to configure the module is also described in the documentation.

T
tinkleviselo, 2021-12-21
@tinkleviselo

I also want to know the coding problem. But GPS is also a funny thing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question