This project demonstrates the use of the TinyGPSPlus library with an ESP32 microcontroller and a GPS module. It receives data from the GPS module and parses it to extract information such as location, date, and time.
- Uses the TinyGPSPlus library for GPS data parsing.
- Connects to a GPS module via SoftwareSerial.
- Prints GPS information to the serial monitor every 10 seconds.
- Detects and reports if no GPS signal is detected.
![Screenshot 2024-05-20 at 15 50 33](https://private-user-images.githubusercontent.com/1720245/332087767-f28fbae7-593f-469a-909e-481f6d8cc1cc.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5ODk3NjcsIm5iZiI6MTcyMzk4OTQ2NywicGF0aCI6Ii8xNzIwMjQ1LzMzMjA4Nzc2Ny1mMjhmYmFlNy01OTNmLTQ2OWEtOTA5ZS00ODFmNmQ4Y2MxY2MuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MThUMTM1NzQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjY4NzAxMjk3YjU5ZTExYjg0MmYxZGEyZmNmYTY4MDFhZjljM2I3OGU3NWUzNGYzNTQ4ODdiMzIzYTJiYmE2ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Zrr08RdXVTRwfx4jfmAaA16XgCg0Gt534xHLSzGenaw)
![Screenshot 2024-05-20 at 15 50 33](https://private-user-images.githubusercontent.com/1720245/332087685-7d6fc158-7f9e-443e-97d4-fea433663a2e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5ODk3NjcsIm5iZiI6MTcyMzk4OTQ2NywicGF0aCI6Ii8xNzIwMjQ1LzMzMjA4NzY4NS03ZDZmYzE1OC03ZjllLTQ0M2UtOTdkNC1mZWE0MzM2NjNhMmUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MThUMTM1NzQ3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTY1OGExNDkyMThkYmU5ZTVlNzc4Nzc4Y2FmYmMyMzE1OTZiZmRiYmNlZmE3YWVhMjU4OTA1MTQwN2E5YWVmNiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.0xFxmuqmBCxv8FaDol9LhWw2USAg5C0n2B8bSu945Qo)
- ESP32 microcontroller (e.g., ESP32-S3-DevKitC-1)
- GPS module with 9600 baud rate (e.g., u-blox NEO-6M)
- Jumper wires
- Arduino IDE
- PlatformIO
- TinyGPSPlus library (https://github.com/mikalhart/TinyGPSPlus)
- EspSoftwareSerial library (https://github.com/plerup/EspSoftwareSerial)
Connect the GPS module to the ESP32 as follows:
- GPS TX to ESP32 RX (pin 4)
- GPS RX to ESP32 TX (pin 5)
- GPS GND to ESP32 GND
- GPS VCC to ESP32 3.3V
Install the required libraries in the Arduino IDE or PlatformIO.
- Upload the code to the ESP32.
- Open the serial monitor and observe the GPS information being printed every 10 seconds.
The code will automatically start receiving and parsing data from the GPS module. The following information will be printed to the serial monitor:
- Location (latitude and longitude)
- Date (month, day, year)
- Time (hour, minute, second, centisecond) If no GPS signal is detected, the code will print a message indicating that the wiring should be checked.
The baud rate of the GPS module can be adjusted in the code if needed. The interval for printing GPS information can be changed by modifying the interval variable.
- TinyGPSPlus library: https://github.com/mikalhart/TinyGPSPlus
- EspSoftwareSerial library: https://github.com/plerup/EspSoftwareSerial
- ESP32 documentation: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/
Contributions are welcome! Please fork the repository and submit a pull request with your changes.