Building a real-time vehicle tracker or remote sensor with GSM and GPS modules on Arduino is one of the most practical IoT projects you can undertake. Unlike WiFi-based solutions, a GSM+GPS tracker works anywhere in India with mobile network coverage – your car, courier package, or livestock on a remote farm. This comprehensive tutorial covers the SIM800L GSM module, the NEO-6M GPS module, wiring both to an Arduino or ESP32, sending coordinates via SMS, uploading data via GPRS to a cloud server, and solving the real-world challenges like power spikes and Indian SIM card requirements.
Table of Contents
- GSM Module Basics: SIM800L and SIM800C
- GPS Module Basics: NEO-6M
- Wiring GSM + GPS to Arduino/ESP32
- Sending GPS Coordinates via SMS
- Uploading Data via GPRS to a Server
- Building a Vehicle Tracker
- Power Considerations: SIM800L Current Spikes
- Indian SIM Card Requirements
- Antenna Placement
- NMEA Data Parsing
- Combining with a Cloud Platform
- FAQ
GSM Module Basics: SIM800L and SIM800C
The SIM800L is a compact GSM/GPRS module based on SIMCom’s SIM800L chip. It supports quad-band GSM (850/900/1800/1900 MHz), which covers all Indian operator frequencies. Key capabilities include:
- Voice calls and SMS (send and receive)
- GPRS Class 10 data (85.6 kbps download, 42.8 kbps upload) – think of it as 2G internet
- TCP/IP stack built into the module (you send AT commands to open sockets)
- Operating voltage: 3.4-4.4V (important – it is NOT 5V tolerant and NOT 3.3V directly; it needs 3.7-4.2V)
The SIM800C is an improved variant with better power management and a slightly larger footprint, available as a standalone modem board with onboard antenna and SMA connector.
GPS Module Basics: NEO-6M
The u-blox NEO-6M is the most popular entry-level GPS module for maker projects. It provides:
- Position accuracy: 2.5 m CEP (Circular Error Probable) in open sky
- Cold start time to first fix (TTFF): 27 seconds typical with no almanac
- Hot start (has almanac): 1 second
- Update rate: 1 Hz standard (5 Hz max)
- Output: Standard NMEA 0183 serial protocol at 9600 baud
- Onboard flash memory to save almanac data (speeds up future fixes)
- Operating voltage: 3.3V (some breakout boards have a 3.3V regulator for 5V input)
The NEO-6M outputs sentences like and which contain latitude, longitude, speed, and time. You parse these to extract location data.
Wiring GSM + GPS to Arduino/ESP32
Both modules communicate via UART serial. Since Arduino Uno has only one hardware UART, use SoftwareSerial for one of them. ESP32 is better suited here because it has three hardware UART ports.
Connections (ESP32 recommended):
// NEO-6M GPS Module
GPS TX --> ESP32 GPIO 16 (UART2 RX)
GPS RX --> ESP32 GPIO 17 (UART2 TX)
GPS VCC --> 3.3V
GPS GND --> GND
// SIM800L GSM Module
SIM800L TX --> ESP32 GPIO 26 (use SoftwareSerial or UART1)
SIM800L RX --> ESP32 GPIO 27
SIM800L VCC --> 3.7-4.2V (from LiPo or buck converter - see power section!)
SIM800L GND --> GND (common with ESP32 GND)
SIM800L RST --> ESP32 GPIO 5 (optional, for hardware reset)
For Arduino Uno (with SoftwareSerial):
GPS TX --> Arduino Pin 4 (SoftwareSerial RX)
GPS RX --> Arduino Pin 3 (SoftwareSerial TX)
SIM800L TX --> Arduino Pin 8 (another SoftwareSerial)
SIM800L RX --> Arduino Pin 9
// Note: SIM800L VCC cannot come from Arduino 5V pin - too low current!
Sending GPS Coordinates via SMS
This is the simplest tracking application: call or SMS the tracker, and it replies with a Google Maps link containing its current location.
#include <HardwareSerial.h>
#include <TinyGPS++.h> // Library Manager: TinyGPS++ by Mikal Hart
HardwareSerial gpsSerial(2); // UART2 for GPS
HardwareSerial simSerial(1); // UART1 for SIM800L
TinyGPSPlus gps;
String ownerPhone = "+919876543210"; // Your phone number
void sendSMS(String phone, String message) {
simSerial.println("AT+CMGF=1"); // Text mode
delay(500);
simSerial.println("AT+CMGS="" + phone + """);
delay(500);
simSerial.print(message);
simSerial.write(26); // Ctrl+Z to send
delay(3000);
}
void setup() {
Serial.begin(115200);
gpsSerial.begin(9600, SERIAL_8N1, 16, 17);
simSerial.begin(9600, SERIAL_8N1, 26, 27);
delay(3000); // Wait for SIM800L to register on network
simSerial.println("AT"); // Basic test
delay(1000);
}
void loop() {
while (gpsSerial.available()) gps.encode(gpsSerial.read());
if (gps.location.isValid() && gps.location.isUpdated()) {
float lat = gps.location.lat();
float lng = gps.location.lng();
String link = "https://maps.google.com/?q=" + String(lat, 6) + "," + String(lng, 6);
sendSMS(ownerPhone, "Tracker Location: " + link);
delay(60000); // Send every 1 minute
}
}
To trigger on demand, add code to read incoming SMS using AT+CNMI=2,2,0,0,0 (new message indication) and respond only when you send the word “LOCATE” to the SIM card number.
Uploading Data via GPRS to a Server
For continuous tracking with a live map, use GPRS to send GPS data to a server. The SIM800L has a built-in TCP/IP stack controlled by AT commands:
void gprsConnect(String apn) {
simSerial.println("AT+SAPBR=3,1,"Contype","GPRS"");
delay(500);
simSerial.println("AT+SAPBR=3,1,"APN","" + apn + """);
delay(500);
simSerial.println("AT+SAPBR=1,1"); // Open bearer
delay(3000);
simSerial.println("AT+HTTPINIT");
delay(500);
}
void sendGPStoServer(float lat, float lng) {
String url = "http://your-server.com/api/track?lat=" + String(lat, 6)
+ "&lng=" + String(lng, 6)
+ "&device=tracker1";
simSerial.println("AT+HTTPPARA="URL","" + url + """);
delay(500);
simSerial.println("AT+HTTPACTION=0"); // GET request
delay(5000);
// Parse response with AT+HTTPREAD
}
For the server, you can use a free tier on any cloud provider. A simple PHP script that stores lat/lng in a database and serves a Leaflet.js map is sufficient for basic tracking. Services like ThingsBoard, Traccar (open source), and GPSLogger platforms provide ready-made tracking backends.
Building a Vehicle Tracker
A complete vehicle tracker needs these components working together:
- GPS fix acquisition: Wait for a valid GPS fix (can take up to 60 seconds on cold start in an enclosed vehicle). Use the LED on the NEO-6M board – it blinks once per second when a fix is acquired.
- Ignition detection: Optionally detect vehicle ignition by reading 12V from the ignition wire through a voltage divider to an ADC pin. Start tracking only when the engine is on.
- Geofence alerts: Calculate distance from a home/office location using the Haversine formula. Send an SMS if the vehicle leaves the geofence radius.
- Data logging: If GPRS is unavailable (tunnel, underground parking), buffer GPS tracks in EEPROM or SPIFFS and upload when connectivity is restored.
- Power management: When parked, reduce GPS update rate to 0.1 Hz and SIM800L to sleep mode to save battery.
Power Considerations: SIM800L Current Spikes
This is the most common reason SIM800L projects fail. The SIM800L can draw up to 2A peak current during GSM transmission bursts (every 4.6 ms). Most 3.3V regulators on Arduino boards can only supply 150-800 mA continuously and cannot handle these spikes. Symptoms: the module resets randomly, sends incomplete AT command responses, or fails to register on the network.
Solutions:
- Use a dedicated 3.7V LiPo battery for SIM800L: Connect the SIM800L VCC directly to a 3.7V LiPo cell (3.4-4.2V range is perfect) with a beefy ground connection. The LiPo can easily source 2A+.
- Add a bulk capacitor: Place a 1000-4700 uF electrolytic capacitor (6.3V rating) across the SIM800L VCC and GND pins as close to the module as possible. This smooths the current spikes.
- Use a buck converter: A DC-DC step-down module (like XL4016) set to 4.0V with a high-current input (12V car battery for vehicle trackers) provides stable supply.
- TTGO T-Call board: This all-in-one ESP32+SIM800L board solves the power problem by design – use it for the easiest setup.
Indian SIM Card Requirements
For SIM800L and SIM800C modules to work in India:
- SIM size: These modules use a standard/mini SIM (2FF, the large one). If your SIM is micro or nano, use a SIM adapter.
- Operator compatibility: All major operators work – Jio, Airtel, Vi (Vodafone-Idea), BSNL. Jio is VoLTE-only (4G voice) so SMS works but voice calls may not on 2G-only modules like SIM800L. Airtel and Vi still maintain 2G networks ideal for SIM800L.
- APN settings: Required for GPRS data:
- Airtel: APN =
airtelgprs.com - Jio: APN =
jionet - Vi: APN =
portalnmms - BSNL: APN =
bsnlnet
- Airtel: APN =
- Data plan: Get a basic 2G/GPRS data pack or use any active data plan – SIM800L uses standard GPRS which is supported by all plans.
- SIM registration: Use your Aadhaar-linked SIM. Unregistered SIMs will not work. Outgoing SMS may need to be enabled – check with your operator if SMS fails.
Antenna Placement
GPS antenna: The NEO-6M has a small ceramic patch antenna on the module itself. It must have a clear view of the sky – GPS signals (1575.42 MHz) do not penetrate vehicle metal roofs or concrete walls. For a car tracker, mount the module on the dashboard near the windshield or use an active external GPS antenna (SMA connector) routed to the roof. GPS time to first fix degrades significantly inside buildings.
GSM antenna: The SIM800L module typically has a small spring or wire antenna. For better range and reliability, replace with a proper GSM rubber duck antenna (SMA connector). In a vehicle, mount the antenna away from the ignition system to minimise interference. The TTGO T-Call board and SIM800C modem both include proper external antennas.
NMEA Data Parsing
GPS modules output NMEA 0183 sentences over serial. The two most useful for tracking are:
// - Recommended Minimum Sentence (position + speed + time)
,123519,A,1849.1234,N,07306.5678,E,0.00,054.7,191024,003.1,W*6A
// time status lat N/S lon E/W speed course date mag var
// - Fix data (position + altitude + satellites)
,123519,1849.1234,N,07306.5678,E,1,08,0.9,545.4,M,46.9,M,,*47
// time lat N/S lon E/W fix sat hdop alt
The TinyGPS++ library parses all NMEA sentences automatically. Just feed it serial bytes and query the parsed fields:
TinyGPSPlus gps;
// In loop(), feed GPS bytes:
while (gpsSerial.available()) gps.encode(gpsSerial.read());
// Then query:
float lat = gps.location.lat(); // e.g. 18.8204
float lng = gps.location.lng(); // e.g. 73.1098
float speed = gps.speed.kmph(); // Speed in km/h
float alt = gps.altitude.meters(); // Altitude in metres
int sats = gps.satellites.value(); // Number of satellites
// Time (UTC):
int hour = gps.time.hour(); // Add 5.5 for IST
int min = gps.time.minute();
Remember to convert UTC to IST by adding 5 hours 30 minutes. Store the offset as 5 * 3600 + 30 * 60 = 19800 seconds and add it to the Unix timestamp.
Combining with a Cloud Platform for Real-Time Tracking
For a professional-grade tracking system, connect your GPRS data upload to one of these platforms:
- Traccar (self-hosted, free): Open-source GPS tracking platform. Install on any VPS. Supports 170+ device protocols. Use the OsmAnd protocol for easy HTTP-based position upload from SIM800L.
- ThingsBoard (free community edition): Full IoT platform with live map widget, alerts, and data export. Send GPS data as JSON via MQTT over GPRS.
- Google Maps Platform: Build a custom tracking page with Maps JavaScript API. Store positions in Firestore (free tier: 50,000 reads/day) and display live markers on a map embedded in a webpage.
- WhatsApp alerts: Use CallMeBot API (free WhatsApp message API for personal use) to send GPS links directly to your WhatsApp. Much more convenient than SMS for most users.
Frequently Asked Questions
Q: Why is my SIM800L not registering on the network?
The most common causes are: (1) insufficient power supply – the module resets during transmission; add a 1000-4700 uF capacitor and use a dedicated 4V supply; (2) SIM card not inserted properly – the spring contacts are fragile; (3) no 2G coverage – check if your area has GSM 900/1800 MHz coverage (Airtel/Vi work best for 2G in India); (4) SIM not activated for data/SMS – contact your operator.
Q: How long does the NEO-6M take to get a GPS fix indoors?
Typically it cannot get a reliable fix indoors. GPS signals are extremely weak (below -130 dBm) and concrete/metal roofs block them almost completely. Place the module near a window or use an external active antenna on the roof. Outdoors, cold start is 30-60 seconds, warm start (almanac from previous session) is 5-15 seconds, and hot start is under 2 seconds.
Q: Can I use SIM800L and SIM800C with Jio SIM?
Jio is a 4G/VoLTE-only network – they shut down their 2G network. The SIM800L and SIM800C only support 2G (GPRS/EDGE). Therefore, Jio SIMs will NOT work for data/calls on SIM800L. Use Airtel, Vi, or BSNL which still maintain 2G/GSM networks across India as of 2026.
Q: What is the difference between NEO-6M and NEO-M8N?
The NEO-M8N is a significantly newer and more capable GPS chip. It supports multiple GNSS systems simultaneously (GPS + GLONASS + BeiDou + Galileo vs GPS-only on NEO-6M), has 72 tracking channels (vs 16 for NEO-6M), achieves 2.5 m accuracy in optimal conditions, and includes an onboard compass (HMC5883L) on the module from Zbotic.in. The M8N achieves first fix in a fraction of the time and is much more reliable in urban canyons. Choose M8N for any serious project.
Q: Can the tracker work without internet (no GPRS plan)?
Yes – the SMS mode works without a data plan. Your tracker can send coordinates as SMS messages to your phone number. SMS is billed per message (or included in your plan) and works even in areas with only 2G voice coverage. SMS-based tracking is ideal as a fallback when GPRS is unavailable.
Build Your IoT Project
Shop ESP32, sensors, and wireless modules at Zbotic.in – fast shipping across India.
Add comment