Embedded Firmware Developer (ESP32 / M5Stack) — In-Car Real-Time Fuel Cost Tracker via OBD-II / CAN

Posted 4 weeks ago

Worldwide

Summary

PROJECT SUMMARY ===================================================================== I need a working prototype of a small in-car device that plugs into the OBD-II port and displays, in real time, how much money the current trip is costing (like a taxi meter), plus CO2 emitted and a "full cost per km" figure. The device keeps a history of trips (per trip, per day, per week, per month, and custom date ranges) and can export data as CSV to a microSD card. The hardware platform is fixed: M5Stack Core2 + CAN transceiver unit. Your job is the firmware, the wiring, the power-management design, basic enclosure/mounting, testing, and documentation. This is a prototype for a consumer product, so reliability (power loss, heat, no car-battery drain) matters more than fancy features. ===================================================================== 2. HARDWARE PLATFORM (FIXED — DO NOT SUBSTITUTE WITHOUT DISCUSSION) M5Stack Core2 v1.1 (ESP32, 2.0-inch 320x240 capacitive touchscreen, built-in RTC, Wi-Fi/BT, microSD slot, internal 390 mAh battery, AXP power-management IC) M5Stack Mini CAN Unit (CA-IS3050G transceiver), driven by the ESP32's built-in TWAI (CAN) controller OBD-II male connector cable with bare wire leads. Standard OBD-II pinout: pin 16 = +12 V (usually battery-permanent), pins 4/5 = ground, pin 6 = CAN-H, pin 14 = CAN-L Automotive DC-DC buck converter, wide input 9–36 V to 5 V, LOW quiescent current, plus TVS diode for load-dump / transient protection (the design must survive typical automotive electrical transients, in the spirit of ISO 7637-2) Optional but recommended: I2C FRAM unit for high-endurance frequent writes microSD card (8–16 GB) Simple enclosure or mounting solution (3D print or off-the-shelf is fine for this prototype) Parts cost is roughly EUR 120. Either you purchase the parts locally (reimbursed against receipts) or I ship them to you — state your preference in your proposal. ===================================================================== 3. FUNCTIONAL REQUIREMENTS 3.1 OBD-II DATA ACQUISITION OBD-II over CAN (ISO 15765-4), 500 kbit/s, 11-bit identifiers, with 29-bit fallback. On first connection to a vehicle: query the supported-PID bitmaps (PIDs 0x00, 0x20, 0x40, ...) and store a capability profile for that vehicle. Poll at 1 Hz minimum: vehicle speed (0x0D), engine RPM (0x0C), engine fuel rate (0x5E) when supported. Fallback when 0x5E is not supported: estimate fuel flow from MAF (0x10) using configurable air-fuel ratio and fuel density (petrol / diesel presets). Optional reads when available: fuel level (0x2F), control module voltage (0x42), odometer (0xA6) as a cross-check for distance. Distance is computed by integrating vehicle speed. The firmware must handle missing/unsupported PIDs gracefully (no crashes, clear on-screen message if the vehicle is not compatible). 3.2 TRIP LOGIC (FULLY AUTOMATIC — NO PHYSICAL BUTTONS) Trip auto-starts when the engine is detected (RPM above ~300, or CAN traffic plus speed above 0). Trip auto-ends when the engine stops (RPM = 0 or CAN bus silent for 60 seconds). The last trip summary stays displayed at next power-up until a new trip starts. Touchscreen is used only for switching screens and settings. 3.3 REAL-TIME DISPLAY (SWITCHABLE SCREENS, LARGE READABLE DIGITS) Screen 1 — MONEY: running trip cost in EUR counting up in real time (taxi-meter style), distance, average cost per km. Screen 2 — CO2: running kg of CO2 for the trip, and g/km. CO2 = liters x emission factor (defaults: 2.31 kg/L petrol, 2.68 kg/L diesel, both editable). Screen 3 — FULL COST: "true cost" of the trip = km x full-cost rate (default 0.55 EUR/km, user-editable), displayed alongside the fuel-only cost. Screen 4 — HISTORY: totals for today, this week, this month, and a custom date range (simple touch date picker). Screen 5 — SETTINGS: fuel price per liter, fuel type (petrol/diesel), currency symbol (EUR or USD), full-cost rate, emission factor, vehicle profile reset. 3.4 REFUEL CALIBRATION (IMPORTANT FEATURE) An "I refueled" flow where the user enters liters and total price paid. The device compares its measured consumption since the last fill-up with the entered liters and applies a bounded calibration factor (for example limited to 0.7–1.3) to improve accuracy over time. Fill-up events are stored in the log (date, liters, total price, computed price per liter) and the price per liter setting is updated. 3.5 HISTORY AND STATISTICS Append-only trip log with RTC timestamps. Each record: start time, end time, km, liters, cost, CO2, calibration state. Aggregations (day / week / month / custom range) are computed on demand from the log — they are not stored separately. Retention target: at least 5 years of typical use (this is only tens of KB per year, so storage size is not an issue; robustness is). 3.6 POWER MANAGEMENT (CRITICAL — READ CAREFULLY) OBD pin 16 is usually powered permanently, even with the ignition off. The device MUST NOT drain the car battery. On engine-off detection: close the trip, flush all data, enter deep sleep. Deep-sleep current target: 2 mA or less measured on the 12 V side, including the buck converter's quiescent current. The measured value must be documented. Wake-up on CAN bus activity (transceiver RX edge to a GPIO interrupt), and/or a periodic RTC wake (every 30–60 s, sub-second awake time) to sniff the bus. Low-voltage protection: if the car battery drops below ~11.8 V, stop all activity and sleep at minimum current. The internal 390 mAh battery is used ONLY as a write buffer: on a sudden 12 V loss (device unplugged), the PMU interrupt triggers a clean flush-and-shutdown. Configure a low charge current; the device lives in a hot car cabin, so battery stress must be minimized (do not charge when hot if the PMU allows this configuration). 3.7 DATA INTEGRITY AND STORAGE Live counters accumulate in RAM and are flushed every 30 seconds AND on every power event. Maximum acceptable data loss: the last 30 seconds of driving. No per-second writes to flash (wear). Use RAM plus periodic flush, or the FRAM unit for frequent counters. Robustness test (part of acceptance): 50 consecutive abrupt power cuts during simulated driving with zero log corruption. 3.8 EXPORT AND FUTURE-PROOFING CSV export to microSD from the settings screen: trips.csv and fills.csv, with a documented column format. Clean architecture: the data/storage layer must be strictly separated from the UI layer, so that a future sync module (BLE / Wi-Fi / cloud) can be added without refactoring. This separation is a hard requirement and will be checked in code review. Wi-Fi and Bluetooth stay OFF by default in this version (power and scope). Optional nice-to-have: manual NTP time sync from settings. ===================================================================== 4. NON-FUNCTIONAL REQUIREMENTS Thermal: a car cabin can exceed 60 C. Minimize self-heating, dim or sleep the display when idle, and include mounting recommendations in the docs (mount low near the OBD port, out of direct sunlight). UI language: English, with all strings grouped in a single localization file (French will be added later). Units: km, liters, EUR (switchable to USD symbol). Code: Arduino framework or ESP-IDF (your choice — justify it), Git repository, English comments, README with build and flash instructions, and a wiring/pinout diagram. ===================================================================== 5. OUT OF SCOPE FOR THIS VERSION Mobile app, cloud backend, GPS, custom PCB, injection-molded enclosure. Full EV / plug-in hybrid support (a clean "vehicle not supported" message is acceptable). Vehicles without CAN-based OBD (roughly pre-2008): out of scope. ===================================================================== 6. MILESTONES AND ACCEPTANCE CRITERIA MILESTONE 1 — OBD LINK AND LIVE DATA (30% of budget) Reads supported-PID bitmaps, speed, RPM, and fuel rate (or MAF fallback) on an ECU simulator or a real vehicle. Live screen shows speed, distance, instantaneous consumption, and a running EUR cost. Deliverable: short demo video plus source snapshot. MILESTONE 2 — TRIP ENGINE AND POWER MANAGEMENT (40% of budget) Automatic trip start/stop; trip log with RTC timestamps; history screens (day / week / month / custom range). Deep sleep at 2 mA or less, documented with an actual current measurement. Passes the 50-abrupt-power-cut test with zero data corruption. Low-voltage cutoff working. MILESTONE 3 — PRODUCT POLISH AND HANDOVER (30% of budget) Three indicator screens, refuel calibration flow, settings, CSV export, enclosure/mount. Full documentation, source code handover, assembled prototype shipped to France (shipping billed at actual cost). OVERALL ACCEPTANCE A continuous 30-minute drive (real vehicle or simulator scenario) where the logged fuel figure matches the reference within plus or minus 10% after one calibration fill-up. ===================================================================== 7. DELIVERABLES Assembled, working prototype shipped to France. Complete source code in a Git repository (full IP transfer). Wiring/pinout diagram and parts list with links. README: build, flash, and configuration instructions. Short user guide (1–2 pages). Test report: PIDs tested, vehicle or simulator used, sleep-current measurement, power-cut test results. ===================================================================== 8. BUDGET AND TIMELINE Fixed price: EUR 900–1,400 depending on experience, paid per milestone (30 / 40 / 30). Parts (~EUR 120) reimbursed against receipts, or shipped to you — your choice. Timeline: 4 to 6 weeks total. ===================================================================== 9. REQUIRED PROFILE AND HOW TO APPLY Required: Proven ESP32 firmware experience (Arduino or ESP-IDF). Hands-on CAN bus / OBD-II experience (show links, repos, or photos of past work). Access to an OBD-II ECU simulator OR a CAN-OBD test vehicle. This is mandatory — state clearly which one you have. Low-power / battery-aware design experience is a strong plus. In your proposal, please: Start with the word CANBUS (proposals without it will be ignored — this filters bots). Link 2 relevant past projects. State whether you have an ECU simulator or a test vehicle. Confirm the milestone plan and your total price. Say whether you prefer to buy the parts (reimbursed) or receive them. ===================================================================== 10. INTELLECTUAL PROPERTY AND CONFIDENTIALITY Work for hire: all code, designs, and documentation are transferred to the client in full upon final payment. No public portfolio use of this project without prior written approval. An NDA can be signed on request before detailed discussions.

  • $400.00

    Fixed-price
  • Intermediate
    Experience Level
  • Remote Job
  • One-time project
    Project Type
