Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP8266 and GPS-RTK2 Based Real-Time GPS Tracker with Bluetooth and APC220 Communication

View and Edit Project In Cirkit DesignerImage of ESP8266 and GPS-RTK2 Based Real-Time GPS Tracker with Bluetooth and APC220 Communication

Circuit Documentation

Summary

This circuit integrates a GPS module, a Bluetooth module, a radio communication module, and a microcontroller (ESP8266 NodeMCU) to create a GPS tracking system. The GPS module provides location data, which is processed by the ESP8266. The processed data can be transmitted via Bluetooth or radio communication. The system is powered by a 5V battery.

Component List

  1. SparkFun Qwiic GPS-RTK2 - ublox ZED-F9P

    • Description: High-precision GPS module
    • Pins: 1, TX2, RX2, 3.3V, 5, GND, SDA/!CS, SCL/SCK, FENCE_STAT, RTK_STAT, PPS, !RESET, !SAFE, INT, TXO/MISO, RXI/MOSI, 5V
  2. esp8266 nodemcu

    • Description: Wi-Fi microcontroller
    • Pins: D0, D1, D2, D3, D4, 3V3, GND, D5, D6, D7, D8, RX, TX, A0, RSV, SD3, SD2, SD1, CMD, SD0, CLK, EN, RST, VIN
  3. Antenna GPS Embedded SMA

    • Description: GPS antenna
    • Pins: VCC, GND
  4. 5V Battery

    • Description: Power source
    • Pins: +, -
  5. HC-05 Bluetooth Module

    • Description: Bluetooth communication module
    • Pins: Key, VCC, GND, TXD, RXD, State
  6. APC220

    • Description: Radio communication module
    • Pins: GND, VCC, EN, RXD, TXD, AUX, SET

Wiring Details

SparkFun Qwiic GPS-RTK2 - ublox ZED-F9P

esp8266 nodemcu

Antenna GPS Embedded SMA

5V Battery

HC-05 Bluetooth Module

APC220

Documented Code

#include <SoftwareSerial.h>
#include <TinyGPS++.h>

// Define the RX and TX pins for Software Serial 2
#define RX 12
#define TX 14

#define GPS_BAUD 9600

// The TinyGPS++ object
TinyGPSPlus gps;

// Create an instance of Software Serial
SoftwareSerial gpsSerial(RX, TX);

void setup() {
  // Serial Monitor
  Serial.begin(115200);
  
  // Start Serial 2 with the defined RX and TX pins and a baud rate of 9600
  gpsSerial.begin(GPS_BAUD);
  Serial.println("Software Serial started at 9600 baud rate");
}

void loop() {
  // This sketch displays information every time a new sentence is correctly encoded.
  unsigned long start = millis();

  while (millis() - start < 1000) {
    while (gpsSerial.available() > 0) {
      gps.encode(gpsSerial.read());
    }
    if (gps.location.isUpdated()) {
      Serial.print("LAT: ");
      Serial.println(gps.location.lat(), 6);
      Serial.print("LONG: "); 
      Serial.println(gps.location.lng(), 6);
      Serial.print("SPEED (km/h) = "); 
      Serial.println(gps.speed.kmph()); 
      Serial.print("ALT (min)= "); 
      Serial.println(gps.altitude.meters());
      Serial.print("HDOP = "); 
      Serial.println(gps.hdop.value() / 100.0); 
      Serial.print("Satellites = "); 
      Serial.println(gps.satellites.value()); 
      Serial.print("Time in UTC: ");
      Serial.println(String(gps.date.year()) + "/" + String(gps.date.month()) + "/" + String(gps.date.day()) + "," + String(gps.time.hour()) + ":" + String(gps.time.minute()) + ":" + String(gps.time.second()));
      Serial.println("");
    }
  }
}

This code initializes the GPS module and reads the GPS data, which is then printed to the Serial Monitor. The data includes latitude, longitude, speed, altitude, HDOP, number of satellites, and the current time in UTC.