« Close

Datasheets and User Guides

App Notes

Software & Driver

 

Adafruit 10-DOF IMU Breakout

This Lua script is useful as an example of how to combine I2C communication between many slave devices. This example utilizes a collection of I2C sensors, which are all available on the Adafruit 10-Degrees of Freedom Inertial Measurement Unit (10-DOF IMU, available here: https://www.adafruit.com/product/1604

This example uses the following I2C Sensors: 

  • L3GD20H Triple-Axis Gyro
  • LSM303 Triple-axis Accelerometer**
  • LSM303 Triple-axis Magnetometer**

*The BMP180 Barometric Pressure Sensor was not implemented in this example because of Lua script limitations. See the BMP180 Lua script for more information.

**Although the LSM303 devices are in the same package, they behave as two separate devices. See the LSM303 Accelerometer & Magnetometer Lua Script for more information.

Each of the 3 sensors must be initialized over I2C (to configure parameters such as range, data rate, and low/high power mode.

To switch between devices, the I2C bus is configured for one address, and MB.W(5104, 0, yourNewI2CAddress) is used to switch between slave devices. Reconfiguring the bus with I2C.config() would work, but takes unnecessarily long.

For more information on each I2C sensor, visit their specific lua script example.

The 10 DOF board requires very few components to run, a 3.3V supply is provided by the LJTick-LVDigitalIO.

The accelerometer can be tested by rotating it at angles to the earth, where +1.0g and -1.0g can be measured. Below is a graph of the accelerometer data (X is white, Y is red, Z is green) as the module is rotated.