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.
5V
connected to the 5V
power supply of the SIM800L GSM Module and VIN
of the Adafruit ADXL345GND
connected to the ground pins of the SIM800L GSM Module, Adafruit ADXL345, and one terminal of the resistorD10
connected to SIM_TXD
of the SIM800L GSM ModuleD11
connected to SIM_RXD
of the SIM800L GSM ModuleD2
connected to RST
of the SIM800L GSM ModuleA4
connected to SDA/SDIO
of the Adafruit ADXL345A5
connected to SCL
of the Adafruit ADXL345D5
connected to the cathode
of the LEDVIN
connected to 5V
of the Arduino UNOGND
connected to GND
of the Arduino UNOSDA/SDIO
connected to A4
of the Arduino UNOSCL
connected to A5
of the Arduino UNO5V
connected to 5V
of the Arduino UNOGND
connected to GND
of the Arduino UNOSIM_TXD
connected to D10
of the Arduino UNOSIM_RXD
connected to D11
of the Arduino UNORST
connected to D2
of the Arduino UNOcathode
connected to D5
of the Arduino UNOanode
connected to one terminal of the resistorGND
of the Arduino UNOanode
of the LED#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.