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

LSM6DS33 - Raw values raspberry pi


Hi everybody!

I have the AltIMU-10 v5 and I’m trying to use it with my Raspberry Pi. So Far I started writing my own library for interfacing the gyroscope, using python and the smbus library for i2c communication. I successfully managed to get the the raw data from gyroscope, but I have trouble understanding it, I have doubts that I’m getting the data in the right way, and I need some help. So what I’m doing is upon initialization writing to register CTRL2_G with the value of 0b01011000 configuring it to 208 Hz (high performance) / 1000 dps. Then I have an infinite loop that reads out of registers: OUTX_L_G, OUTX_H_G, OUTY_L_G, OUTY_H_G, OUTZ_L_G, OUTZ_H_G and after that I’m combining the hi and lo bits into 16 bit value. The output then seems a bit strange to me, and I need a little bit help converting it into useful degrees per second output. I’m posting a gist of the code with some output data.
Can someone please help me understand the data that I’m getting. The last bit of outputs seem really close to dps that I need, but they are still around 2 when the sensor is steady.

Thanks in advance for your response,


It looks like you are getting a zero-rate level of about ±2.5dps, which seems well within the typical zero-rate level for the LSM6 (±10dps). (That characteristic is specified under the “Mechanical characteristics” tab of the LSM6DS33’s datasheet, which you can find under the “Resources” tab of the AltIMU-10’s product page.) You can average this output and subtract it from future readings to get closer to zero.

Do your readings make sense when you are rotating your gyro?