Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

LSM303 set acceleration sensitivity

I have been trying to set the accelerometer sensitivity in the LSM303D module in the Pololu AltIMU-10 v4 Gyro, Accelerometer, Compass, and Altimeter, to +/- 16g, per the specifications. However, my attempts to do so have failed.

I am using it with Arduino, and have edited LSM303.cpp to write 0x30 to CTRL2 in the enableDefault() routine for when _device == device_D. For completeness sake, I also wrote 0x38 to CTRL_REG4_A for when _device==device_DLHC, and I wrote 0x30 to CTRL_REG4_A for when _device==DLM or DLH.

When the libraries are reloaded, I still have only +/- 2g sensitivity. How to change the sensitivity?

Hello.

I am sorry you are having trouble setting the full scale sensitivity of your LSM303D. It looks like you are sending the incorrect value for the behavior you want. For +/-16g, the AFS[2:0] bits should be 100, and you should be writing 0b00100000 (which is 0x20 in hexadecimal) to CTRL2.

-Jon

This value gives +/- 2g

Can you upload your modified LSM303.cpp file?

-Jon