# Calculating tilt on motorbike using accelerometer

We are trying to create an iphone app that displays the tilt angle while riding a motor bike. Currently trying to figure out if the built in iphone accelerometer and gyroscope is good enough or if we're going to need better ones (keeping in mind the amount of vibration produced by the bike while riding). Any suggestions or concerns on interfacing the sensors with the arduino are welcome. Also any suggestions for specific sensors for this project? Thanks.

Currently trying to figure out if the built in iphone accelerometer and gyroscope is good enough

Only you can define whether they are good enough.

How will the iPhone be mounted?

keeping in mind the amount of vibration produced by the bike while riding

The amount of vibration depends a lot on the bike. Some bikes don't vibrate much at all. Some vibrate a lot. How that affects lean angle escapes me.

A potentiometer with a weight attached to the handle would be sufficient for measuring lean angle.

Why are you trying to measure lean angle, anyway. The amount that one can lean depends on a lot of factors that are hard to measure. There is a manufacturers specification, determined using properly inflated tires, some specific rider weight, and a smooth, flat concrete floor. In the real world, the road surface is not smooth or flat, the tires are never at the same inflation or age as the test measurement, and you (or whoever) probably doesn't weigh exactly what the manufacturer assumed you would.

I just lean until the floarboards are dragging, then stop leaning.

You can't measure the lean angle when going round a corner with an accelerometer (or with a potentiometer with a weight attached to the handle) because in a balanced turn you will lean the bike sufficiently to balance the centripetal acceleration, so that the two cancel out.

You can use an accelerometer to measure the G force, and a gyroscope to measure the rate of turn or the rate of change of lean angle (depending on gyrosope axis). You could integrate the latter to get the lean angle.

keeping in mind the amount of vibration produced by the bike while riding

Making multiple measurements and average them might cancel the vibration effects for a substantial part.