I'm the developer of Perusa, a small Android app I build on my own. It puts dots along the edges of the screen that follow the car's real braking and turns, on top of whatever you're reading, for passengers who feel queasy reading in the car. This post is about the problem I spent last week on: knowing which way is down.
The problem
The phone's accelerometer measures everything at once: gravity plus the car's push. To show a passenger the braking and the turns, the app has to take gravity out, and for that it has to know where "down" is in the phone's frame.
On a straight road at constant speed that's easy: what's left in the accelerometer is gravity. Stop-and-go traffic is the hard case. The car doesnt stay steady long enough to check, and every correction the app had was switched off during maneuvers, which in stop-and-go is nearly all the time.
In one of my tests, a small knock on the phone in its holder, right as the car pulled away from a light, left "down" about 3.4° off.…