Car GPS/GSM tracker based on Arduino with a Leaflet Map
CarTracker is a streamlined solution for real-time tracking of Arduino-based IoT devices. Equipped with a GSM module, the device captures GPS coordinates (latitude and longitude) and securely transmits them to a cloud server using robust encryption. The project is designed with scalability in mind, allowing for future expansion and new features.
├── api
│ ├── templates
│ │ └── index.html
│ ├── main.py
│ └── requirements.txt
├── Firmware
│ └── Firmware.ino
├── .gitignore
├── COMMIT_GUIDELINES.md
├── images/
├── LICENSE
├── installation-setup.md
└── README.md
- Python: Handles server-side logic and processes incoming data from IoT devices.
- Debian: An operating system used for hosting the entire infrastructure.
- NGINX: Web server and reverse proxy for secure request handling.
- Security: Integrated SSL/TLS encryption using Certbot (Let's Encrypt) to ensure secure HTTPS communication between the device, server, and client.
- Leaflet.js: An open-source library used for interactive map rendering with dynamic markers, auto-panning, and real-time coordinate updates.
- Web Stack: HTML5, CSS3, and JavaScript featuring a Live Status Panel with WebSocket connectivity and automatic reconnection logic.
- Arduino Uno Rev3: Main microcontroller board used to run the firmware and control the device.
- DFRobot NB-IoT/LTE/GNSS Shield (SIM7070G, DFR0572): Connectivity + positioning module used for LTE-M data transmission and GNSS/GPS location acquisition.
- C++: Used for writing firmware to handle modem communication and GPS/GNSS data processing.
Once configuration is complete on both sides, the position will update automatically and appear on the map. However, if you provide the API_KEY defined in your .env file, you can also update the marker manually via the API.
curl -X POST https://your-domain.com/upload_position -H "Content-Type: application/json" -H "x-api-key: $API_KEY" -d '{"longitude": 21.01, "latitude": 52.23}'
- Upload Position
Used to send current GPS coordinates
POST /upload_position
- Headers:
x-api-key:YOUR_SECRET_API_KEY(Required)Content-Type:application/json
- Requested Body:
{ "longitude": 21.0122, "latitude": 52.2297 } - Response:
200 OK: Data saved and broadcasted successfully.403 Forbidden: Access denied due to wrong or empty API key.
- Get service status
Simple diagnostic endpoint.
GET /healthcheck
- Response:
{"status": "OK", "service": "Position API"}
- Response:
More info regarding installation, setup and used function can be found here: installation-setup
- Krzysztof Tomicki - IoT, Hardware and Repository Maintainer - @lologog
- Konrad Wrzesień - Backend, Frontend and Documentation - @konsept619