Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

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

Image 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

  • Microcontroller board based on the ATmega328P
  • Used as the main controller for the circuit

Pushbutton

  • A simple switch mechanism for control of a circuit
  • Used for user input to trigger actions

SIM800L GSM Module

  • A complete Quad-band GSM/GPRS solution
  • Used for cellular communication capabilities

Resistor

  • A passive two-terminal electrical component
  • Used to limit current flow and adjust signal levels

9V Battery

  • A standard size of battery with a nominal voltage of 9V
  • Used to provide power to the GSM module

Neo 6M GPS Module

  • A GPS receiver module
  • Used for obtaining geographical location data

Sound Sensor

  • An audio detecting sensor with digital and analog outputs
  • Used for detecting sound levels in the environment

ESP32-CAM

  • A small-sized ESP32-based module with a camera
  • Used for wireless communication and capturing images or video

Wiring Details

Arduino UNO

  • 5V connected to the 5V power rail supplying power to other components
  • GND connected to the ground rail
  • D11 connected to SIM800L GSM Module SIM_RXD
  • D10 connected to SIM800L GSM Module SIM_TXD
  • D4 connected to Neo 6M GPS Module TX
  • D3 connected to Neo 6M GPS Module RX
  • D2 connected to one terminal of the Pushbutton
  • D1 connected to ESP32-CAM VOT
  • D0 connected to ESP32-CAM VOR

Pushbutton

  • One terminal connected to Arduino UNO D2
  • Another terminal connected to one end of the Resistor (other end to GND)

SIM800L GSM Module

  • 5V connected to 9V Battery +
  • GND connected to 9V Battery -
  • SIM_TXD connected to Arduino UNO D10
  • SIM_RXD connected to Arduino UNO D11

Resistor

  • One end connected to Pushbutton
  • Other end connected to GND

9V Battery

  • + connected to SIM800L GSM Module 5V
  • - connected to SIM800L GSM Module GND

Neo 6M GPS Module

  • VCC connected to 5V power rail
  • GND connected to ground rail
  • TX connected to Arduino UNO D4
  • RX connected to Arduino UNO D3

Sound Sensor

  • VCC connected to Arduino Nano 5V
  • GND connected to Arduino Nano GND
  • Digital connected to Arduino Nano 5V
  • Analog connected to Arduino Nano A1

ESP32-CAM

  • 5V connected to 5V power rail
  • GND connected to ground rail
  • VOT connected to Arduino UNO D1
  • VOR connected to Arduino UNO D0

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.)