Project admin

This project is private.

Akriti Tiwari
Created January 17, 2023

Human Safety Device

This work explains a signal alarming system for anyone’s safety using GPS and GSM modules.

104
Human Safety Device

Things used in this project

Hardware components

Neo 6m GPS Module
×1
sim800L GSM module
×1
Arduino UNO
Arduino UNO
Arduino Nano can be used to make the device more compact.
×1
Bmp 180 Pressure Sensor Module
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

10 Pc. Jumper Wire Kit, 5 cm Long
10 Pc. Jumper Wire Kit, 5 cm Long

Story

Read more

Schematics

Schematic and Circuit Diagram

To connect different modules with each other.

Code

Microcontroller Code

C/C++
This code is for micro-controller
#include <SoftwareSerial.h>
#include <TinyGPS.h>
#include <Adafruit_BMP085.h>
SoftwareSerial sim(10,11);
Adafruit_BMP085 bmp;
//long   lat,lon; 
float lat,lon; 
SoftwareSerial gpsSerial(3,4);
TinyGPS gps; 
String number = "+919129999xxx";// receiver number;
String SMS;
String _buffer;
int _timeout;
String latitude = String(lat,6);
String longitude = String(lon,6);


void setup(){
delay(10000);  
Serial.begin(9600);
_buffer.reserve(50);
Serial.println("System started...");
sim.begin(9600);
if(!bmp.begin()){
  Serial.println("BMP sensor not connected properly!");
  while (1){}
 }
Serial.println("The GPS Received Signal:");
gpsSerial.begin(9600); // connect gps sensor
}
 
void loop(){
  
  
  if(sim.available()>0)
   Serial.write(sim.read());      
  Serial.print("Pressure = ");
  Serial.print(bmp.readPressure());
  Serial.println();
  
  
  if(bmp.readPressure()>99800){
    
     SendMessage();
     location();
  }
    
 else{
     delay(500);
      
  }
  delay(1000);
}
    void location(){
    while(gpsSerial.available()){ 
    if(gps.encode(gpsSerial.read()))
    { 
    gps.f_get_position(&lat,&lon); 
    Serial.print("Position: ");
    Serial.print("Latitude:");
    Serial.print(lat,6);
    Serial.print(";");
    Serial.print("Longitude:");
    Serial.println(lon,6); 
    Serial.print(lat);
    Serial.print(" "); 
    
   }
  }
  
  String latitude = String(lat,6);
    String longitude = String(lon,6);
  Serial.println(latitude+";"+longitude);
  delay(1000); 
}

void SendMessage()
{
  Serial.println ("Sending Message");
  sim.println("AT+CMGF=1");    
  delay(200);
  Serial.println ("Set SMS Number");
  sim.println("AT+CMGS=\"" + number + "\"\r"); 
  delay(200);
  String SMS = "https://www.google.com/maps/search/?api=1&query=" +latitude +"," +longitude;
  sim.println(SMS);
  delay(100);
  sim.println((char)26);
  delay(200);
  _buffer = _readSerial();
}

String _readSerial() {
  _timeout = 0;
  while  (!sim.available() && _timeout < 12000  )
  {
    delay(13);
    _timeout++;
  }
  if (sim.available()) {
    return sim.readString();
  }
}

Credits

Akriti Tiwari
0 projects • 0 followers

Comments