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

Arduino UNO Based Fall Detection System with GSM Alert

View and Edit Project In Cirkit DesignerImage of Arduino UNO Based Fall Detection System with GSM Alert

Circuit Documentation

Summary

This circuit integrates an Arduino UNO microcontroller with an Adafruit ADXL345 accelerometer, a SIM800L GSM module, and a blue LED with a current-limiting resistor. The Arduino UNO is used as the central processing unit, interfacing with the accelerometer for motion detection and the GSM module for communication purposes. The LED serves as an indicator, and the resistor ensures safe operation of the LED. The embedded code on the Arduino UNO is responsible for initializing the accelerometer and GSM module, detecting a fall condition based on accelerometer data, and sending an SMS alert when such a condition is detected.

Component List

Arduino UNO

Adafruit ADXL345

SIM800L GSM Module

LED: Two Pin (blue)

Resistor (100 Ohms)

Wiring Details

Arduino UNO

Adafruit ADXL345

SIM800L GSM Module

LED: Two Pin (blue)

Resistor (100 Ohms)

Documented Code

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <SoftwareSerial.h>

Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

SoftwareSerial gsm(11, 10);  // RX, TX for GSM Module

void setup() {
  Serial.begin(9600);
  gsm.begin(9600);

  if(!accel.begin()) {
    Serial.println("No ADXL345 sensor detected");
    while(1);
  }
  accel.setRange(ADXL345_RANGE_16_G);

  // Initialize GSM module
  gsm.println("AT"); // Test the GSM module
  delay(1000);
}

void sendSMS() {
  gsm.println("AT+CMGF=1");  // Set SMS mode to text
  delay(100);
  gsm.println("AT+CMGS=\"+919664939499\"");  // Replace with your phone number
  delay(100);
  gsm.print("Fall Detected!");  // Message content
  delay(100);
  gsm.write(26);  // Send Ctrl+Z to end SMS
  delay(1000);
}

void loop() {
  sensors_event_t event; 
  accel.getEvent(&event);

  // Detect fall condition
  if (abs(event.acceleration.x) > 10 || abs(event.acceleration.y) > 10 || abs(event.acceleration.z) < 2) {
    sendSMS();  // Send SMS when fall is detected
    delay(5000);  // Prevent multiple SMS from being sent too frequently
  }
}

This code is designed to run on the Arduino UNO and utilizes the Adafruit ADXL345 accelerometer to detect fall conditions. When a fall is detected, it sends an SMS message using the SIM800L GSM module. The SoftwareSerial library is used to communicate with the GSM module on digital pins 10 and 11. The accelerometer is initialized and checked for presence in the setup() function. The loop() function continuously reads the accelerometer data and checks for a fall condition, defined by specific thresholds of acceleration. If a fall is detected, the sendSMS() function is called to send an alert message.