← Back to Projects

Project 002

Smartphone-Based Vehicle Horsepower Estimation

Estimated a vehicle's horsepower from a smartphone accelerometer mounted to the dashboard, applying Newton's Second Law and numerical integration to full-throttle acceleration data.

PythonNumerical IntegrationDynamicsSignal ProcessingData Analysis
Acceleration vs time plot for the full throttle pull

Acceleration vs Time

Overview

This project explored whether a phone's accelerometer, mounted to a car's dashboard during a full-throttle pull, could produce a reasonable estimate of the vehicle's horsepower. Raw acceleration data was captured, then processed in Python to recover velocity, displacement, and instantaneous power over the course of the run.

The approach relied entirely on Newton's Second Law and numerical integration, no dyno, no OBD data, just the phone's IMU and the vehicle's known mass.

Methodology

Sensor Calibration

The gFy axis read close to -1g at rest, which identified it as the gravitational component. The gFx axis aligned with the direction of travel and was used as the longitudinal acceleration signal. The first 100 samples, recorded with the car at rest, were averaged and subtracted out as a bias offset before converting from g's to m/s².

A rolling average was then applied to reduce noise from road vibration while preserving the shape of the acceleration curve.

Pull-Window Isolation

Since the recording included idle time before and after the run, a detection routine scanned the signal for a sustained acceleration above a threshold lasting at least two seconds, then isolated that window for analysis. The signal was re-zeroed at the start of the isolated pull before integration.

Integration & Power Calculation

Because the phone sampled at a variable rate, each timestep was computed directly from the data rather than assumed constant. Velocity and displacement were obtained through trapezoidal integration, and force was recovered from F = ma using the car's curb weight with passengers. Instantaneous power was calculated both as P = Fv and as the time derivative of cumulative work, and converted to horsepower.

Engineering Decisions

Variable Timestep Handling

Rather than resampling to a fixed rate, the integration routines used the actual per-sample time deltas, preserving accuracy given the phone's inconsistent sample rate.

Rolling-Window Smoothing

A centered rolling mean was chosen over a simple low-pass filter to cut sensor noise while keeping the acceleration curve aligned in time with the raw signal.

Automatic Pull Detection

An automated window-finding routine was written to detect the sustained acceleration event, removing the need to manually trim the recording for every run.

Results

QuantityValue
Peak Acceleration2.46 m/s²
Peak Velocity34.1 m/s (76.3 mph)
Peak Force3,791.05 N
Peak Power84,464.21 W
Estimated Horsepower113.22 hp

The estimated 113.22 hp came in below the vehicle's rated 130 hp, which lines up with expectations given the trial was run on damp pavement, where reduced traction limits how much of the engine's output translates into forward acceleration.

Team

MEEG 211: Dynamics — Dr. Michael Santare

Jayden Paris • Caleb Beswick