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

Arduino Nano Based GPS Tracker with GSM Module and Panic Buttons

View and Edit Project In Cirkit DesignerImage of Arduino Nano Based GPS Tracker with GSM Module and Panic Buttons

Circuit Documentation

Summary

This circuit integrates an Arduino Nano with a GPS module (NEO 6M), a GSM module (SIM800L), two arcade buttons (yellow and green), and a polymer lithium-ion battery. The Arduino Nano serves as the central processing unit, interfacing with the GPS module to obtain location data and with the GSM module to send SMS messages and make calls. The arcade buttons are used as input devices, potentially to trigger an action such as sending an alert message. The battery provides power to the system, and resistors are included for necessary voltage/current adjustments or pull-up/pull-down configurations.

Component List

Arduino Nano

GPS NEO 6M

SIM800L GSM Module

Arcade Button (Yellow)

Arcade Button (Green)

Polymer Lithium Ion Battery - 850mAh

Resistor (10k Ohms)

Wiring Details

Arduino Nano

GPS NEO 6M

SIM800L GSM Module

Arcade Button (Yellow)

Arcade Button (Green)

Polymer Lithium Ion Battery - 850mAh

Resistor (10k Ohms)

Documented Code

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

SoftwareSerial Gsm(6, 7);
char phone_no[] = "+919390801277";
TinyGPS gps;
int state;
String textMessage;

void setup() {
  Serial.begin(9600);
  Gsm.begin(9600);
  Serial.print("AT+CMGF=1\r");
  delay(100);
  Serial.print("AT+CNMI=2,2,0,0,0\r");
  delay(100);
  pinMode(10, INPUT);
}

void loop() {
  bool newData = false;
  unsigned long chars;
  unsigned short sentences, failed;
  for (unsigned long start = millis(); millis() - start < 1000;) {
    while (Serial.available()) {
      char c = Serial.read();
      Serial.print(c);
      if (gps.encode(c))
        newData = true;
    }
  }
  if (Gsm.available() > 0) {
    textMessage = Gsm.readString();
    textMessage.toUpperCase();
    delay(10);
  }
  state = digitalRead(10);
  if (state == 0) {
    float flat, flon;
    unsigned long age;
    gps.f_get_position(&flat, &flon, &age);
    Gsm.print("AT+CMGF=1\r");
    delay(400);
    Gsm.print("AT+CMGS=\"");
    Gsm.print(phone_no);
    Gsm.println("\"");
    Gsm.println("Alert I need help.............");
    Gsm.print("http://maps.google.com/maps?q=loc:");
    Gsm.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
    Gsm.print(",");
    Gsm.print(flon == TinyGPS ::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
    delay(200);
    Gsm.println((char)26);
    delay(200);
    Gsm.println();
    Serial.println("SMS Sent");

    Serial.println("Call");
    delay(20000);
    Gsm.println("ATD+919390801277;");
    delay(150000);
    Gsm.println("ATH");
    delay(1000);
  } else {
    delay(10);
  }
  Serial.println(failed);
}

This code is designed to run on the Arduino Nano and utilizes the TinyGPS library to parse GPS data and the SoftwareSerial library to communicate with the GSM module. The code reads GPS data and sends an SMS with a Google Maps link to the specified phone number when the button connected to pin D10 is pressed. It also initiates a call to the same number.