← Back to Home

SafeDrive makes drivers feel what their passengers feel

Drivers rarely notice their own hard braking, sudden starts or sharp turns. SafeDrive recognises these moves on its own chip. In the app, Tofu the buddy floats and spins with every move the car makes.

Role
Individual project · hardware, ML, firmware, app
Timeline
Spring 2026
Built with
ESP32-S3, motion sensor, OLED
Status
Working prototype, tested in cars

In this project, you can see how I designed everything from the model on the chip to the character on the phone.

  1. 1SafeDrive app
  2. 2Designing with AI
  3. 3Hardware & on-device ML
  4. 4From idea to market

Why I built it

Bad driving is easy to feel and hard to say.

Have you ever sat in a car where every stop throws you forward?

Hard braking, sudden starts and sharp turns are easy to do and easy to forget. To change a habit, drivers need to notice it the moment it happens. They also cannot look away from the road to read a report. What helps is feedback that arrives right away and needs no reading.

Meet Tofu, the passenger in your phone.

While you drive

Nothing to read on the road. Tofu reacts to each move with motion, a sound and a short voice line. The score drops by the same points the box takes off.

Getting started

Onboarding page design

Setting up the box feels like meeting a friend. Tofu shows each rule instead of explaining it.

9:41
9:41

After you park

Look back kindly, one tip at a time.

The good parts come first, then one tip per kind of moment. A sudden stop may have been the right call, so Tofu never blames.

9:41
9:41

Over the week

Every drive is saved, so progress shows.

Each trip goes into the journal with its score, so drivers can see how their week is going and whether they are getting smoother.

9:41
9:41

Designing Tofu

How I work with AI to design Tofu

I built the app with Claude Code and gave Tofu a voice with ElevenLabs. AI brought speed and volume; taste and every final call stayed with me. The work moved through five stages, and the middle two looped many times.

Me
  • The background, and who it is for
  • Which direction is worth pursuing
  • A critique, with references and sketches
  • How each moment should feel
  • The final call
AI
  • Research and a plan to approve
  • Many options, fast
  • A redraw that matches what I showed
  • Working code, motion and sound
  • A voice in the tone I asked for
  1. 1Frame

    Give AI the context before asking for anything.

    MeThe background, who the user is, the flow they go through, and the look I want.

    AIResearches similar apps and comes back with a plan for me to approve.

    SafeDrive is pure hardware, and its only screen shows a number… Design a phone app for people who just bought the box… Look at similar apps first, then show me a plan.
  2. 2Go wideClaude Code

    Get many options fast, then find the spark.

    AIThree directions on the same screens, and a lineup of characters and faces.

    MePick what is worth pursuing and merge the best parts: B’s tone, C’s ribbon, A’s gauge.

  3. Steer and build looped until it felt right

    1. 3SteerClaude Code

      Show it, don’t just tell it.

      MeCritique every version, and send a screenshot or a sketch when words fall short.

      AIRedraws the version to match what I showed.

      A reference I sent: small square faces with only eyes
      A reference I sent
    2. 4Build and feelClaude Code

      The build shows what a still screen can’t.

      AIA working app with motion and sound.

      MeRide along and react. Too polite? Make it slam forward like a roller coaster.

  4. 5Voice and polishElevenLabs

    Give Tofu a voice and the right words.

    AIVoice lines in the tone I asked for: tense, not cheerful.

    MeCompare options side by side and make the final call.

Behind the app · Hardware

Behind Tofu: hardware I designed and built.

  • In the momentA fresh check on your driving every two seconds
  • At a glanceOne score from 0 to 100, plus the move it just noticed
  • Works offlineNo network needed: every prediction runs on the chip
  • Compact buildA thumb-sized board and a motion sensor, on battery power

From a jolt in the car to a score on the screen.

Every two seconds, SafeDrive reads how the car moved. A small machine-learning model names the move. Then a few simple rules decide whether it costs points.

A motion sensor feels the car 50 times a second.

