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

Solar-Powered GPS Tracker with ESP32 and TFT Display

View and Edit Project In Cirkit DesignerImage of Solar-Powered GPS Tracker with ESP32 and TFT Display

Circuit Documentation

Summary

This circuit is designed to interface an ESP32 microcontroller with a GPS NEO 6M module and an ILI9341 TFT display. The system is powered by a combination of solar panels and a 2000mAh battery, which is managed by a LiPo battery charger module. The ESP32 reads GPS coordinates from the GPS module and displays them on the TFT display. The circuit also includes a USB female connector for additional power input and an MT3608 module for voltage regulation.

Component List

2000mAh Battery

LiPo Battery Charger Module

GPS NEO 6M

ESP32

ILI9341 TFT Display

Solar Panel

USB Female

MT3608

Pushbutton

Wiring Details

2000mAh Battery

LiPo Battery Charger Module

GPS NEO 6M

ESP32

ILI9341 TFT Display

Solar Panel

USB Female

MT3608

Pushbutton

Code Documentation

/*
 * This Arduino Sketch is designed for an ESP32 microcontroller. It interfaces
 * with a GPS NEO 6M module to get the current coordinates and displays them
 * on an ILI9341 TFT display. The coordinates are updated every 5 seconds.
 */

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ILI9341.h>
#include <TinyGPS++.h>

// GPS module connections
#define GPS_RX_PIN 3  // RX0
#define GPS_TX_PIN 1  // TX0

// TFT display connections
#define TFT_CS 5
#define TFT_RST 26
#define TFT_DC 25
#define TFT_SCK 18
#define TFT_SDO 19
#define TFT_SDI 23

// Create instances for GPS and TFT display
TinyGPSPlus gps;
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);

void setup() {
  // Initialize serial communication for GPS
  Serial.begin(9600);
  Serial2.begin(9600, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);

  // Initialize the TFT display
  tft.begin();
  tft.setRotation(3);
  tft.fillScreen(ILI9341_BLACK);
  tft.setTextColor(ILI9341_WHITE);
  tft.setTextSize(2);

  // Display initial message
  tft.setCursor(10, 10);
  tft.println("Waiting for GPS signal...");
}

void loop() {
  // Read data from GPS module
  while (Serial2.available() > 0) {
    gps.encode(Serial2.read());
  }

  // Check if GPS data is valid
  if (gps.location.isUpdated()) {
    // Clear the screen
    tft.fillScreen(ILI9341_BLACK);

    // Display latitude
    tft.setCursor(10, 10);
    tft.print("Latitude: ");
    tft.println(gps.location.lat(), 6);

    // Display longitude
    tft.setCursor(10, 40);
    tft.print("Longitude: ");
    tft.println(gps.location.lng(), 6);
  }

  // Wait for 5 seconds before updating again
  delay(5000);
}

This code initializes the ESP32 to read data from the GPS NEO 6M module and display the coordinates on the ILI9341 TFT display. The coordinates are updated every 5 seconds.