Inspiration

For students, one bad day with a car gets expensive fast. After a crash it's one driver's word against another's; after a break-in there's usually no proof at all. Claims drag on, and insurers pay for the disputes, the fraud and the cars that never come back. We wanted to make auto insurance simpler for students by giving every claim evidence instead of arguments, and by stopping theft before it becomes a claim.

What it does

CarGuard is a small device that plugs into a car's own data network (the CAN bus):

  • 🎥 Crash recorder: when it detects an impact, it saves 12 seconds before and 3 seconds after, 50 times per second (speed, brake, steering, acceleration, gear, key and door states). The owner's phone downloads it over Bluetooth and shows a 3D replay plus a plain-English report built only from the recorded facts. It says "not recorded" instead of guessing. An optional Google Gemini summary is written from the same facts.
  • 🔒 Theft protection: a kill-switch relay on the starter circuit.
    • Only the owner's key starts the car; an unknown key or no key never does.
    • A door forced while locked, a tow attempt or a hotwire attempt blocks the ignition until the owner verifies from their phone.
    • It never cuts a moving car. Every blocked attempt is saved as an incident with its own replay.
  • 📊 Daily safety report: how securely the car was parked and how smoothly it was driven (hard braking, sharp turns, top speed), to help young drivers build better habits.

Why it matters for State Farm: claims start with a replay and a factual report (faster, fairer, less fraud), thefts are stopped before they become payouts, and the riskiest drivers get daily feedback to get safer.

How we built it

  • Hardware: an ESP32-S3 (CarGuard) and an ESP32 ("the car") connected by SN65HVD230 CAN transceivers at 500 kbps, plus a relay with green/red LEDs as the kill switch.
  • Car simulator: a browser game drives the car and sends BMW F-series-style CAN frames over Web Serial, so we could safely stage crashes, break-ins, towing and hotwiring over a real CAN bus.
  • Firmware (Arduino C++):
    • rule engine for the security logic
    • non-blocking 50 Hz recorder with per-signal validity/freshness
    • CRC-checked incident format saved to flash (LittleFS) so incidents survive reboots
    • chunked Bluetooth LE transfer with per-chunk checksums
  • Phone app: a web app using Web Bluetooth (Bluefy on iPhone), with daily reports, an incident list, a three.js 3D replay reconstructed from speed and yaw/steering, video export, and Gemini summaries. The API key stays on the phone.
  • Tests: 40 automated tests, including compiling the firmware's own record builder on a PC and running the app's download code against a mock device with corrupted chunks.

Challenges we ran into

  • Getting two ESP32s to talk reliably over CAN (pin mapping, transceiver wiring, and a relay module that needed real 5 V).
  • iOS Safari has no Web Bluetooth, so we moved to the Bluefy browser, and iPhone's Bluetooth cache hid our new services until we toggled Bluetooth.
  • Making the replay honest: fixing a left/right mirror bug, handling irregular timestamps and reverse gear, and clearly labelling what's measured, estimated or illustrative.
  • Designing security rules that are strict on thieves but never unsafe for the driver (no cutting a moving car).

Accomplishments that we're proud of

  • A full working loop on real hardware: simulated car → real CAN bus → CarGuard → kill-switch relay → phone alert → 3D replay → shareable report.
  • Reports that never overstate: every value is marked measured, estimated or unavailable.

What we learned

CAN bus decoding with real BMW message IDs, embedded real-time recording, BLE protocol design, 3D vehicle-motion reconstruction, and how insurance claims actually work.

What's next for CarGuard

  • Testing on a real car (Zaid's 2016 BMW F30) with its real messages.
  • Backup power so a crash recording always survives.
  • A secure, owner-approved "send to insurer" flow and first-notice-of-loss integration.
  • A plug-in OBD-II version any student can install in minutes.

Honest note: this is a hackathon prototype tested with our simulator over a real CAN bus between two boards, not yet in a real car. Several CAN payloads are simplified or simulated; see the repo docs.

Code: https://github.com/zaidshabaneh/carguard Try the app (sample incidents, no hardware needed): https://zaidshabaneh.github.io/carguard/phone-app/

Built With

Share this project:

Updates

Submission history