I don't know what I need, Gyro sensing?

I’m working on bike shaped robot, and I intend to use a tilting weight to help keep him blanched. So I would need a sensor that measures 1 axes of rotation. But I don’t know what to look for. I know its ether a gyro or accelerometer or both, but not familiar of naming of sensors (I know that makes me sound like a fool) and I don’t how tell if it would be compatible with an Arduino, so if anyone could tell me what I need and where I can get it that would be cool. I also have a preference for this site http://www.sparkfun.com/ so if I could find it on here that would be great.

here they say, that they used both: http://www.youtube.com/watch?v=jRyAkpswnh4

u might need a PID controller: http://en.wikipedia.org/wiki/PID_controller http://www.arduino.cc/playground/Code/PIDLibrary

Gyro will give you fast response and is unaffected by actual acceleration, but will drift with time and does not provide absolute orientation. You need both a gyro for fast response and an accelerometer to correct for drift.

In some circumstances just an accelerometer will do, but they can pick up a lot of noise (vibration and accelerations) not just tilt. For an accelerometer to measure changing tilt best it needs to be on the axis of rotation (which for a bike is at ground height unfortunately). Gyros measure angle exclusively and aren't critical in placement.

OK so would this http://www.sparkfun.com/products/10121 do the trick?

a real 1-axis gyroscope that can tell u the current absolute error would be nice... http://en.wikipedia.org/wiki/Gyroscope that gyro chip seems to be more like an accelerometer... but it seems like they r too bulky... http://de.wikipedia.org/wiki/Datei:Gyroscope_hg.jpg

if i understood the datasheet correctly, those chips just tell the rate of change... they cannot distinguish between lying on the side and being upright...

the speed of that I2C interface should be ok for ur application (if the surfaces r not 2 slippery... like wet ice...)...

xxQdotxx: OK so would this http://www.sparkfun.com/products/10121 do the trick?

With 6DoF (degrees of freedom) - ie 3-axis accelerometer and 3-axis gyro - you can construct a DCM that gives your absolute orientation in 3D (but with drift in the yaw axis, ie you need a compass to fully stabilise in the long-term. The outputs of the rate gyros are used to update the DCM in realtime, usually sampled about 100 times a second. The accelerometer's output is used to give true orientation in the long term (ie compute the drift correction). During rapid motion the accelerometer isn't giving useful tilt info, that's got from the long-term average of the acceleration vector.

DCM - direction cosine matrix. There are lots of examples all over the web for doing this (an understanding of 3D vectors is very handy for getting your head around all this, note). An alternative way to represent orientation is a quaternion.

For strictly one-axis work (Segway clone) this is rather overkill - for two-axis it is arguable if 3-axis is a better approach (2-axis sensors are unable to detect and correct for any motion in the 3rd axis). For a 2-axis spirit level this isn't an issue, but for dynamic motion control I think it often is an issue.

what do you mean by overkill that it has all these features that I don't need. If so I don't mind, I plan to reuse the sensor in a later project. I just need to know if I could use this find out the angle or change in angle so i can correct it with titling weight. I found this is it what i'm looking for? http://www.mindkits.co.nz/store/sensors/imu-analog-combo-board-5-degrees-of-freedom-idg500-adxl335-1

xxQdotxx: what do you mean by overkill that it has all these features that I don't need. If so I don't mind, I plan to reuse the sensor in a later project. I just need to know if I could use this find out the angle or change in angle so i can correct it with titling weight. I found this is it what i'm looking for? http://www.mindkits.co.nz/store/sensors/imu-analog-combo-board-5-degrees-of-freedom-idg500-adxl335-1

Overkill in the respect that it's a three axis sensor and you only need one axis. But then again I don't think I've ever seen a single axis gyroscope and accelerometer combo and buying single axis devices separately won't save enough money to be worth the hassle of the more complex circuit.

To give you a straight up answer, yes, that device will be able to give you motion readings that will help you keep your bike upright. But again, as MarkT was pointing out, because all gyroscopes report a small amount of "drift" (they're never perfect and always say they're rotating a little bit) you have to be prepared for the heavy math required to work the gyro and accelerometer readings together to create a stable platform.