An MPU-6050 measures how the car speeds up and turns, in six directions. It shares one pair of wires with the screen on a XIAO ESP32-S3 board.

Rate
50 Hz
Axes
ax ay az · gx gy gz
Window
100 samples = 2 s
How I collected and labeled the data

All the data comes from a real car. I took the hardware into the car and drove on a safe, closed stretch of road. There I recorded many rounds of hard braking, quick starts and sharp turns, plus normal driving and idling. Five sessions between April 15 and 19, 2026 gave about 48 minutes of 50 Hz motion data.

A Python logger I wrote reads the board’s motion stream over USB. One key press sets the label for every new line:

LABEL_KEYS = {
    "n": "normal",
    "b": "hard_brake",
    "a": "rapid_acceleration",
    "t": "sharp_turn",
    "i": "idle",
}

with label_lock:
    label = current_label

row = parts + [label]
rows_buffer.append(row)

Excerpt from serial_logger.py. Each row is timestamp_ms, ax, ay, az, gx, gy, gz, label.

A second script cut the recordings into 2-second windows and uploaded them to Edge Impulse. A window was kept only if at least 80% of its samples shared one label. Risky moments are short, so their windows start every 0.2 s. Normal and idle windows start every second, capped at 400 and 250. The windows were split 80/20 into training and test sets at random, per label.

Feedback

What people said.

For hardware and a model this small, the accuracy is already very high. There is not much to fault.

LuyaoTECHIN 515 instructor

There is a real market for this. Many insurance companies already put devices like it in cars.

ZubinTECHIN 515 instructor

This is really cool. The app feels friendly, and I would want it on my own phone.

ClassmateTECHIN 515

From idea to market

Who needs it most, and how I would prove it.

  1. 1

    Friends & family

    Friends and family who want to drive smoother for the people in their car try it for a few weeks.

    MeasureHard brakes per hour, first week vs last

  2. 2

    New ride-hail drivers

    New drivers, and drivers with low ratings. Passengers rarely tell a driver they feel sick; they just leave a low rating. SafeDrive tells the driver first.

    MeasureChange in passenger rating

  3. 3

    Pitch with data

    Smoother drivers mean better ratings. I bring the pilot numbers to ride-hail and map apps.

    MeasureDrivers still using it after a month

What the product needs on the way

Hardware

More drivers, more roads

Everything so far came from my own recordings. Data from more people, cars and road conditions would let the model hold up on drives it has never seen.

The business plan

Passengers don’t complain. They just leave a low rating. SafeDrive tells the driver first.

  • Who it’s forNew ride-hail drivers and drivers with low passenger ratings
  • What they getKnow what passengers feel, without being told to their face
  • How it makes moneyA subscription for drivers, or a license per fleet
How I would sell it
To drivers

Lead with the feeling. The first weeks are free, so the first drive sells it.

To ride-hail and map apps

Lead with pilot numbers, and start as a feature inside their app.

Appendix

Explore the build

Project poster ↗PDF, 3.5 MB

FAQ

Questions people ask

Why not just use the phone’s motion sensor?

I started from hardware because I wanted to build the sensing myself, from the sensor to the model on the chip. A phone has the same kind of motion sensor, so next I want to try SafeDrive on the phone alone. Then anyone could use it without buying a device. See the hardware ↑

Isn’t an app distracting while driving?

I designed the drive screen so drivers don’t need to read it. Tofu reacts with motion, a sound and a short voice line, so drivers can hear it without looking. Scores and tips only show up after they park. I’m also exploring Tofu as a small card inside navigation apps or CarPlay, so drivers can know how the ride feels at a glance without opening a separate app. See Tofu in action ↑ · See Tofu beside navigation ↑

How accurate is it, and on what data?

On data it never trained on, it got 76.7% right, and 79.1% on validation. All the data came from my own drives: five sessions, 48 minutes. Sharp turns were the easiest to recognize, quick starts the hardest. See the full results ↑

9:41