In modern transportation systems, real-time vehicle tracking has become essential for fleet monitoring, logistics management, school bus tracking, and asset security.
Most beginner IoT projects rely on WiFi connectivity. However, real-world vehicles do not always operate within WiFi range. To solve this limitation, I built a SIM-based Real-Time GPS Vehicle Tracking System using ESP32, SIM7600 4G LTE module, MQTT protocol, and a Live Web Dashboard.
This project demonstrates a scalable and industry-ready IoT architecture that works completely over cellular internet, making it deployable in real moving vehicles.
The system reads live GPS coordinates, sends them over 4G LTE using MQTT, and displays the location instantly on a web-based dashboard.
π― Why I Built This ProjectTo create a WiFi-independent tracking solution
- To create a WiFi-independent tracking solution
To demonstrate real-world cellular IoT architecture
- To demonstrate real-world cellular IoT architecture
To implement MQTT publish/subscribe model
- To implement MQTT publish/subscribe model
To design a scalable multi-device tracking system
- To design a scalable multi-device tracking system
To build a complete end-to-end IoT deployment
- To build a complete end-to-end IoT deployment
GPS Module β ESP32 β SIM7600 4G LTE β MQTT Broker β Web Dashboard
GPS Module β ESP32 β SIM7600 4G LTE β MQTT Broker β Web Dashboard
Data Flow:GPS module reads satellite data.
- GPS module reads satellite data.
ESP32 parses NMEA data.
- ESP32 parses NMEA data.
SIM7600 connects to internet via SIM card.
- SIM7600 connects to internet via SIM card.
Data is published to MQTT broker.
- Data is published to MQTT broker.
Web dashboard subscribes to topic.
- Web dashboard subscribes to topic.
Live vehicle movement appears on map.
- Live vehicle movement appears on map.
This publish/subscribe model ensures real-time communication with low bandwidth usage.
π§ Core Technologies UsedESP32 Microcontroller
- ESP32 Microcontroller
SIM7600 4G LTE Cellular Module
- SIM7600 4G LTE Cellular Module
NEO-6M GPS Module
- NEO-6M GPS Module
MQTT Protocol
- MQTT Protocol
TinyGSM Library
- TinyGSM Library
PubSubClient Library
- PubSubClient Library
TinyGPSPlus
- TinyGPSPlus
U8g2 OLED Library
- U8g2 OLED Library
Leaflet.js
- Leaflet.js
OpenStreetMap
- OpenStreetMap
ESP32 Development Board
- ESP32 Development Board
SIM7600 4G LTE Module
- SIM7600 4G LTE Module
NEO-6M GPS Module
- NEO-6M GPS Module
SH1106 128x64 OLED Display
- SH1106 128x64 OLED Display
4G SIM Card
- 4G SIM Card
LTE Antenna
- LTE Antenna
GPS Antenna
- GPS Antenna
Stable 5V 2A Power Supply
- Stable 5V 2A Power Supply
β Important:SIM7600 must be powered using an external stable 5V supply.
π Hardware ConnectionsLTE Module β ESP32TX β GPIO 16
- TX β GPIO 16
RX β GPIO 17
- RX β GPIO 17
TX β GPIO 27
- TX β GPIO 27
RX β GPIO 14
- RX β GPIO 14
SDA β GPIO 33
- SDA β GPIO 33
SCL β GPIO 32
- SCL β GPIO 32
For better GPS signal, place antenna in open sky.
π» Software SetupRequired LibrariesTinyGSM
- TinyGSM
PubSubClient
- PubSubClient
TinyGPSPlus
- TinyGPSPlus
U8g2
- U8g2
Wire
- Wire
APN: airtelgprs.com
- APN: airtelgprs.com
MQTT Broker: broker.emqx.io
- MQTT Broker: broker.emqx.io
Port: 1883
- Port: 1883
Topic: device/SL001/gps
- Topic: device/SL001/gps
Topic structure supports scalability:
device/{DEVICE_ID}/gps
device/{DEVICE_ID}/gps
π Firmware Working PrincipleThe firmware:
Initializes LTE modem
- Initializes LTE modem
Connects to cellular network
- Connects to cellular network
Establishes MQTT connection
- Establishes MQTT connection
Reads GPS data continuously
- Reads GPS data continuously
Creates JSON payload
- Creates JSON payload
Publishes data every 5 seconds
- Publishes data every 5 seconds
Updates OLED display
- Updates OLED display
Handles automatic reconnection
- Handles automatic reconnection
JSON Example:
{ "lat":26.8565, "lng":80.9462, "speed":32.5, "sat":9, "altitude":125.0, "direction":180.0}
{
"lat":26.8565,
"lng":80.9462,
"speed":32.5,
"sat":9,
"altitude":125.0,
"direction":180.0
}
π₯οΈ Live Web DashboardThe dashboard:
Connects via MQTT WebSocket
- Connects via MQTT WebSocket
Subscribes to GPS topic
- Subscribes to GPS topic
Displays live marker on map
- Displays live marker on map
Draws vehicle path trail
- Draws vehicle path trail
Shows speed and direction
- Shows speed and direction
Fully mobile responsive
- Fully mobile responsive
Map engine used: Leaflet.js with OpenStreetMap tiles.
π Step-by-Step Build ProcessConnect all hardware modules
- Connect all hardware modules
Insert active SIM card
- Insert active SIM card
Upload firmware to ESP32
- Upload firmware to ESP32
Verify MQTT connection via Serial Monitor
- Verify MQTT connection via Serial Monitor
Upload dashboard to hosting server
- Upload dashboard to hosting server
Open dashboard URL and track live vehicle
- Open dashboard URL and track live vehicle
Fleet Management
- Fleet Management
School Bus Tracking
- School Bus Tracking
Delivery Vehicle Monitoring
- Delivery Vehicle Monitoring
Vehicle Anti-Theft System
- Vehicle Anti-Theft System
Industrial Asset Tracking
- Industrial Asset Tracking
Cold Chain Logistics
- Cold Chain Logistics
Secure MQTT (SSL/TLS)
- Secure MQTT (SSL/TLS)
AWS IoT Core Integration
- AWS IoT Core Integration
Firebase Data Logging
- Firebase Data Logging
Geofencing Alerts
- Geofencing Alerts
Multi-Vehicle Admin Panel
- Multi-Vehicle Admin Panel
Ignition Detection & Engine Cutoff
- Ignition Detection & Engine Cutoff
Complete firmware and dashboard files are available on GitHub:
https://github.com/YaranaIotGuru
πΊ Full Video TutorialDetailed explanation available on YouTube:
π₯ Yarana IoT Guru
π¨βπ» Developed ByMr. Abhishek MauryaFounder β Yarana IoT GuruOfficial Contact: +91-7052722734Website: https://yaranaiotguru.in
π ConclusionThis project demonstrates a complete SIM-based real-time vehicle tracking architecture using MQTT and ESP32. It is scalable, deployable, and suitable for real-world industrial IoT applications.
Unlike basic WiFi IoT projects, this system represents a practical cellular IoT solution ready for field deployment.











Comments