Accelerometer.. Which to buy?

I wanna get an accelerometer for my bot. They can be had extremely cheap on ebay and dealextreme for example, with free shipping, so I'm gonna go for it, even though having stuff shipped here tends to be an experience equally pleasant to getting kicked in the nuts :/ But with these prices it wont be a dissaster even if it never shows up, or if the local customs decide to charge me 100+ % of the value extra (both of which have happened to me).

However I have no idea what to buy, since I have no experience with these thingies, so simply picking one would be like throwing a dice. What should I look for? Or avoid? I obviously wanna get one that gives me as much useful input as possible.

The most common one seems to be an ADXL335, which I've seen as cheap as $1.59 including shipping (however that business model works :/).

Then there is this one which includes a gyroscope for $1.35. Having a gyroscope too would be AWESOME off course, but at this price I can just hardly believe the damn thing even works.

Anyway I hope some of you guys who have used these things are willing to share your knowlegde.

Make sure the module you get

Make sure the module you get accepts 5V as the power, those IC normally work on 3.3V and the module has to include a small voltage regulator (or, if you can have your own 3.3V power source, you can just use that).

Looking at the photos, they all seem to have the voltage regulator on them (the small black thing with 3/4 legs).

I use the GY-61 module in µKubik, it takes up three analog pins. So far I’m just collecting the data, calculating the average, minimum and maximum (the data is quite noisy) and sending that to the Python side. Didn’t yet write any Python code to do anything else than displaying it. Connecting it to the arduino’s analog directly pin will give you a change of about 20 in the reading for 1g (it will go from 0 to 600-something instead of 0-1023, because the module has maximum of 3.3V).

I also have the MPU6050 in my other robot, connected through I2C to Raspberry Pi, but I didn’t do anything with it yet either.

Thanks guys.Sounds really

Thanks guys.

Sounds really cool about the MPU6050 I must say, even though it uses I2C for communication (which I have heard can be a mess) and may requiere a separate Arduino just to control it. But does it actually have a complete gyroscope too, or just something gyroscope-ish?

I’ll also check out the GY-61 a bit later.

No experience with the ADXL335? They seem to be everywhere, so I assumed it would be the safest bet.

GY-61 is ADXL335, on a small

GY-61 is ADXL335, on a small board, with added voltage regulator. But it’s the same thing.

MPU6050 does have a 3 axis accelerometer and a 3 axis gyroscope, plus a programmable chip that can mix their output or generate interrupts on alarms, etc. – but programming it is an advanced topic. In case of doubt, always check the datasheet:

Well I’m still looking

Well I’m still looking forward to the day I can actually read those datasheets.

“signal conditioned voltage outputs”, “10,000 g shock survival”, “BW adjustment with a single capacitor per axis”, “RoHS/WEEE lead-free compliant”, etc…

Sure that sounds … erm … super :confused: Hehe

Anyway I get the idea that the MPU6050 is the long term solution, though it will take more time to get working.

Thanks for the info :wink:

Well, the trick is to ignore

Well, the trick is to ignore most of the datasheet and only look at the things you actually need. Like the “Operating Voltages”, “Normal Operating Current” (and maybe “Output Leakage Current” if you are going to do funny things with the signal filtering). Sure, it’s nice to know that the sensor can withstand acceleration of 10000g for 0.2ms, but I doubt that you have the means to generate 98100m/s² at home (that’s from 0 to 100km/h in 0.00028s, I’m pretty sure they are lying).

As for MPU6050, I didn’t make myself clear. It will work right out of the box (well, as soon as you get I²C to work and decode its data frame) – you don’t have to program the microcontroller that it has on board to use it. You can just use the raw values from the accelerometer and the gyroscope.

"It will work right out of

"It will work right out of the box…"

Thanks for clearing that up. Still I get the idea that it isn’t the easiest module to use. For starters it’s I2C, and Duane also said “I think the code for the MPU6050 is pretty involve…”, so I do expect to have to work for it, but it seems worth it.

mpu6050

Is there a prefered “better” location to mount these devices?

I have it mounted to the

I have it mounted to the base, right in the geometrical center of the robot. Mounting it to the side would make it more difficult to calculate the actual tilt of the robot.

I’ve seen some (wheeled) robots that have it mounted on top of a long pole sticking out vertically from their middle. I assume that’s to make any changes in robot’s tilt more pronounced.

mpu6050 position

I am a complete novice with this device. Have one and ordered 5 more last night after chasing down eBay prices. The angular velocity should be independent of distance from the axle but the changes in x,y,z should be much greater the further away from the center of rotation.

Should I start a separate discussion? This this to far afield from Aniss’s original question? Is there already a proper place to discuss the technical details. I have two robots (hexapod & balancer) that really could use a proper application of a MPU6050.