Build a GPS + SMS Vehicle Tracker using RYS352A GNSS Module and ESP32

 




Introduction

In this project, I have built a GPS-based vehicle tracking system using the RYS352A GNSS module and ESP32. This tracker uses the power of GNSS (Global Navigation Satellite System) and the GSM network to send real-time location updates of your vehicle via SMS. The tracker ensures that your vehicle will not be stolen and helps you easily monitor its location from anywhere.

Why Use RYS352A GNSS Module?



The RYS352A GNSS module provides access to multiple satellite systems (GPS, GLONASS, Galileo, and BeiDou), making it a highly reliable solution for tracking. Its versatility and accuracy are key for real-time vehicle tracking.
  • Multi-GNSS Support: Works with GPS, GLONASS, Galileo, and BeiDou for higher accuracy.
  • Compact and Reliable: Small size and low power consumption, perfect for mobile applications.

Unboxing the RYS352A GNSS Module

In the video, I unbox the RYS352A GNSS module and provide an overview of the features. This module is designed to give precise location data and can be easily integrated with microcontrollers like ESP32.

  • What's Inside the Box:
    • RYS352A GNSS module
    • Pinout documentation
    • Connecting cables

Project Overview

The project involves connecting the RYS352A GNSS module with the ESP32 microcontroller. The ESP32 communicates with the GSM module to send location data via SMS when requested by the user. The system will send an SMS with the location when a button is pressed.

Required Components:

  • ESP32: For controlling the system and processing the data.
  • RYS352A GNSS Module: For receiving location data.
  • GSM Module: For sending SMS with the location.
  • Push Button: To trigger the sending of SMS.
  • Jumper Wires: For connecting the components.
  • Breadboard/PCB: For assembling the system.

Circuit Diagram

Below is the circuit diagram to connect the components together:



  • RYS352A GNSS Module:

    • TX to RX of ESP32
    • RX to TX of ESP32
    • VCC to 3.3V
    • GND to GND
  • GSM Module:

    • TX to RX of ESP32
    • RX to TX of ESP32
    • VCC to 5V
    • GND to GND
  • Button:

    • One leg connected to GPIO pin of ESP32
    • Other leg to GND

    Code Explanation

    The code uses the TinyGPS++ library to read the location data from the GNSS module. The ESP32 processes this data and sends it through the GSM module using AT commands.


    #include <TinyGPS++.h>

    // Define pins for GNSS and GSM
    #define RXPin_GNSS 16  
    #define TXPin_GNSS 17  
    #define RXPin_GSM 26  
    #define TXPin_GSM 27  
    #define ButtonPin 4

    TinyGPSPlus gnss;
    HardwareSerial gnssSerial(1);  // GNSS on Serial1
    HardwareSerial gsmSerial(2);   // GSM on Serial2

    String latitude = "";
    String longitude = "";

    void setup() {
      Serial.begin(115200);  
      gnssSerial.begin(115200, SERIAL_8N1, RXPin_GNSS, TXPin_GNSS);  
      gsmSerial.begin(115200, SERIAL_8N1, RXPin_GSM, TXPin_GSM);    
      pinMode(ButtonPin, INPUT_PULLUP);
      initializeGSM();
    }

    void loop() {
      while (gnssSerial.available() > 0) {
        gnss.encode(gnssSerial.read());
      }

      if (digitalRead(ButtonPin) == LOW) {
        sendLocationSMS();  
        delay(2000);  
      }
    }

    void initializeGSM() {
      gsmSerial.println("AT");  
      delay(1000);
      gsmSerial.println("AT+CMGF=1");  
      delay(1000);
    }

    void sendLocationSMS() {
      if (gnss.location.isValid()) {
        latitude = String(gnss.location.lat(), 6);  
        longitude = String(gnss.location.lng(), 6);
        String message = "Scooty Location: https://www.google.com/maps?q=" + latitude + "," + longitude;
        gsmSerial.println("AT+CMGS=\"+YOUR_PHONE_NUMBER\"");  
        delay(1000);
        gsmSerial.print(message);  
        gsmSerial.write(26);  
        delay(5000);  
        Serial.println("SMS sent: " + message);  
      } else {
        Serial.println("Unable to get GNSS location.");
      }
    }


    How It Works:

    1. GNSS Module: Receives signals from satellites and calculates the current location (latitude and longitude).
    2. ESP32: Processes the location data and sends it through the GSM module.
    3. GSM Module: Sends an SMS with the location details to a predefined phone number when the button is pressed.
    4. Button: Triggers the sending of the SMS.

    Testing the System

    After assembling the circuit and uploading the code, you can test the system by:

    • Pressing the button to send the location via SMS.
    • Checking if the SMS contains the correct location URL, which opens in Google Maps.


    Conclusion

    This DIY project allows you to track your vehicle's location using the GPS + SMS system with the RYS352A GNSS module and ESP32. It’s a cost-effective and efficient way to monitor your vehicle in real-time. You can expand this project by adding more features such as real-time tracking through an app or integrating it with cloud services.


    About the Author

    Hi, I'm Aryan Pandey, and I have a deep passion for exploring the world of emerging technologies in areas like robotics, neuroscience, and bio-sensing. Through my platform, Techno Sap, I share practical and innovative projects that inspire others to dive into hands-on technology. If you love learning about DIY tech projects and how to bring them to life, don’t forget to check out my YouTube channel for more exciting content!

    Call to Action

    _________________________________________________________ 🄸🄽🅂🅃🄰🄶🅁🄰🄼 👇🏾 https://z-p42.www.instagram.com/aryanpandey699/  _______________________________________________________

    If you enjoyed this project or found it helpful, feel free to leave a comment below, share it with others, and subscribe to my YouTube channel Techno Sap for more such detailed tutorials. Whether you’re a beginner or a seasoned developer, I hope this project has inspired you to explore the fascinating world of bio-sensing and robotics.   🙏






    Post a Comment

    Previous Post Next Post