Skip to content

About

An end-to-end IoT solution using Arduino and Laravel to prevent vehicle theft. It features high-precision Polygon Geofencing for Palembang city limits, an automated engine kill-switch, and real-time Telegram alerts to ensure secure, automated rental operations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🏍️ IoT-Based Remote Monitoring & Control System for Motorcycle Rentals

Platform Framework Hardware

🧠 Why I Built This

Motorcycle rental businesses often operate on trust β€” but in reality, they have no way to verify what happens after a vehicle leaves.

During my research, I found real cases where rental owners lost multiple motorcycles due to fraud, late returns, and lack of monitoring systems. Most operations still rely on manual tracking and human memory, which creates serious security and operational risks.

This led me to a key question:

What if a rental system could not only monitor vehicles β€” but actively protect them in real time?


🎯 Project Context

  • Type: Independent Final Thesis
  • Field: Computer Engineering / Internet of Things
  • Role: IoT System Developer
  • Institution: State Polytechnic of Sriwijaya
  • Validation: Field-tested with Rental Motor Palembang and published in JATI Journal

πŸ‘¨β€πŸ’» My Contribution

As the individual developer of this project, I was responsible for designing and implementing the end-to-end IoT system, including the Laravel dashboard, GPS data processing, polygon geofencing logic, Arduino-based hardware integration, relay control, buzzer warning system, and Telegram notification flow.

I also conducted field testing with a motorcycle rental business to validate GPS accuracy, hardware reliability, and real-world usability.


βš™οΈ My Approach (How I Think)

Instead of building a basic tracking system, I focused on three key principles:

1. Precision Over Simplicity

Most systems use circular geofencing (radius-based), which is inaccurate for real-world city boundaries.

➑️ I implemented polygon geofencing using the Ray Casting Algorithm, allowing the system to follow actual administrative borders.


2. Automation Over Monitoring

Most solutions only provide information.

➑️ I designed a system that acts automatically:

  • Cuts off engine when rules are violated
  • Sends alerts without human intervention

3. Real-World Validation

Instead of stopping at simulation:

➑️ I tested the system with an actual rental business to ensure:

  • Hardware durability
  • Network reliability
  • Practical usability

πŸ“Œ Project Overview

An end-to-end IoT system designed to solve real-world security and operational challenges in motorcycle rentals by combining real-time tracking, polygon geofencing, automated alerts, and remote vehicle control.


πŸš€ Key Features

  • πŸ“ Live Tracking: Real-time geospatial monitoring using Ublox NEO-6M.
  • πŸ›‘οΈ Polygon Geofencing: Advanced boundary detection using the Ray Casting Algorithm for precise administrative-level accuracy.
  • πŸ”Œ Remote Kill-Switch: Automated engine immobilization via Relay modules when the vehicle exits the Palembang geofence or rental time expires.
  • πŸ”Š Smart Alarm System: Built-in buzzer/speaker that automatically triggers when the vehicle exits the Palembang area or when the rental time is about to expire, providing immediate on-vehicle warning.
  • πŸ€– Telegram Bot Integration: Instant push notifications for rental expiration and geofence exit alerts.
  • πŸ“Š Admin Control Center: A centralized Laravel-based dashboard for managing rental operations, including rental time configuration, customer management, and motorcycle fleet registration.

🧠 Design Reasoning

The Problem: Structural Vulnerabilities

Building on this problem, I explored deeper structural issues in rental operations:

  • Real Threat: Recent cases (Jan 2025) showed 20 units stolen by one fraudster, causing ~Rp400M in losses (Humas Polres Bantul, 2025).
  • Operational Gap: Manual logging results in zero real-time visibility, leading to delayed returns and untraceable theft.

The Research: Beyond Basic Tracking

Standard circular geofencing is imprecise for urban use. My research focuses on strict, administrative-based boundaries to provide the high-level security that rental businesses actually require.

The Solution: Why Polygon & Remote Control?

  1. Precision Logic: Used Polygon Geofencing (Ray Casting Algorithm) to follow the exact administrative borders of Palembang Cityβ€”far more accurate than standard radii.
  2. Proactive Intervention: Integrated a Remote Kill-Switch (Relay). The system doesn't just monitor; it automatically immobilizes the engine if a boundary breach or time expiration occurs.
  3. Automated Ecosystem: Integrated Laravel, APIs, and Telegram to replace manual workflows with a seamless, real-time alert and control system.

Real-World Impact

  • Accuracy: Proven GPS deviation of only 16.15 meters.
  • Efficiency: Reduced the need for continuous manual monitoring by automating geofence alerts, rental-time warnings, and engine immobilization triggers.

🀝 Collaboration & Partnership

This system was field-tested in collaboration with Rental Motor Palembang founded by Ihsan Fikri, a local motorcycle rental business.

  • Field Test Goal: To ensure hardware durability and GPRS connectivity reliability in high-mobility urban scenarios.
  • Result: Successful integration and real-time intervention capabilities during active rental periods.

πŸ“š Scientific Publication

The methodology and technical implementation of this project have been peer-reviewed and published:

  • Title: "Rancang Bangun Sistem Monitoring dan Kontrol Jarak Jauh pada Rental Motor Berbasis IoT dengan Geofencing"
  • Journal: JATI : Jurnal Mahasiswa Teknik Informatika
  • Status: Published (2025)
  • Publication Link: JATI Journal Article

