This circuit integrates an Arduino Nano with a GPS module (NEO 6M), a GSM module (SIM800L), two arcade buttons (yellow and green), and a polymer lithium-ion battery. The Arduino Nano serves as the central processing unit, interfacing with the GPS module to obtain location data and with the GSM module to send SMS messages and make calls. The arcade buttons are used as input devices, potentially to trigger an action such as sending an alert message. The battery provides power to the system, and resistors are included for necessary voltage/current adjustments or pull-up/pull-down configurations.
D1/TX
connected to TX
of GPS NEO 6MGND
connected to GND
of GPS NEO 6M, SIM800L GSM Module, Polymer Lithium Ion Battery, Arcade Button (yellow), and Arcade Button (green)D7
connected to SIM_TXD
of SIM800L GSM ModuleD8
connected to SIM_RXD
of SIM800L GSM ModuleD10
connected to one terminal of the yellow Arcade Button and a 10k Ohm ResistorD11/MOSI
connected to one terminal of the green Arcade Button and a 10k Ohm ResistorVIN
connected to VCC
of Polymer Lithium Ion Battery and 5V
of SIM800L GSM Module5V
connected to VCC
of GPS NEO 6M and one terminal of a 10k Ohm ResistorVCC
connected to 5V
of Arduino NanoRX
connected to D1/TX
of Arduino NanoGND
connected to GND
of Arduino Nano5V
connected to VIN
of Arduino NanoGND
connected to GND
of Arduino NanoSIM_TXD
connected to D7
of Arduino NanoSIM_RXD
connected to D8
of Arduino NanoD10
of Arduino Nano and a 10k Ohm ResistorD11/MOSI
of Arduino Nano and a 10k Ohm ResistorVCC
connected to VIN
of Arduino NanoGND
connected to GND
of Arduino NanoD10
of Arduino Nano and the yellow Arcade ButtonD11/MOSI
of Arduino Nano and the green Arcade Button#include <TinyGPS.h>
#include <SoftwareSerial.h>
#include <Wire.h>
SoftwareSerial Gsm(6, 7);
char phone_no[] = "+919390801277";
TinyGPS gps;
int state;
String textMessage;
void setup() {
Serial.begin(9600);
Gsm.begin(9600);
Serial.print("AT+CMGF=1\r");
delay(100);
Serial.print("AT+CNMI=2,2,0,0,0\r");
delay(100);
pinMode(10, INPUT);
}
void loop() {
bool newData = false;
unsigned long chars;
unsigned short sentences, failed;
for (unsigned long start = millis(); millis() - start < 1000;) {
while (Serial.available()) {
char c = Serial.read();
Serial.print(c);
if (gps.encode(c))
newData = true;
}
}
if (Gsm.available() > 0) {
textMessage = Gsm.readString();
textMessage.toUpperCase();
delay(10);
}
state = digitalRead(10);
if (state == 0) {
float flat, flon;
unsigned long age;
gps.f_get_position(&flat, &flon, &age);
Gsm.print("AT+CMGF=1\r");
delay(400);
Gsm.print("AT+CMGS=\"");
Gsm.print(phone_no);
Gsm.println("\"");
Gsm.println("Alert I need help.............");
Gsm.print("http://maps.google.com/maps?q=loc:");
Gsm.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
Gsm.print(",");
Gsm.print(flon == TinyGPS ::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
delay(200);
Gsm.println((char)26);
delay(200);
Gsm.println();
Serial.println("SMS Sent");
Serial.println("Call");
delay(20000);
Gsm.println("ATD+919390801277;");
delay(150000);
Gsm.println("ATH");
delay(1000);
} else {
delay(10);
}
Serial.println(failed);
}
This code is designed to run on the Arduino Nano and utilizes the TinyGPS library to parse GPS data and the SoftwareSerial library to communicate with the GSM module. The code reads GPS data and sends an SMS with a Google Maps link to the specified phone number when the button connected to pin D10 is pressed. It also initiates a call to the same number.