Skip to content

copperpunk-arduino/icm-imu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

IcmImu

This is a simple demonstration of the ICM-20948 Digital Motion Processor (DMP), which is at the heart of the COPPERPUNK dual-GPS INS (https://github.com/copperpunk-arduino/icm-ins-dual-gps).

In order to run this code, you will need an ICM-20948 breakout board, available from Sparkfun or Adafruit. We're using the Sparkfun version for this example. In addition, you will want an Arduino board with an SAMD21 chip. If you want small and cheap, it's tough to beat the Adafruit QT Py SAMD21 Dev Board ($6!!), which is what we'll be using here.

Hardware Setup

The Qwiic Way

The easiest way to connect our hardware is using a Qwiic cable. This setup requires NO soldering.

The Robust Way

If you'd like something a little more permanant, simply solder the four connections required for I²C operation: 3.3V, GND, SDA, and SCL. The result is even more compact.

The Code

Now we'll need the Arduino ICM-20948 DMP library written by Eric Albers. Once you've installed that, the IcmImu sketch should be ready to run.

You'll notice that we use several .ino files when our code starts to get large. The Arduino IDE will separate these into different tabs automatically. They are named alphabetically to ensure they are placed in the same order every time.

You've got a few options in terms of output. In order to print debug messages, be sure that the following line is uncommented.

#define DEBUG

This sketch also has the ability to publish a data message (on a separate serial port) that adheres to the VectorNav binary protocol, essentially spoofing a VN-100 IMU (with much less capability, of course). If you don't have any need for this message, leave the following line commented out:

//#define PUBLISH_VN

You can adjust the data rate and publishing rate with the kImuIntervalMs and kPublishVnBinary1IntervalMs variables. And that's about it. We hope you enjoy your new IMU!

Contact Us

If you have any suggestions for improving this repository, there are a few ways to get in touch:

Releases

No releases published

Packages

No packages published

Languages