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

Arduino UNO and Nano Based GPS Tracker with GSM and Sound Detection

View and Edit Project In Cirkit DesignerImage of Arduino UNO and Nano Based GPS Tracker with GSM and Sound Detection

Circuit Documentation

Summary

The circuit in question is designed to integrate various modules with an Arduino UNO microcontroller as the central processing unit. The circuit includes a pushbutton for user input, a SIM800L GSM module for cellular communication, a Neo 6M GPS module for location tracking, a sound sensor for audio detection, and an ESP32-CAM for wireless communication and camera functionalities. A resistor is used for pull-up configuration on the pushbutton, and a 9V battery provides power to the GSM module. The Arduino Nano and GSM SIM900 modules are also present in the parts list but are not integrated into the circuit based on the provided net list.

Component List

Arduino UNO

Pushbutton

SIM800L GSM Module

Resistor

9V Battery

Neo 6M GPS Module

Sound Sensor

ESP32-CAM

Wiring Details

Arduino UNO

Pushbutton

SIM800L GSM Module

Resistor

9V Battery

Neo 6M GPS Module

Sound Sensor

ESP32-CAM

Documented Code

Arduino UNO Code

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

// Define pin numbers
const int buttonPin = 2;  // Push button connected to digital pin 2
const int gsmRxPin = 10;  // RX pin of GSM module
const int gsmTxPin = 11;  // TX pin of GSM module
const int gpsRxPin = 4;   // RX pin of GPS module
const int gpsTxPin = 3;   // TX pin of GPS module

// Create software serial objects
SoftwareSerial gsmSerial(gsmRxPin, gsmTxPin);
SoftwareSerial gpsSerial(gpsRxPin, gpsTxPin);

// Create a TinyGPS++ object
TinyGPSPlus gps;

// Variables
int buttonState = 0;
bool messageSent = false;
const char* phoneNumber = "+1234567890";  // Replace with the desired phone number
const char* message = "Emergency! Help needed at this location: ";

void setup() {
  Serial.begin(9600);
  gsmSerial.begin(9600);
  gpsSerial.begin(9600);
  
  pinMode(buttonPin, INPUT_PULLUP);
  
  // Initialize GSM module
  delay(1000);
  gsmSerial.println("AT");
  delay(1000);
  gsmSerial.println("AT+CMGF=1"); // Set SMS text mode
  delay(1000);
}

void loop() {
  // Update GPS data
  while (gpsSerial.available() > 0) {
    gps.encode(gpsSerial.read());
  }

  buttonState = digitalRead(buttonPin);

  if (buttonState == LOW && !messageSent) {
    sendSMS();
    messageSent = true;
  }
  
  if (buttonState == HIGH) {
    messageSent = false;
  }
}

void sendSMS() {
  Serial.println("Button pressed, sending SMS with location...");
  
  String locationMessage = message;
  
  if (gps.location.isValid()) {
    locationMessage += "http://maps.google.com/maps?q=";
    locationMessage += String(gps.location.lat(), 6);
    locationMessage += ",";
    locationMessage += String(gps.location.lng(), 6);
  } else {
    locationMessage += "GPS location not available";
  }
}

Arduino Nano Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

(Note: The Arduino Nano code provided is empty and does not perform any function in the current circuit configuration.)