In todayβs smart transportation ecosystem, real-time vehicle tracking plays a critical role in fleet monitoring, logistics management, delivery systems, and vehicle security.
Most IoT tracking projects rely on WiFi connectivity. However, vehicles operate in dynamic environments where WiFi is not always available. To overcome this limitation, this project demonstrates a SIM-based Real-Time GPS Tracking System using ESP32, SIM7600 4G LTE module, MQTT protocol, and a live web dashboard.
This system uses cellular connectivity instead of WiFi, making it suitable for real-world vehicle deployment.
The device reads GPS data, transmits it over 4G LTE using MQTT, and displays live vehicle movement on a real-time web dashboard.
π― Project ObjectiveBuild a WiFi-independent GPS tracking solution
- Build a WiFi-independent GPS tracking solution
Demonstrate cellular IoT communication
- Demonstrate cellular IoT communication
Implement MQTT publish/subscribe architecture
- Implement MQTT publish/subscribe architecture
Design scalable multi-device tracking
- Design scalable multi-device tracking
Create deployable real-world IoT system
- Create deployable real-world IoT system
GPS Module β ESP32 β SIM7600 4G LTE β MQTT Broker β Live Dashboard
GPS Module β ESP32 β SIM7600 4G LTE β MQTT Broker β Live Dashboard
Working FlowGPS module reads latitude and longitude.
- GPS module reads latitude and longitude.
ESP32 processes NMEA data.
- ESP32 processes NMEA data.
SIM7600 connects to internet via 4G SIM.
- SIM7600 connects to internet via 4G SIM.
Location data is published to MQTT broker.
- Location data is published to MQTT broker.
Web dashboard subscribes to topic.
- Web dashboard subscribes to topic.
Vehicle position updates instantly on map.
- Vehicle position updates instantly on map.
This architecture ensures low-latency and efficient communication.
π§ 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
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 OLED Display
- SH1106 OLED Display
Active 4G SIM Card
- Active 4G SIM Card
LTE Antenna
- LTE Antenna
GPS Antenna
- GPS Antenna
Stable 5V 2A Power Supply
- Stable 5V 2A Power Supply
β Important: SIM7600 requires stable external power.
π Hardware ConnectionsLTE Module β ESP32TX β GPIO 16RX β GPIO 17
GPS Module β ESP32TX β GPIO 27RX β GPIO 14
OLED Display β ESP32SDA β GPIO 33SCL β GPIO 32
Place GPS antenna in open sky for faster satellite lock.
π» 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 format 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
Publishes JSON payload every 5 seconds
- Publishes JSON payload every 5 seconds
Updates OLED display
- Updates OLED display
Handles auto-reconnect
- Handles auto-reconnect
Example JSON Payload:
{ "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 DashboardThe dashboard:
Connects via MQTT WebSocket
- Connects via MQTT WebSocket
Displays real-time vehicle marker
- Displays real-time vehicle marker
Draws movement path
- Draws movement path
Shows speed and direction
- Shows speed and direction
Fully mobile responsive
- Fully mobile responsive
Map Engine: Leaflet.js + OpenStreetMap
π Step-by-Step ImplementationConnect all hardware components
- Connect all hardware components
Insert active SIM card
- Insert active SIM card
Upload firmware to ESP32
- Upload firmware to ESP32
Verify MQTT connection
- Verify MQTT connection
Deploy dashboard file
- Deploy dashboard file
Open dashboard URL to track live movement
- Open dashboard URL to track live movement
Fleet Management
- Fleet Management
School Bus Tracking
- School Bus Tracking
Delivery Vehicle Monitoring
- Delivery Vehicle Monitoring
Anti-Theft Systems
- Anti-Theft Systems
Industrial Asset Tracking
- Industrial Asset Tracking
Logistics & Transport Monitoring
- Logistics & Transport Monitoring
Secure MQTT (TLS/SSL)
- Secure MQTT (TLS/SSL)
AWS IoT Integration
- AWS IoT Integration
Cloud Data Logging
- Cloud Data Logging
Geofencing Alerts
- Geofencing Alerts
Multi-Vehicle Admin Panel
- Multi-Vehicle Admin Panel
Engine Cut-Off Control
- Engine Cut-Off Control
Complete firmware and dashboard files available on GitHub.
π¨βπ» Developed ByTech Gyan Setπ Contact: +91 9336183481
π ConclusionThis project demonstrates a complete SIM-based real-time GPS vehicle tracking system using ESP32 and MQTT. Unlike basic WiFi projects, this system is designed for real-world deployment with cellular connectivity, making it scalable, reliable, and industry-ready.













Comments