# Selecting an accelerometer for Deduced Reckoning

I have never used an accelerometer before, but I am aware that they come with I2C, SPI and analog outputs. If I choose to use an I2c or SPI, device, will I accumulate errors due to communication time?

Is the fast sampling of an analog signal likely to get me a more accurate deduced position than using am I2C?

Will this be true for

1. A robot moving in a room
2. A robot moving in an outdoor terrain and is likely to slip and roll down a slope.

Also, I have no sense of Gs. I tried to move my hand around fast with my phone running andro-sensor in my fist and saw that the readings saturated at 20m/s2. What G can I expect my robot to experience if it is hit by another fat moving bot or bumped by a fast walking human?

Increasing the sampling frequency of the sensor doesn't improve it's accuracy or precision. That is a feature of the sensor which you usually cannot change. If you try to estimate your position by integrating accelerations alone, you definitely will accumulate error over time, because every sensor is noisy. If you want to use the accelerometers to determine position or velocity, you should combine them with some other sensor that actually measures position (even with lower precision) or velocity. Then, you can combine these different sensor signals with a Kalman filter to obtain a reasonable estimate of where you are and how fast you are moving.

Considering G forces, consider that 1 G is 9.81 m/s^2, which seems a lot to me, in the context of small hobby robots, at least for indoor robots. Outdoor could be a different story, depending on how powerful your engine is. A saturation at 20m/s^2 should be enough.

Think in terms of your control loop speed. A typical fast control loop speed is 1kHz. Some robots use a faster rate, some slower. Usually your control loop speed is higher than you really need it to be.

So each control frame lasts for 1000us. Within this control frame you need to: