With all the technology available to us in recent times, it's not hard to build a safety device for women which will not only generate an emergency alarm but also send a message to your friends, family, or concerned person. Here we will build a band that can be worn by women, using which they can inform police or anyone, using SOS emergency SMS along with the current location. Using this information, the police will be able to save the victim from the location. For this, here we are using an ESP8266 which can be interfaced with GSM and GPS module for sending SMS alerts and getting the location coordinates.
Here we are using the NEO6M GPS module. The NEO-6M GPS module is a popular GPS receiver with a built-in ceramic antenna, which provides a strong satellite search capability. This receiver has the ability to sense locations and track up to 22 satellites and identifies locations anywhere in the world. With the on-board signal indicator, we can monitor the network status of the module. It has a data backup battery so that the module can save the data when the main power is shut down accidentally.
The core heart inside the GPS receiver module is the NEO-6M GPS chip from u-blox. It can track up to 22 satellites on 50 channels and have a very impressive sensitivity level which is -161 dBm. This 50-channel u-blox 6 positioning engine boasts a Time-To-First-Fix (TTFF) of under 1 second. This module supports the baud rate from 4800-230400 bps and has the default baud of 9600.
Features:
- Operating voltage: (2.7-3.6)V DC
- Operating Current: 67 mA
- Baud rate: 4800-230400 bps (9600 Default)
- Communication Protocol: NEMA
- Interface: UART
- External antenna and built-in EEPROM.
Pinout of GPS module:
- VCC: Input voltage pin of Module
- GND: Ground pin
- RX, TX: UART communication pins with Microcontroller
NodeMCU is ESP8266 based development board. It features ESP-12E as its processing core. It is a 32bit MCU. It has 14 GPIO pins, single channel 10 bit integrated ADC. It supports UART, I2C, SPI communication. It is 3.3V compatible, it cannot handle 5V. If you are new to NodeMCU
The connections between NodeMCU and GPS module is as shown below.
NodeMCU GPS module
3V3 Vcc
GNDGND
D1 (GPIO5) RX
D2 (GPIO4) TX
GSM Module SIM900This is a GSM/GPRS-compatible Quad-band cell phone, which works on a frequency of 850/900/1800/1900MHz and which can be used for various applications such as access the Internet, make a voice call, send and receive SMS, etc. The frequency bands of the GSM modem can be set by AT Commands. The baud rate is configurable from 1200-115200 through AT command. The GSM/GPRS Modem is having an internal TCP/IP stack which enables us to connect with the internet via GPRS. This is an SMT type module and designed with a very powerful single-chip processor integrating AMR926EJ-S core, which is very popular in various industrial products.
Technical Specifications:
- Supply voltage: 3.4V – 4.5V
- Power saving mode: Sleep Mode power consumption=.5mA
- Frequency bands: SIM900A Dual-band: EGSM900, DCS1800.
- Operating Temperature: -30ºC to +80ºC
- Supports MIC and Audio Input
- Speaker Input
- UART interface support
- Firmware upgrade by debug port
- Communication: AT Commands
Introduction to AT Commands (CLICK HERE)
Schematic DiagramThe circuit diagram is shown below:
we add small push switch that works as SOS button along with NODEMCU.
CODE
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
static const int RXPin = 2, TXPin = 3;
static const uint32_t GPSBaud = 9600;
int m = 9740;
int y = 71;
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);
SoftwareSerial SIM900(7, 8);
int Buzzer = 4;
String textForSMS;
int Switch = 5;
String datareal;
String dataimaginary;
String combined;
int raw = 1000000;
String datareal2;
String dataimaginary2;
String combined2;
double longitude;
double latitude;
void setup()
{
SIM900.begin(19200);
Serial.begin(9600);
ss.begin(GPSBaud);
delay(10000);
Serial.println(" logging time completed!");
randomSeed(analogRead(0));
pinMode(Switch, INPUT);
digitalWrite(Switch, HIGH);
pinMode(Buzzer, OUTPUT);
digitalWrite(Buzzer, LOW);
Serial.println(F("DeviceExample.ino"));
Serial.print(F("Testing TinyGPS++ library v. "));
Serial.println(TinyGPSPlus::libraryVersion());
Serial.println();
}
void sendSMS(String message)
{
SIM900.print("AT+CMGF=1\r");
delay(100);
SIM900.println("AT + CMGS = \"+918830584864\"");
delay(100);
SIM900.println(message);
delay(100);
SIM900.println((char)26);
delay(100);
SIM900.println();
delay(5000);
}
void loop()
{
int reading;
while (ss.available() > 0)
if (gps.encode(ss.read()))
displayInfo();
if (millis() > 5000 && gps.charsProcessed() < 10)
{
Serial.println(F("No GPS detected: check wiring."));
while (true);
}
if (digitalRead(Switch) == LOW)
{
displayInfo();
latitude = gps.location.lat(), 6 ;
longitude = gps.location.lng(), 6 ;
long datareal = int(latitude);
int fahad = ( latitude - datareal) * 100000;
long datareal2 = int(longitude);
int fahad2 = (longitude - datareal2 ) * 100000;
textForSMS.concat(fahad);
//textForSMS = "Longitude: ";
textForSMS.concat(datareal2);
textForSMS = textForSMS + ".";
textForSMS.concat(fahad2);
//textForSMS = textForSMS + " Latitude: ";
textForSMS.concat(datareal);
textForSMS = textForSMS + ".";
sendSMS(textForSMS);
Serial.println(textForSMS);
Serial.println("message sent.");
delay(5000);
}
else
digitalWrite(Switch, HIGH);
digitalWrite(Buzzer, LOW);
}
void displayInfo()
{
Serial.print(F("Location: "));
if (gps.location.isValid())
{
Serial.print(gps.location.lat(), 6);
Serial.print(F(","));
Serial.print(gps.location.lng(), 6);
Serial.print(" ");
Serial.print(F("Speed:"));
Serial.print(gps.speed.kmph());
}
else
{
Serial.print(F("INVALID"));
}
Serial.print(F(" Date/Time: "));
if (gps.date.isValid())
{
Serial.print(gps.date.month());
Serial.print(F("/"));
Serial.print(gps.date.day());
Serial.print(F("/"));
Serial.print(gps.date.year());
}
else
{
Serial.print(F("INVALID"));
}
Serial.print(F(" "));
if (gps.time.isValid())
{
if (gps.time.hour() < 10) Serial.print(F("0"));
Serial.print(gps.time.hour());
Serial.print(F(":"));
if (gps.time.minute() < 10) Serial.print(F("0"));
Serial.print(gps.time.minute());
Serial.print(F(":"));
if (gps.time.second() < 10) Serial.print(F("0"));
Serial.print(gps.time.second());
Serial.print(F("."));
if (gps.time.centisecond() < 10) Serial.print(F("0"));
Serial.print(gps.time.centisecond());
}
else
{
Serial.print(F("INVALID"));
}
Serial.println();
}
NextPCB PCB Manufacturer Companyfirst thanks to NextPCB for sponsor this project. Nextpcb offer For New Customer, Your First Order Will Be 10 PCBs for just $0 at Free. NextPCB one of the world’s most professional PCB manufacturers based in China. With professional PCB manufacturing capabilities, for each file of our customer will be double-checked by more than 14 years PCB engineers. they handle the whole process of PCBs including the PCB assembly, PCB manufacturing, testing and final shipment.
The video of how this entire tracking system works is shown below
Comments