The 9-DOF IMU combines an accelerometer, gyroscope, and magnetometer in one combined sensor.
The module requires 4 connections to your microcontroller:
- VCC (2.75 to 6V)
Connect the module GND, SCL, and SDA pads to your Arduino's matching GND, SCL, and SDA pads as shown below. Connect the module VCC pad to your Arduino's IOREF pad.
Note: Some older Arduino boards with pre-R3 headers don't have specific headers for SCL, SDA, and IOREF. In those cases you can connect SCL and SDA to the appropriate connections elsewhere on the headers. For example, the module VCC connection should be linked to 5V if your Arduino runs at 5V, or to 3.3V if your Arduino runs at 3.3V. On Arduino boards based on the ATmega238P MCU, the SCL connection is also available on analog input A5, and the SDL connection is available on analog input A4.
Download the "RTIMULib-Arduino" library along with the other supporting libraries contained in the same download, and install them in your Arduino IDE.
The libraries can be downloaded from https://github.com/richards-tech/RTIMULib-Arduino/archive/master.zip.
For general instructions on library installation, please see our tutorial How To Install Arduino Libraries.
Note: The download contains multiple example sketches, plus five libraries contained within a "libraries" subdirectory. Move all five of them into your Arduino IDE as described in the tutorial above.
Inside the library download is an example sketch called "ArduinoIMU.ino". Open it in the Arduino IDE, and upload it to your Arduino. Open the Serial Monitor and set the baud rate to 115,200bps to match the setting inside the sketch.
You should now see a series of values reported in the console. You can change which values are reported by looking near the bottom of the example sketch and uncommenting the appropriate line. By default, the example outputs the "fusedEulerPose" values.
Changing I2C address
The default I2C address of the IMU9 module is 0x68. You can have two modules on the same I2C bus by changing the address of one of the modules to 0x69, by applying a solder bridge across the pair of pads labelled "AD0" (address bit 0) on the left end of the module.
Disabling I2C pull-ups
The I2C bus requires pull-up resistors to function correctly. If you have multiple devices on the bus, each providing their own pull-up resistors, you may need to disable the pull-ups included on the Barometric Pressure Sensor Module. To disable the pull-ups, use a sharp knife such as a scalpel to cut the two tiny tracks that bridge the set of three solder jumper pads together, as shown below.
If you need to reinstate the pull-ups later, you can bridge across the three pads with solder to reconnect them.