# Adafruit ICM20649 Wide-Range 6-DoF IMU Accelerometer and Gyro

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/088/845/medium800/sensors_Gyro_iso_ORIG_2020_02.jpg?1583190995)

Most accelerometers have a similar range of measurements that they can make: often around 2G - 16G. Similarly most gyros can measure in the range of 250 degree/s to 2000 degrees/s. That's enough for many situations, however there are many situations where it's not quite enough. When measuring things like a golf swing, soccer ball kick or perhaps a fancy racing car, you need a bit more performance out of your motion sensor.

The ICM20649 from InvenSense is a Wide-Range 6-DoF accelerometer and Gyro, capable of measuring **up to ±30g and ±4000 dps**! That's an impressive increase from the norm, about twice the range.

If you've found yourself limited by the standard ranges available, or if you just want to make sure the measurement range of your IMU is never an issue, pick up one of our handy ICM20649 breakouts.

![](https://cdn-learn.adafruit.com/assets/assets/000/088/846/medium800/sensors_Gyro_quarter_ORIG_2020_02.jpg?1583191231)

Each of our breakouts start with the sensor of interest, and in this case we begin with a hot-off-the-reel ICM20649 Wide-Range IMU. These chips are only a few mm across and have 0.4mm pitch contacts. To make it easier for folks to work with this chip, we've taken the sensor and mounted it on a breadboard-compatible breakout board.

Along with the sensor, the breakout board includes a voltage regulator and level shifting circuitry to allow you to use it with a range of devices nearly as large as its measurement ranges. Works great with the **3.3V logic level of a Feather or Raspberry Pi, or the 5v level of a Metro 328 or Arduino Uno** , this breakout is ready to work with most common microcontrollers or SBCs. and since it speaks I2C, you can easily connect it up with two data wires plus power and ground.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/088/847/medium800/sensors_Gyro_side_detail_ORIG_2020_02.jpg?1583191250)

As if that weren't enough, we've also added[&nbsp;SparkFun qwiic](https://www.sparkfun.com/qwiic) compatible [STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt) connectors for the I2C bus so you don't even need to solder. Just wire up to your favorite micro with a plug-and-play cable to get 6 DoF data ASAP. For a no-solder experience, [just wire up to your favorite micro, like the STM32F405 Feather](https://www.adafruit.com/product/4382) using a&nbsp;[STEMMA QT adapter cable.](https://www.adafruit.com/?q=stemma%20qt%20cable) The Stemma QT connectors also mean the ICM20649 can be used with our &nbsp;[various associated accessories](https://www.adafruit.com/?q=JST%20SH%204)

Easy wiring is nice, but even nicer is when it's combined with drivers and examples that are ready to go. We wrote libraries and examples for Python and Arduino to make easy interfacing of the ICM20649 breakout. Together they'll get you measuring an astoundingly wide range of measurements in no time!

# Adafruit ICM20649 Wide-Range 6-DoF IMU Accelerometer and Gyro

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/088/848/medium800/sensors_Gyro_top_ORIG_2020_02.jpg?1583191271)

