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

Battery-Powered Emergency Alert System with NUCLEO-F072RB, SIM800L, and GPS NEO 6M

View and Edit Project In Cirkit DesignerImage of Battery-Powered Emergency Alert System with NUCLEO-F072RB, SIM800L, and GPS NEO 6M

Emergency Alert System Documentation

Summary

This project is an Emergency Alert System that uses a NUCLEO-F072RB microcontroller to send alert messages and make calls to trusted persons. The system incorporates a SIM800L module for GSM communication and a GPS NEO 6M module to obtain location data. The system is powered by a Li-ion battery and includes a TP4056 module for battery management and charging. A rocker switch is used to control the power supply to the system.

Component List

  1. TP4056

    • Description: Battery management and charging module.
    • Pins: OUT-, B-, B+, OUT+, IN-, IN+
  2. Rocker Switch (SPST)

    • Description: Single Pole Single Throw switch to control power.
    • Pins: 1, 2
  3. Li-ion battery 18650-2000mAh 3.7V 7.4WH

    • Description: Power source for the circuit.
    • Pins: +, -
  4. SIM800L

    • Description: GSM module for communication.
    • Pins: NET, VCC, RST, RXD, TXD, GND, RING, DTR, MIC+, MIC-, SPK+, SPK-
  5. GPS NEO 6M

    • Description: GPS module for location tracking.
    • Pins: VCC, RX, TX, GND
  6. NUCLEO-F072RB

    • Description: Microcontroller for controlling the system.
    • Pins: A5, A4, A3, A2, A1, A0, VN, GND, 5V, 3V3, RESET, IOREF, SCL/D15, SDA/D14, AVDD, SCK/D13, MISO/D12, PWM/MOSI/D11, PWM/CS/D10, PWM/D9, D8, D7, PWM/D6, PWM/D5, D4, PWM/D3, D2, TX/D1, RX/D0

Wiring Details

TP4056

Rocker Switch (SPST)

Li-ion battery 18650-2000mAh 3.7V 7.4WH

SIM800L

GPS NEO 6M

NUCLEO-F072RB

Code Documentation

/*
 * Project: Emergency Alert System
 * Description: This project uses a NUCLEO-F072RB microcontroller to send alert messages
 * and make calls to trusted persons. It uses a SIM800L module for GSM communication
 * and a GPS NEO 6M module to get the location.
 */

#include <SoftwareSerial.h>

// Define pins for SIM800L
#define SIM800_TX A0
#define SIM800_RX A1

// Define pins for GPS NEO 6M
#define GPS_TX D2

// Create software serial ports
SoftwareSerial sim800(SIM800_TX, SIM800_RX);
SoftwareSerial gps(GPS_TX, -1); // GPS RX pin not used

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  sim800.begin(9600);
  gps.begin(9600);

  // Wait for SIM800L to initialize
  delay(1000);

  // Send SMS alert
  sendSMS("+1234567890", "Emergency! Check location.");

  // Make a call
  makeCall("+1234567890");
}

void loop() {
  // Continuously check GPS data
  if (gps.available()) {
    String gpsData = gps.readStringUntil('\n');
    Serial.println(gpsData);
  }
}

void sendSMS(const char* number, const char* message) {
  sim800.println("AT+CMGF=1"); // Set SMS mode to text
  delay(1000);
  sim800.print("AT+CMGS=\"");
  sim800.print(number);
  sim800.println("\"");
  delay(1000);
  sim800.println(message);
  delay(1000);
  sim800.write(26); // ASCII code for CTRL+Z
  delay(1000);
}

void makeCall(const char* number) {
  sim800.print("ATD");
  sim800.print(number);
  sim800.println(";");
  delay(10000); // Wait for 10 seconds
  sim800.println("ATH"); // Hang up the call
  delay(1000);
}

This documentation provides a comprehensive overview of the Emergency Alert System, including a summary, detailed component list, wiring details, and the embedded code used in the project.