SparkFun 9DoF Sensor Stick


The SparkFun 9DoF Sensor Stick is a low-cost, easy-to-use 9 Degrees of Freedom IMU. The Sensor Stick deftly utilizes the LSM9DS1 motion-sensing system-in-a-chip, the same IC used in the SparkFun 9DoF IMU Breakout. It houses a 3-axis accelerometer, 3-axis gyroscope, and 3-axis magnetometer – nine degrees of freedom (9DoF) in a single IC! For $15 and only four easy connections, the 9DoF sensor stick will provide angular velocity, acceleration and heading.

200
Sparkfun 9D0F Sensor Stick (CLICK image for purchasing options)

Sparkfun 9D0F Sensor Stick Data Sheet
Sparkfun 9D0F Sensor Stick Hookup Guide

Overview

This easy connectable IMU displays 9 different data points. Below is a graphic of exactly what this IMU produces: 3 acceleration channels, 3 angular rate channels, and 3 magnetic field channels. 800

Wiring

MBEDSensor Stick
VOUTVDD
GNDGND
Pin 10SCL
Pin 9SDA


The component produces nine pieces of data: acceleration in x/y/z, angular rotation in x/y/z, and magnetic force in x/y/z.

/media/uploads/TMDub88/screen_shot_2016-10-30_at_8.41.21_pm.jpg
Basic wiring of the Sparkfun Sensor Stick

WARNING!

Do NOT connect Vdd to 5V! The chip will be damaged.


Basic Hello World for the IMU using SerialPC

main.cpp

#include "mbed.h"
#include "LSM9DS1.h"
 
Serial pc(USBTX, USBRX);
 
int main() {
    LSM9DS1 imu(p9, p10, 0xD6, 0x3C);
    imu.begin();
    if (!imu.begin()) {
        pc.printf("Failed to communicate with LSM9DS1.\n");
    }
    imu.calibrate();
    while(1) {
        imu.readAccel();
        imu.readMag();
        imu.readGyro();
 
        pc.printf("gyro: %d %d %d\n\r", imu.gx, imu.gy, imu.gz);
        pc.printf("accel: %d %d %d\n\r", imu.ax, imu.ay, imu.az);
        pc.printf("mag: %d %d %d\n\n\r", imu.mx, imu.my, imu.mz);
        wait(1);
    }
}


The program above shows the acceleration, gyroscope, and the heading(magnetization) of the device. It uses the SerialPC ports to display the results. The program also uses the LSM9DS1.h library, which is the chip on the sensor stick.

Import programSparkfunSensorStickHelloWorld

Demo program of sparkfun's low cost 9DoF IMU


600
These are the results from the SparkfunSensorStickHelloWorld code. This is using coolTerm as the SerialPC GUI to view the output of the chip.

The video above is Sparkfun's demonstration of the 9DoF Sensor Stick.

NOTE: When connecting to the MBED, both sets of I2C ports can be used (p9/p10 and p27/p28). Just remember to change the pin numbers in the code when creating the IMU object. Also, this is a more cost effective breakout board compared to the LSM9DS1 breakout. The sensor stick provides the same data; however, there are more connectivity options including SPI on the other breakout board.


Please log in to post comments.