![](https://cdn-learn.adafruit.com/assets/assets/000/088/849/medium800/sensors_Gyro_quarter_ORIG_2020_02.jpg?1583191294)

## Power Pins

- **Vin** - this is the power pin. Since the sensor chip uses 3 VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V
- **3Vo** - this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like
- **GND** - common ground for power and logic

## I2C Logic Pins

- **SCL** - **I2C clock pin** , connect to your microcontroller's I2C clock line. This pin is level shifted, so you can use 3-5V logic, and there's a **10K pullup** on this pin.
- **SDA** - **I2C data pin** , connect to your microcontroller's I2C data line. This pin is level shifted, so you can use 3-5V logic, and there's a **10K pullup** on this pin.
- **[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt)&nbsp;-** These connectors allow you to connectors to dev boards with&nbsp; **STEMMA QT** connectors or to other things with&nbsp;[various associated accessories](https://www.adafruit.com/?q=JST%20SH%204)
- **AD0 -**  **I2C Address pin and jumper**. Pulling this pin high or bridging the solder jumper on the back will change the I2C address from&nbsp; **0x68** &nbsp;to&nbsp; **0x69**

## SPI Logic pins:

All pins going into the breakout have level shifting circuitry to make them 3-5V logic level safe. Use whatever logic level is on **Vin!**

- **SCL** **(SCK)**- This is _also_&nbsp;the **S** PI **C** loc **k** pin, it's an input to the chip
- **SDA (MOSI)** - this is _also&nbsp;_the **S** erial **D** ata **I** n / **M** icrocontroller **O** ut **S** ensor **I** n&nbsp;pin, for data sent from your processor to the sensor
- **AD0 (MISO)** - this is the **S** erial **D** ata **O** ut / **M** icrocontroller **I** n **S** ensor **O** ut&nbsp;pin, for data sent from the sensor to your processor.&nbsp;
- **CS** - this is the **C** hip **S** elect pin, drop it low to start an SPI transaction. Its an input to the chip

If you want to connect multiple ICM20649's to one microcontroller, have them share the **SDA** , **SDO** and **SCL** &nbsp;pins. Then assign each one a unique **CS** pin.

## Other Pins

- **INT1** -The first interrupt pin. You can setup the ICM20649 to pull this low when certain conditions are met such as a value exceeding a threshold. Consult the [datasheet](http://43zrtwysvxb2gf29r5o0athu-wpengine.netdna-ssl.com/wp-content/uploads/2016/06/DS-000192-ICM-20649-v1.0.pdf) for usage
- **INT2** -The second interrupt pin. You can setup the ICM20649 to pull this low when certain conditions are met such as a value exceeding a threshold. Consult the [datasheet](http://43zrtwysvxb2gf29r5o0athu-wpengine.netdna-ssl.com/wp-content/uploads/2016/06/DS-000192-ICM-20649-v1.0.pdf) for usage
- **FSYNC\_IN -** Used to sync the sensor with an external source. Consult the [datasheet](http://43zrtwysvxb2gf29r5o0athu-wpengine.netdna-ssl.com/wp-content/uploads/2016/06/DS-000192-ICM-20649-v1.0.pdf) for usage. Connected to GND by default. Cut the jumper on the bottom of the breakout to use the external pin
- **SDE, SCE** Pins for advanced users to connect the ICM20649 to another, external I2C sensor. Consult the [datasheet](http://43zrtwysvxb2gf29r5o0athu-wpengine.netdna-ssl.com/wp-content/uploads/2016/06/DS-000192-ICM-20649-v1.0.pdf) for usage

# Adafruit ICM20649 Wide-Range 6-DoF IMU Accelerometer and Gyro

## Arduino

## I2C Wiring

Use this wiring if you want to connect via I2C interface

By default, the I2C address is **0x68**. &nbsp;If you add a jumper from **DO** to **3.3V** the address will change to **0x69**

- Connect **board VIN (red wire)** to&nbsp; **Arduino**  **5V** &nbsp;if you are running a **5V** board Arduino (Uno, etc.).&nbsp;If your board is **3V,** connect to that instead.
- Connect **board** **GND (black wire)&nbsp;**to&nbsp; **Arduino**  **GND**
- Connect **board** **SCL (yellow wire)&nbsp;**to&nbsp; **Arduino**  **SCL**
- Connect **board** **SDA (blue wire)&nbsp;**to&nbsp; **Arduino**  **SDA**

![sensors_c_arduino_wiring_qt.png](https://cdn-learn.adafruit.com/assets/assets/000/087/696/medium640/sensors_c_arduino_wiring_qt.png?1580168934)

![sensors_c_arduino_wiring_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/124/703/medium640/sensors_c_arduino_wiring_bb.png?1695644165)

The final results should resemble the illustration above, showing an Adafruit Metro development board.

## SPI Wiring

Since this is a SPI-capable sensor, we can use hardware or 'software' SPI. To make wiring identical on all microcontrollers, we'll begin with 'software' SPI. The following pins should be used:

- Connect **Vin** to the power supply, **3V or 5V** is fine. Use the same voltage that the microcontroller uses
- Connect **GND** to common power/data **ground**
- Connect the **SCL** pin to **Digital #13** (Yellow wire) but any pin can be used later
- Connect the **AD0** pin to **Digital #12** (White wire) but any pin can be used later
- Connect the **SDA** pin to **Digital #11** (Blue wire) but any pin can be used later
- Connect the **CS** pin **Digital #10** (Green wire) but any pin can be used later

![sensors_c_arduino_wiring_z_spi.png](https://cdn-learn.adafruit.com/assets/assets/000/087/698/medium640/sensors_c_arduino_wiring_z_spi.png?1580169061)

![sensors_c_arduino_wiring_z_spi.png](https://cdn-learn.adafruit.com/assets/assets/000/091/588/medium640/sensors_c_arduino_wiring_z_spi.png?1590631114)

Later on, once we get it working, we can adjust the library to use hardware SPI if you desire, or change the pins to others.

## Library Installation

You can install the **Adafruit ICM20649 Library** for Arduino using the Library Manager in the Arduino IDE.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/087/700/medium800/sensors_ARDUINO_-_library_manager_menu.png?1580169149)

Click the&nbsp; **Manage Libraries ...** menu item, search for **Adafruit ICM20649** ,&nbsp;and select the&nbsp; **Adafruit ICM20649** &nbsp;library:

![](https://cdn-learn.adafruit.com/assets/assets/000/087/699/medium800/sensors_e_libmgr_install.png?1580169119)

Then follow the same process for the&nbsp; **Adafruit BusIO** &nbsp;library.

![](https://cdn-learn.adafruit.com/assets/assets/000/087/702/medium800/sensors_ARDUINO-_BusIO_Lib_Manager.png?1580169252)

Finally follow the same process for the&nbsp; **Adafruit Unified Sensor** library:

![](https://cdn-learn.adafruit.com/assets/assets/000/087/701/medium800/sensors_ARDUINO_-Unified_Sensor_LibMGR.png?1580169239)

## Load Example

Open up&nbsp; **File -\> Examples -\> Adafruit ICM20649**  **-\> adafruit\_icm20649\_test** and upload to your Arduino wired up to the sensor.

Depending on whether you are using I2C or SPI, change the pin names and comment or uncomment the following lines.

```cpp
// Try to initialize!
if (!icm.begin_I2C()) {
  // if (!icm.begin_SPI(ICM_CS)) {
  // if (!icm.begin_SPI(ICM_CS, ICM_SCK, ICM_MISO, ICM_MOSI)) {
```

Once you upload the code, you will see the accelerometer, gyro, and temperature measurements being printed when you open the Serial Monitor ( **Tools-\>Serial Monitor** ) at **115200** baud, similar to this:

![](https://cdn-learn.adafruit.com/assets/assets/000/087/703/medium800/sensors_e_serial_monitor.png?1580169320)

Give the sensor a wiggle or a spin and watch how the measurements change!

## Example Code
https://github.com/adafruit/Adafruit_ICM20649/blob/master/examples/adafruit_icm20649_test/adafruit_icm20649_test.ino

# Adafruit ICM20649 Wide-Range 6-DoF IMU Accelerometer and Gyro

## Arduino Docs

# Adafruit ICM20649 Wide-Range 6-DoF IMU Accelerometer and Gyro

## Python & CircuitPython

It's easy to use the ICM20649 sensor with Python and CircuitPython, and the [Adafruit CircuitPython ICM20X](https://github.com/adafruit/Adafruit_CircuitPython_ICM20X) module.&nbsp; This module allows you to easily write Python code that reads measurements from the accelerometer and gyro, and will work with the ICM20649 as well as the ICM20948.

You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

## CircuitPython Microcontroller Wiring

First wire up a ICM20649 to your board for an I2C connection, exactly as shown below.&nbsp; Here's an example of wiring a Feather M4 to the sensor with I2C:

- **Board 3V** &nbsp;to&nbsp;**sensor VIN (red wire)**
- **Board GND** &nbsp;to&nbsp;**sensor GND (black wire)**
- **Board SCL** &nbsp;to&nbsp;**sensor SCL (yellow wire)**
- **Board SDA** &nbsp;to&nbsp;**sensor SDA (blue wire)**

![sensors_c_cp_feather_wiring_qt.png](https://cdn-learn.adafruit.com/assets/assets/000/087/704/medium640/sensors_c_cp_feather_wiring_qt.png?1580169633)

![sensors_c_feather_wiring_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/087/705/medium640/sensors_c_feather_wiring_bb.png?1580169672)

## Python Computer Wiring

Since there's _dozens_ of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).&nbsp;

Here's the Raspberry Pi wired with I2C:

- **Pi 3V** &nbsp;to&nbsp;**sensor VCC (red wire)**
- **Pi GND** &nbsp;to&nbsp;**sensor GND (black wire)**
- **Pi SCL** &nbsp;to&nbsp;**sensor SCL (yellow wire)**
- **Pi SDA** &nbsp;to&nbsp;**sensor SDA (blue wire)**

![sensors_cz_rpifeather_wiring_qt.png](https://cdn-learn.adafruit.com/assets/assets/000/087/706/medium640/sensors_cz_rpifeather_wiring_qt.png?1580169748)

![sensors_cz_rpi_wiring_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/087/707/medium640/sensors_cz_rpi_wiring_bb.png?1580169776)

### CircuitPython Installation of ICM20X Library

You'll need to install the&nbsp;[Adafruit CircuitPython ICM20X](https://github.com/adafruit/Adafruit_CircuitPython_ICM20X) library on your CircuitPython board.

First make sure you are running the&nbsp;[latest version of Adafruit CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython)&nbsp;for your board.

Next you'll need to install the necessary libraries&nbsp;to use the hardware--carefully follow the steps to find and install these libraries from&nbsp;[Adafruit's CircuitPython library bundle](https://circuitpython.org/libraries). Our CircuitPython starter guide has [a great page on how to install the library bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

For non-express boards like the Trinket M0 or Gemma M0, you'll need to manually install the necessary libraries from the bundle:

- **adafruit\_icm20X.mpy**
- **adafruit\_bus\_device**
- **adafruit\_register**

Before continuing make sure your board's **lib** folder has the **adafruit\_icm20X****.mpy, **** adafruit\_bus\_device **, and&nbsp;** adafruit\_register **files and folders** &nbsp;**copied over.

Next&nbsp;[connect to the board's serial REPL&nbsp;](https://learn.adafruit.com/welcome-to-circuitpython/the-repl)so you are at the CircuitPython&nbsp;`>>>`&nbsp;prompt.

### Python Installation of ICM20X Library

You'll need to install the **Adafruit\_Blinka** library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3.&nbsp;[Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `sudo pip3 install adafruit-circuitpython-icm20x`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

### CircuitPython & Python Usage

To demonstrate the usage of the sensor we'll initialize it and read the acceleration and rotation measurements from the board's Python REPL.

Run the following code to import the necessary modules and initialize the I2C connection with the sensor:

```python
import time
import board
import adafruit_icm20x

i2c = board.I2C()
icm =  adafruit_icm20x.ICM20649(i2c)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/102/050/medium800/sensors_icm20X.png?1620341178)

```python
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (icm.acceleration))
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s" % (icm.gyro))
```

![](https://cdn-learn.adafruit.com/assets/assets/000/091/740/medium800/sensors_f_b_repl_properties.png?1591220955)

That's all it takes to get going with the ICM20649 Wide-Range 6-DoF IMU. You're now prepared to measure more extreme events that other sensors can't handle

## Example Code
https://github.com/adafruit/Adafruit_CircuitPython_ICM20X/blob/main/examples/icm20x_icm20649_simpletest.py

# Adafruit ICM20649 Wide-Range 6-DoF IMU Accelerometer and Gyro

## Python Docs

# Adafruit ICM20649 Wide-Range 6-DoF IMU Accelerometer and Gyro

## Downloads

## Files

- [EagleCAD files on GitHub](https://github.com/adafruit/Adafruit-ICM20649-PCB)
- [Fritzing object in Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/raw/master/parts/Adafruit%20ICM20649.fzpz)

## Datasheet
[datasheet.pdf](https://cdn-learn.adafruit.com/assets/assets/000/087/720/original/datasheet.pdf?1580177969)
# Schematic
![](https://cdn-learn.adafruit.com/assets/assets/000/087/714/medium800/sensors_xx_schematic.png?1580170419)

# Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/087/715/medium800/sensors_xx_fab.png?1580170472)


## Primary Products

### Adafruit ICM-20649 Wide Range ±30g  ±4000dps 6-DoF IMU

[Adafruit ICM-20649 Wide Range ±30g  ±4000dps 6-DoF IMU](https://www.adafruit.com/product/4464)
Most accelerometers have a similar range of measurements that they can make: often around 2G - 16G. Similarly, most gyros can measure in the range of 250 degree/s to 2000 degrees/s. That's enough for many situations, however, there are many situations where it's not quite enough. When...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4464)
[Related Guides to the Product](https://learn.adafruit.com/products/4464/guides)

## Featured Products

### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets

[STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets](https://www.adafruit.com/product/4397)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium female headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4397)
[Related Guides to the Product](https://learn.adafruit.com/products/4397/guides)
### JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic

[JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic](https://www.adafruit.com/product/4398)
This cable will make it super easy to use our plug-and-play STEMMA QT boards with boards like Circuit Playground. On one end you get a Qwiic / STEMMA QT connector (technically known as a JST SH 4-pin plug)&nbsp; into 4 individual wires with grippy alligator clips. We're carrying these to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4398)
[Related Guides to the Product](https://learn.adafruit.com/products/4398/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### 4-pin JST PH to JST SH Cable - STEMMA to QT / Qwiic

[4-pin JST PH to JST SH Cable - STEMMA to QT / Qwiic](https://www.adafruit.com/product/4424)
Are you a maker in the midst of&nbsp;a [**STEMMA**](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma) dilemma? This 200mm long 4-wire cable is a fantastic chimera-cable fitted with **STEMMA QT / Sparkfun Qwiic JST SH** on one end,...

In Stock
[Buy Now](https://www.adafruit.com/product/4424)
[Related Guides to the Product](https://learn.adafruit.com/products/4424/guides)

## Related Guides

- [Adafruit SensorLab - Gyroscope Calibration](https://learn.adafruit.com/adafruit-sensorlab-gyroscope-calibration.md)
- [Adafruit TDK InvenSense ICM-20948 9-DoF IMU](https://learn.adafruit.com/adafruit-tdk-invensense-icm-20948-9-dof-imu.md)
- [Introducing the Adafruit Bluefruit LE SPI Friend](https://learn.adafruit.com/introducing-the-adafruit-bluefruit-spi-breakout.md)
- [4x4 Rotary Encoder MIDI Messenger](https://learn.adafruit.com/4x4-rotary-encoder-midi-messenger.md)
- [Adafruit QT 5V to 3V Shifter Breakout](https://learn.adafruit.com/adafruit-qt-5v-to-3v-shifter-breakout.md)
- [Trinkey True Random Number Generator](https://learn.adafruit.com/trinkey-qt2040-true-random-number-generator.md)
- [Adafruit TLV493 Triple-Axis Magnetometer](https://learn.adafruit.com/adafruit-tlv493-triple-axis-magnetometer.md)
- [Sound Sample Sweater](https://learn.adafruit.com/sound-sample-sweater.md)
- [Adafruit PMSA003I Air Quality Breakout](https://learn.adafruit.com/pmsa003i.md)
- [Adafruit STCC4 and SHT41 CO2, Temperature & Humidity Sensor](https://learn.adafruit.com/adafruit-stcc4-and-sht41-co2-temperature-humidity-sensor.md)
- [Adafruit Wiz5500 Ethernet Co-Processor Breakout Board](https://learn.adafruit.com/adafruit-wiz5500-ethernet-co-processor-breakout-board.md)
- [Flora-Powered TARDIS Costume (for Dogs!)](https://learn.adafruit.com/wearable-flora-powered-tardis-costume-dogs.md)
- [Adafruit Qwiik/STEMMA QT 5 Port Hub](https://learn.adafruit.com/qwiik-stemma-qt-5-port-hub.md)
- [Adafruit FONA 800 Shield](https://learn.adafruit.com/adafruit-fona-800-shield.md)
- [DIY Darksaber Build - 3D Print with PropMaker FeatherWing and BLE](https://learn.adafruit.com/ble-darksaber-propmaker.md)
