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

Arduino Nano-Based GPS and GSM Emergency Alert System with Battery Power

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Based GPS and GSM Emergency Alert System with Battery Power

Circuit Documentation

Summary

This circuit involves two Arduino Nano microcontrollers, a GPS NEO 6M module, a SIM 800L module, pushbuttons, resistors, a 2000mAh battery, a TP4056 battery charger, and a buzzer. The circuit is designed to send SMS alerts and make calls when specific buttons are pressed, using GPS data to provide location information.

Component List

  1. Arduino Nano

    • Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
    • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
  2. Pushbutton

    • Description: A simple pushbutton switch.
    • Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
  3. 2000mAh Battery

    • Description: A rechargeable battery providing power to the circuit.
    • Pins: VCC, GND
  4. Resistor

    • Description: A 200 Ohm resistor used for current limiting.
    • Pins: pin1, pin2
    • Properties: Resistance: 200 Ohms
  5. GPS NEO 6M

    • Description: A GPS module used for obtaining location data.
    • Pins: VCC, RX, TX, GND
  6. TP4056

    • Description: A lithium battery charger module.
    • Pins: OUT-, B-, B+, OUT+, IN-, IN+
  7. Buzzer

    • Description: An audio signaling device.
    • Pins: PIN, GND
  8. SIM 800L

    • Description: A GSM/GPRS module used for sending SMS and making calls.
    • Pins: NFT, RING, VCC, DTR, RST, MIC +, RXD, MIC-, TXD, SPK+, GND, SPK-

Wiring Details

Arduino Nano

Pushbutton

2000mAh Battery

Resistor

GPS NEO 6M

TP4056

Buzzer

SIM 800L

Documented Code

Arduino Nano (Instance 1)

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

}

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

}

Arduino Nano (Instance 2)

#include <TinyGPS.h>
#include <SoftwareSerial.h>
#include <Wire.h>
SoftwareSerial Gsm(7, 8);
char phone_no[] = "+9188305848xx";  //For SMS
TinyGPS gps;
int state;
String textMessage;

void setup() {
  Serial.begin(9600);
  Gsm.begin(9600);
  delay(2000);

  Serial.print("AT+CMGF=1\r");
  delay(100);
  Serial.print("AT+CNMI=2,2,0,0,0\r");
  delay(100);
  pinMode(4, INPUT);
  pinMode(5, 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(4);
  if (state == 1)  //When Button is Press
  {
    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();
    delay(10000);
  } else {
    delay(10);
  }

  state = digitalRead(5);
  if (state == 1)  //When Button is Press
  {

    Serial.println("OK");
    delay(20000);
    Gsm.println("ATD+9188305848xx;");  //For Call
    delay(150000);
    Gsm.println("ATH");
    delay(1000);

  } else {
    delay(10);
  }
  Serial.println(failed);
}

This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and documented code for the microcontrollers.