cancel
Showing results for 
Search instead for 
Did you mean: 

Accelerometer

girish
Associate II
Posted on November 07, 2011 at 11:41

Hello,

We are working with the STM32F4-Discovery and are testing the accelerometer.

The demo program works fine and we see the LED values blink when we tilt the board (in an angular fashion). In that case, 2 LEDs blink.

However, if we move the board only on one direction (either X, Y,  the response is different. After some time only one LED blinks. Is this working as expected ?

Or are there any settings to detect 2D motion ?

We are only using demo code and not written any code so far.

Best Regards,

Girish
1 REPLY 1
raptorhal2
Lead
Posted on November 08, 2011 at 18:04

All accelerometers have some offset in each axis, and we can't tell if you are rotating it precisely about it's axis.

I suspect the demo is not calibrated for offset, since on my unit I also get two lights blinking when I precisely rotate it. The ''wrong'' LED goes out if I also tilt the unit a small amount in the other axis.

If you are going to use an accelerometer in your application, here is a good exercise. Write a program to read the accelerometer output (modifying the demo is probably the easiest). Place the board flat, record the output, and then use this bias to correct the output to determine which LED to blink. Then tilt or slide the board precisely and see if the LED blinks make more sense.

After determining the bias corrections, tilt the board +/-90 and 180 degrees, read the values, and calibrate the accelerometer gains.

The accelerometer is a multi-axis device. 2-D motion is detected as the vector sum of each axis motion.

Cheers, Hal