George KhayatSoftware Engineer
← The ArchiveGK-001 — archive file

GK-001 · IoT · Hardware · Full-stack

CrashLens

Smart accident detection ecosystem

A Raspberry Pi 5 in-car device and app ecosystem that detects crashes, records evidence — video, sensor data and GPS — and dispatches automated alerts to drivers, first responders and insurance providers.

Year
2025
Status
Active
Context
Senior capstone · developed under the TwoFoundersLab GitHub organization
Stack
Raspberry Pi 5 · Python · Cloudflare Workers · Hono.js · Supabase · Cloudflare R2 · React · Swift · Kotlin
Links
01

Problem

After a car crash, critical evidence — skid marks, sensor readings, exact impact force and location — disappears within minutes. No affordable in-car system existed to automatically capture, encrypt and deliver that evidence to the right parties.

02

Why it exists

Evidence at a crash scene has a lifetime of minutes. CrashLens exists to capture it automatically, at the moment of impact, and hand it to the people who need it — drivers, first responders and insurers.

03

What was built

A Raspberry Pi 5 unit with Camera Module 3, a 6DOF IMU, GPS and 4G LTE detects crashes, saves the video around the impact, encrypts the evidence and pushes it to the cloud. Native iOS and Android apps serve drivers and first responders; web dashboards serve admins and insurance teams.

04

System

LTE · HTTPSDeviceCamera Module 3Device6DOF IMUDeviceGPSProcessRaspberry Pi 5Edge / APICloudflare WorkersDataSupabaseDataAudit logDataCloudflare R2ClientDriver appClientResponder appClientAdmin dashboardClientInsurance dashboard
Hover or tab through the nodes to trace each pathway.
  1. Stage 01
    • Camera Module 3Continuous capture into a ring buffer
    • 6DOF IMUAccelerometer thresholds detect the impact
    • GPSLocation attached to every evidence packet
  2. Stage 02
    • Raspberry Pi 5Python · detection, ring-buffer save, AES-256-GCM encryption
  3. Stage 03
    • Cloudflare WorkersHono.js API receiving uploads over 4G LTE / HTTPS
  4. Stage 04
    • SupabasePostgreSQL — incidents, users, roles
    • Audit logImmutable chain-of-custody record
    • Cloudflare R2Encrypted video evidence
  5. Stage 05
    • Driver appiOS (Swift) · Android (Kotlin)
    • Responder appAutomated dispatch alerts
    • Admin dashboardReact · role-based
    • Insurance dashboardReact · role-based
Device → edge → storage → role-based surfaces
  • device — Pi 5 + IMU + GPS
  • backend_api — Cloudflare Workers
  • driver_app — iOS / Android
  • responder_app
  • admin_dashboard
  • insurance_dashboard
  • public_website
05

Technical decisions

  1. D01

    Detect on the device

    Crash detection runs on the Pi itself using accelerometer thresholds from the 6DOF IMU, so the moment of impact is recognised at the source.

  2. D02

    Ring-buffer video

    The camera records into a ring buffer. A detected crash triggers a save of that buffer, preserving the footage around the impact.

  3. D03

    Encrypt before it leaves the car

    Evidence is encrypted with AES-256-GCM on the device and pushed over 4G LTE via HTTPS.

  4. D04

    Edge API, split storage

    Cloudflare Workers (Hono.js) receive uploads. Structured data lands in Supabase (PostgreSQL); video lands in Cloudflare R2.

  5. D05

    Chain of custody

    An immutable audit log records the evidence trail so that it stays legally defensible.

  6. D06

    One system, several surfaces

    Native apps — Swift on iOS, Kotlin on Android — for drivers and first responders; role-based React dashboards for admins and insurers.

06

Outcome

  • Real insurance-industry interest.
  • The immutable chain-of-custody audit log keeps evidence legally defensible.
  • Automated dispatch cuts first-responder notification time to seconds.