Skills and Expertise
Mandatory skills
Arduino
PCB Design
Microcontroller Programming
Activity on this job
  • Proposals:5 to 10
  • Last viewed by client:4 weeks ago
  • Interviewing:
    2
  • Invites sent:
    0
  • Unanswered invites:
    0
About the client
Member since May 26, 2025
  • Poland
    Wroclaw6:48 AM
  • $707 total spent
    3 hires, 0 active

Explore similar jobs on Upwork

Electronics
PCB Design
Schematic
ESP32
KiCad
PCB Design
Circuit Design
Electronics

How it works

  • Post a job icon
    Create your free profile
    Highlight your skills and experience, show your portfolio, and set your ideal pay rate.
  • Talent comes to you icon
    Work the way you want
    Apply for jobs, create easy-to-by projects, or access exclusive opportunities that come to you.
  • Payment simplified icon
    Get paid securely
    From contract to payment, we help you work safely and get paid securely.
Want to get started? Create a profile

About Upwork

  • Rating is 4.9 out of 5.
    4.9/5
    (Average rating of clients by professionals)
  • G2 2021
    #1 freelance platform
  • 49,000+
    Signed contract every week
  • $2.3B
    Freelancers earned on Upwork in 2020

Find the best freelance jobs

Growing your career is as easy as creating a free profile and finding work like this that fits your skills.

Trusted by

  • Microsoft Logo
  • Airbnb Logo
  • Bissell Logo
  • GoDaddy Logo