Vehicle dynamics · phone sensors · Nov 2026

I rebuilt a metro tunnel in 3D from the sensors in my phone.

Nobody publishes what the inside of a metro tunnel looks like — where it climbs, where it bends, where the train has to fight gravity to stop. So I measured it. A phone lying on the seat records which way it turns, how the air pressure changes and how hard it's pushed. Put those together and you get the tunnel: 12 km of it, nine stations, every hill and curve — and with it, exactly where the brakes do the most work.

12 kmof tunnel and 9 stations rebuilt from one phone
≈ 1°or better: gap between the gyroscope's turns and the mapped track on 6 of 8 stretches (8° on the sharpest curve)
±1 mstation heights repeat to within this across separate rides
≈ 400 J/kgof height shed between two stops on the steepest downhill — the brakes and air drag have to absorb all of it

The tunnel

Drag to look around. The train replays the real run.

Colour shows what the train was doing at each point. Height is stretched so the hills are visible — use the slider to see it closer to true scale. The tube is drawn far thicker than the real tunnel.

Colour by
pulling (traction) cruising / coasting slowing (braking)
loading…

Station labels are S1–S9 on purpose — see why the stations have no names. The view is turned so S1 → S9 runs left to right; it is not a map, so there is no north.

Method

How a phone sees a tunnel.

BendsGyroscope

It measures how fast the phone rotates. The part around the vertical is the train turning. Multiply by speed, add it up, and you get the tunnel's path seen from above. The gyroscope's own drift is measured while the train stands in a station — where it can't be turning — and taken out.

HeightBarometer

Air pressure drops about 0.12 hPa for every metre you climb. I read it only while the train stands at a platform: while it moves, the air it pushes through the tunnel swings the pressure by more than the climb itself. Between stations the height is drawn as a straight line — interpolated, not measured.

SpeedAccelerometer

Integrating acceleration gives speed, but a tilt of half a degree adds up to metres per second within a minute. Two facts fix it: the train is stopped at both ends of each run, and the distance between stations is known. A run that needs a big correction to meet both is thrown out.

Height

The tunnel rides the hills above it.

Rail height from the barometer against ground height above each station from an elevation model. Both are measured from S1, so only their shapes compare — not how deep the tunnel is. Between S2 and S3 the rail climbs 39 m in 1.4 km; the hill above it climbs 50.

rail height (barometer)ground above each station (elevation model)

Filled dots: measured in calm air at the platform. Hollow dot (S7): estimated from the pressure while moving, corrected by the steady 4.5 m offset that moving air showed on the other stretches.

Speed

Pull, cruise, slow, stop — eight times.

pulling cruising / coasting slowing

Brakes

Where the brakes work hardest — and where gravity helps.

To stop, the brakes have to take away the train's motion energy, ½v², plus any height it loses on the way down, g·Δh — per kilogram of train. On flat track that's the motion alone. On a slope, the tunnel decides.

motion energy when slowing starts height lost while slowing (downhill) height gained while slowing (uphill — gravity brakes for free)

S3 → S4 · 2.7% downhill40.6 m lower

The train leaves S3 at rest and stops at S4 at rest, 40.6 m lower. That height — about 400 J/kg — can only go into the brakes and air drag, on top of whatever the motors add. If the slope is even between the stations, most of it lands on the final stop: the train starts slowing at 88 km/h (300 J/kg of motion) with 24 m still to drop (another 234) — about 534 J/kg, nearly twice what flat track would ask.

S2 → S3 · 2.9% uphill39 m higher

Here the stop is 39 m above the start, so gravity takes about 380 J/kg off the train over the run, for free. If the slope is even, the train starts slowing at 75 km/h (218 J/kg) while still climbing 10.5 m (103 J/kg), so the brakes handle about 115 J/kg — roughly a fifth of the downhill stop.

The split between motion and height assumes an even slope between stations, which the barometer can't confirm (see Limits); the total height between two stops is measured. Motion energies use the measured peak speeds, which run up to ~10% high (see Limits). These are upper bounds for the brakes: rolling resistance and air drag also take a share while slowing. It is also the energy a regenerative drive could try to win back — how much it actually recovers depends on the drive and on whether another train on the line can use it at that moment.

Ride numbers

Each stretch, as the passenger feels it.

StretchLengthGradeTop km/hPull m/s²Slow m/s²Jerk start / stop m/s³Vibration aw m/s²

Pull and slow are the peaks of the speed-derived acceleration (smoothed to 0.3 Hz). Jerk is how abruptly the push changes. Vibration is the ISO 2631-1 frequency-weighted value; a phone on a seat reads differently from a seat-mounted sensor, so compare these with each other, not with published ISO limits.

Checks

How I know it isn't made up.

The phone never saw a map. So the map is the test: how much the track really turns between stations (OpenStreetMap), against how much the gyroscope says it turned. And station heights measured again on separate rides agree to within 0.6 m.

StretchTurn, gyroscopeTurn, mapWorst gap to mapHeight changeSpeed fit

Speed fit: how little the accelerometer needed correcting to meet the station distance ("good" < 0.15 m/s², "rough" < 0.6).

Limits

What this can't tell you.

Privacy

Why the stations have no names.

These are rides I actually took. Named stations and dates would add up to a record of where I go, so the page keeps only the measurements: stations are numbered, the view isn't tied to north, and nothing here says when or how often a stretch was ridden.

Where it came from

A by-product of an app I've stopped building.

This is one chapter of WhereisMyRide, an app I built to measure Istanbul's rail system with a phone — Tekir the cat was its mascot. The other chapters: what the barometer feels while moving, and how a compass reads the motors. I've stopped developing the app; plenty of good transit apps already exist. The measurements were the part worth keeping.