πŸ› οΈ Tech Stack

Category Tools & Technologies
Hardware Arduino Mega 2560, SIM7000G (LTE/GSM), Ublox NEO-6M, Relay, Buzzer
Backend Laravel (PHP), MySQL
Geospatial QGIS, Geopandas (Python), Ray Casting Algorithm
Frontend Bootstrap 5, JavaScript, Leaflet.js (Maps)

βš™οΈ Installation & System Setup

1. Clone Repository

git clone https://github.com/achmaddoli/Motorcycle-Rental-Monitoring-System.git
cd Motorcycle-Rental-Monitoring-System

πŸ’» Backend Setup (Laravel)

2. Install Dependencies

composer install
npm install

3. Setup Environment

cp .env.example .env
php artisan key:generate

4. Configure Database

Create a new MySQL database, for example:

db_rental_motor

Update your .env file:

DB_DATABASE=db_rental_motor
DB_USERNAME=root
DB_PASSWORD=

5. Import Database / Run Migration

If you provide an SQL file:

Import the provided .sql file into MySQL

Or if using migrations:

php artisan migrate

6. Run Laravel Server

php artisan serve
npm run dev

πŸ”Œ Hardware Setup (Arduino Mega)

7. Required Hardware

  • Arduino Mega 2560
  • SIM7000G
  • Ublox NEO-6M
  • Relay module
  • Buzzer
  • Li-Po Battery
  • UBEC

8. Upload Firmware to Arduino

Open the Arduino IDE, then upload the firmware source code which is Microcontroller Program.ino.

Make sure the required Arduino libraries are installed:

  • TinyGPSPlus
  • TinyGSM
  • ArduinoHttpClient

9. Configure Firmware

Before uploading, adjust the following inside the Arduino code:

  • GSM/APN provider configuration
  • Laravel API endpoint URL
  • Vehicle ID or device ID
  • Relay and buzzer pin definitions

Example:

const char server[] = "your-domain.com";
const char resource[] = "/api/location/update";
String vehicle_id = "MTR001";

πŸ€– Telegram Bot Setup

10. Configure Telegram Bot

Create a bot using @BotFather, then add the token into your Laravel .env file:

TELEGRAM_BOT_TOKEN=your_bot_token_here

Also make sure each customer/user record includes a valid Telegram chat ID.


πŸ”„ Full System Workflow

11. Flowchart System

12. How to Run the Full System

  1. Turn on the Laravel server and database

  2. Power the Arduino Mega device

  3. Arduino reads GPS coordinates from Ublox NEO-6M

  4. SIM7000G sends location data to Laravel API

  5. Laravel checks:

    • geofence status (inside/outside Palembang)
    • rental time status
  6. Laravel sends response back to Arduino

  7. Arduino triggers:

    • relay for engine cut-off
    • buzzer for warning
  8. Laravel sends Telegram notifications when needed


πŸ“Œ Notes

  • This project is an integrated IoT + Web system, so both the Laravel backend and Arduino hardware must be configured correctly.
  • The website alone does not represent the full system.

πŸ“Ί Visuals & Simulation

πŸ’» Website Dashboard Interface

The management system features 6 core modules: Authentication, Real-time Dashboard, Live Monitoring, Rental Logs, User Management, and Vehicle Fleet Data.

πŸ” Login Page πŸ“Š Main Dashboard πŸ“‘ Live Monitoring
🏍️ Vehicle Fleet πŸ‘₯ User Management πŸ”‘ Rental Records

πŸ€– Telegram Notification System

Security & Duration Alerts
Telegram Notification
Automated alerts for geofence breaches & rental duration warnings

πŸŽ₯ Video Demonstrations

Click the thumbnails below to watch the system in action.

1. Real Simulation (Outside Palembang City)

Real Simulation Video

Simulation Focus: Demonstrates real-world hardware response: buzzer activation and automatic engine cut-off when the vehicle exits the Palembang geofence.

2. Full Website System Demo

Full Website System Demo

System Focus: Showcases the complete workflow across 6 modules: Login, Dashboard, Monitoring, Rental, User, and Vehicle Management.


πŸ“ˆ Learning Journey

⚠️ Challenges & How I Overcame Them

1. GPS Data Drift & Precision

  • Challenge: During early testing, the Ublox NEO-6M module experienced GPS data drifting, where coordinates jumped significantly even when the vehicle was stationary, leading to false geofence triggers.
  • Solution: I implemented a moving average filter and data-validation logic in the firmware. By filtering out outlier coordinates that exceeded logical speed thresholds, I improved GPS reliability and achieved a field-validated average deviation of 16.15 meters.

What I Learned

Building this "End-to-End" system sharpened my skills in systems thinking. I learned to bridge the gap between physical hardware and cloud-based software, while managing the complexities of real-time geospatial data processing. Beyond technical skills, I learned how to communicate technical limitations to non-technical stakeholders (the rental owners) and adapt the system based on their real-world feedback.


About

An end-to-end IoT solution using Arduino and Laravel to prevent vehicle theft. It features high-precision Polygon Geofencing for Palembang city limits, an automated engine kill-switch, and real-time Telegram alerts to ensure secure, automated rental operations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages