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

Arduino Nano GPS Tracker with GSM and OLED Display

View and Edit Project In Cirkit DesignerImage of Arduino Nano GPS Tracker with GSM and OLED Display

Circuit Documentation

Summary

This circuit integrates an Arduino Nano microcontroller with a SIM800L GSM module, a GPS NEO 6M module, a 1.3" OLED display, and a 3.3V battery. The Arduino Nano serves as the central controller, interfacing with the GSM module for communication, the GPS module for location tracking, and the OLED display for visual output. The 3.3V battery powers the entire setup.

Component List

Arduino Nano

SIM800L GSM Module

GPS NEO 6M

3.3V Battery

1.3" OLED Display Module

Wiring Details

Arduino Nano

SIM800L GSM Module

GPS NEO 6M

3.3V Battery

1.3" OLED Display Module

Code Documentation

Arduino Nano Code

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

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET    -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

SoftwareSerial gpsSerial(2, 3); // RX, TX
SoftwareSerial gsmSerial(0, 1); // RX, TX

TinyGPSPlus gps;

void setup() {
  Serial.begin(9600);
  gpsSerial.begin(9600);
  gsmSerial.begin(9600);

  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("SSD1306 allocation failed"));
    for(;;);
  }
  display.display();
  delay(2000);
  display.clearDisplay();
}

void loop() {
  while (gpsSerial.available() > 0) {
    gps.encode(gpsSerial.read());
    if (gps.location.isUpdated()) {
      display.clearDisplay();
      display.setTextSize(1);
      display.setTextColor(SSD1306_WHITE);
      display.setCursor(0, 0);
      display.print("Lat: ");
      display.println(gps.location.lat(), 6);
      display.print("Lng: ");
      display.println(gps.location.lng(), 6);
      display.display();

      // Send GPS coordinates via GSM
      gsmSerial.print("AT+CMGF=1\r");
      delay(100);
      gsmSerial.print("AT+CMGS=\"+1234567890\"\r"); // Replace with your phone number
      delay(100);
      gsmSerial.print("Lat: ");
      gsmSerial.print(gps.location.lat(), 6);
      gsmSerial.print(" Lng: ");
      gsmSerial.print(gps.location.lng(), 6);
      delay(100);
      gsmSerial.write(26); // ASCII code of CTRL+Z
      delay(1000);
    }
  }
}

This code initializes the OLED display, GPS module, and GSM module. It reads GPS data and displays the latitude and longitude on the OLED display. Additionally, it sends the GPS coordinates via SMS using the GSM module.