Arduino UNO GPS Tracker with SMS Notification using GPS NEO 6M and SIM900A
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit interfaces an Arduino UNO with a GPS NEO 6M module and a SIM900A module. The Arduino reads GPS data from the GPS module and sends it via SMS using the SIM900A module. The connections between the components are detailed below, along with the embedded code running on the Arduino.
Component List
GPS NEO 6M
- Description: GPS module for receiving location data.
- Pins: VCC, RX, TX, GND
Arduino UNO
- Description: Microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
SIM900A
- Description: GSM/GPRS module for sending SMS.
- Pins: GND, DB9-3 (RXD), DB9-2 (TXD), 5V, 3VR, 5VR, 3VT, 5VT, VCC, Ring, RESTART, RESET, STATUS
Wiring Details
GPS NEO 6M
- VCC -> Arduino UNO 5V
- RX -> Arduino UNO D7
- TX -> Arduino UNO D8
- GND -> Arduino UNO GND
Arduino UNO
- 5V -> GPS NEO 6M VCC
- D7 -> GPS NEO 6M RX
- D8 -> GPS NEO 6M TX
- GND -> GPS NEO 6M GND
- GND -> SIM900A GND
- D10 -> SIM900A DB9-3 (RXD)
- D9 -> SIM900A DB9-2 (TXD)
SIM900A
- GND -> Arduino UNO GND
- DB9-3 (RXD) -> Arduino UNO D10
- DB9-2 (TXD) -> Arduino UNO D9
Code Documentation
/*
* This Arduino Sketch interfaces with a GPS NEO 6M module and a SIM900A module.
* It reads GPS data and sends it via SMS using the SIM900A module.
*
* Connections:
* GPS NEO 6M -> Arduino UNO
* VCC -> 5V
* GND -> GND
* RX -> D7
* TX -> D8
*
* SIM900A -> Arduino UNO
* GND -> GND
* TXD -> D9
* RXD -> D10
*/
#include <SoftwareSerial.h>
// GPS NEO 6M connections
const int gpsRxPin = 7;
const int gpsTxPin = 8;
// SIM900A connections
const int sim900TxPin = 9;
const int sim900RxPin = 10;
SoftwareSerial gpsSerial(gpsRxPin, gpsTxPin);
SoftwareSerial sim900Serial(sim900RxPin, sim900TxPin);
void setup() {
// Initialize serial communication
Serial.begin(9600);
gpsSerial.begin(9600);
sim900Serial.begin(9600);
// Initialize SIM900A
sim900Serial.println("AT");
delay(1000);
sim900Serial.println("AT+CMGF=1"); // Set SMS to text mode
delay(1000);
}
void loop() {
// Read GPS data
if (gpsSerial.available()) {
String gpsData = gpsSerial.readStringUntil('\n');
Serial.println(gpsData);
// Send GPS data via SMS
sim900Serial.println("AT+CMGS=\"+1234567890\""); // Replace with your number
delay(1000);
sim900Serial.print(gpsData);
delay(1000);
sim900Serial.write(26); // ASCII code for CTRL+Z to send SMS
delay(1000);
}
}
This code initializes the GPS and SIM900A modules, reads GPS data, and sends it via SMS. The connections between the components are specified in the comments for clarity.