ICM20948 9DOF IMU on RaspberryPi4B

Introduction

In the previous post I looked at using the ICM20948 9DOF IMU with Arduino Uno (Ref.1). In this post I examine the IMU with RaspberryPi4B using Python. In order to test the IMU, I am using a protoboard with on board voltage regulator (Ref.2).

The ICM20948 contains two dies on a 3x3mm package: an Invensense MEMS 3×3 Gyro & 3×3 Accelerometer + Asahi Kasei 3×3 Magnetometer + Temperature Sensor + DMP Digital Motion Processor (Ref.3)

RaspberryPi4B to ICM20948 Connection

Fig.1 ICM20948 Proto Board Ref.2
Fig.2 RaspberryPi4B to ICM20948 Proto Board Wiring Schematic
Fig.3 ICM20948 Axes Orientation for Gyro/Acc & Magnetommeter (Ref.3)

Figure 1 shows the ICM20948 protoboard with the I2C connections on the LHS (Ref.2). Figure 2 shows the I2C wiring with a RaspberryPi4B. Note the chip orientation with pin 1 in the south west corner. Figure 3 shows the orientation of the axes for the Gyro+Acc. & Magnetometer (Ref.3). The X & Y marked on the PCB are for the Magnetometer.

Python Docs

Fig.4 Python Installation Docs for RaspberryPi (Ref.4)
Fig.5 Output of Python Basics File Giving Acc_xyz, Gyro_xyz & Mag_xyz

Figure 4 shows the File Manager in the RaspberryPi4B desktop. I am using the Adafruit Python Documents as given in Ref.4. I first created a project folder “icm20948” in my home directory/Documents. Then I created a virtual environment “.venv” and installed the Adafruit Python Documents. Using the Thony Editor, I created a Python file using the basic commands listed “icm20948_basics.py”. Figure 5 shows the output of this file when run giving the Acc/Gyro/Mag readings.

Fig.6 YouTube Video ICM20948 9DOF IMU on RaspberryPi4B

Please send your comments, questions and suggestions to:
contact:

YouTube Channel
YouTube Channel

References

#1. – “ICM20948 9DOF IMU on Arduino Uno”
https://jeremyclark.ca/wp/nav/icm20948-9dof-imu-on-arduino-uno/

#2. – “SparkFun Sen-15335 ICM20948 Protoboard”
https://www.sparkfun.com/sparkfun-9dof-imu-breakout-icm-20948-qwiic.html

#3. – “ISM20948 Data Sheet”
https://invensense.tdk.com/download-pdf/icm-20948-datasheet/

#4. – “Adafruit Python Docs Installation RaspberryPi”
https://docs.circuitpython.org/projects/icm20x/en/latest/

By Jeremy Clark

Jeremy Clark is a Senior Telecommunications Engineer and Advanced Amateur Radio Operator VE3PKC. He is the author of E-Books on Telecommunications, Navigation & Electronics.