← Back to IoT Blog
Connected Vehicles 26 min read

Fleet Fuel Management System

Monitor fuel levels, detect theft, track consumption patterns, and optimize routes for fleet vehicles with IoT sensors.

System Overview

Fuel is typically 30-40% of fleet operating costs. This system helps reduce costs through monitoring and optimization.

Benefits:
  • 10-20% fuel cost reduction
  • Fuel theft detection & prevention
  • Driver behavior monitoring
  • Route optimization insights
  • Maintenance scheduling

Fuel Sensors

TypeAccuracyCostInstallation
Ultrasonic±1%$$External mount
Capacitive±0.5%$$$Drill required
Float±3%$Tank access needed
OBD-II±5%$Plug & play

Hardware Setup

ESP32 Firmware

#include <TinyGPS++.h>

float readFuelLevel() {
  // Send ultrasonic pulse
  digitalWrite(TRIG, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG, LOW);
  
  long duration = pulseIn(ECHO, HIGH);
  float distance = duration * 0.034 / 2;
  
  // Convert to fuel percentage
  float fuelPercent = map(distance, 5, 50, 100, 0);
  return constrain(fuelPercent, 0, 100);
}

void detectTheft() {
  static float lastFuel = 100;
  float currentFuel = readFuelLevel();
  
  // Sudden drop = potential theft
  if (lastFuel - currentFuel > 10 && !engineRunning) {
    sendAlert("FUEL_THEFT", currentFuel);
  }
  lastFuel = currentFuel;
}

Theft Detection

Common theft patterns the system detects:

Analytics Dashboard

// Fuel consumption query (InfluxDB)
SELECT mean("fuel_level") FROM "fleet_fuel"
WHERE time > now() - 7d
GROUP BY time(1h), "vehicle_id"

// Calculate MPG
SELECT (distance / fuel_consumed) as mpg
FROM "trip_data"
GROUP BY "vehicle_id"
Installation Considerations:
  • Ensure sensor compatibility with fuel type
  • Follow hazardous location regulations
  • Calibrate sensors for tank shape
  • Test before fleet-wide deployment

Next Steps

  • Add driver ID integration
  • Implement fuel card integration
  • Add predictive maintenance
  • Connect to dispatch system