Creative Commons images are CC BY 2.0

SparkFun 9DoF Razor IMU M0
project on project

by CharlieTheRobot

$ 49.95

Shipping outside of the US?

Click here for info

added to your
shopping cart

27 available 27 in stock
49.95 1+ units
47.45 10+ units
44.96 25+ units
42.46 100+ units
Need larger quantities?
Check out our Volume Sales program

Description: The SparkFun 9DoF Razor IMU M0 combines a SAMD21 microprocessor with an MPU-9250 9DoF (9 Degrees of Freedom) sensor to create a tiny, reprogrammable, multipurpose IMU (Inertial Measurement Unit). It can be programmed to monitor and log motion, transmit Euler angles over a serial port or even act as a step-counting pedometer.

The 9DoF Razor’s MPU-9250 features three 3-axis sensors—an accelerometer, gyroscope and magnetometer—that give it the ability to sense linear acceleration, angular rotation velocity and magnetic field vectors. The onboard microprocessor, Atmel’s SAMD21, is an Arduino-compatible, 32-bit ARM Cortex-M0+ microcontroller also featured on the Arduino Zero and SAMD21 Mini Breakout boards.

In addition to a pair of ICs, the 9DoF Razor IMU includes a µSD card socket, LiPo battery charger, power-control switch, and a host of I/O breakouts for project expansion. It comes preprogrammed with example firmware and an Arduino-compatible bootloader, so you can customize the firmware and flash new code over a USB connection.

Get Started with the 9DoF Razor IMU M0 Guide


  • Integrated MPU-9250 IMU and SAMD21 microprocessor
  • LiPo battery charger
  • µSD card socket
  • Preprogrammed example firmware that streams and/or logs:
    • Accelerometer, gyroscope and magnetometer data…
    • …and/or quaternions, and Euler angles
  • Arduino-programmable via USB
  • New MPU-9250 Arduino library with support for the chip’s digital motion processing capabilities
  • Extra SAMD21 pins broken out
  • System on/off switch


Recommended Products

Customer Comments

  • Anyone has a AHRS compatible firmware for it? I looked over here: but they only have support for older Razor boards.

    Any help is welcome!


  • With the example firmware, the Euler angle Yaw drifts by roughly 1 degree a second when subject to no motion. Is this experienced by others? I’ve seen it on 2/2 boards I have tested. Thanks!

    • What you’re seeing is a very common problem in orientation sensing. As I understand it, the built-in DMP is fusing only the gyro and accelerometer. The magnetometer must be used for stable orientation on all 3 axes, which is the art of 9-DOF sensor fusion. This and many other relevant issues are well described in this wiki.

      As strider points out, there was support for 9DOF fusion in the previous razor board’s library (which was in fact a fork from the repo by the author of that wiki), though it’s mysteriously absent from this new version… it would be great to see this added!

    • I just observed yaw angle after leaving the new razor imu on my table; what you say happens in my Razor as well. I think the angles we observe are estimated only from gyroscope and accelerometer data; if magnetometers are calibrated and included in the estimation, the heading values can be much better. It was better in the previous version of the Razor IMU, in the code written by Peter Bartz. In that code, Peter provided soft and hard iron calibration of magnetometers; the complementary filter used there was taking the magnetometer data into account in heading estimation.

  • I find that the pitch and roll angles don’t seem to be independent. I’m using the firmware from the hookup guide that lets you turn the Euler angles on and off with the ‘e’ command and while the yaw seems right, the others are confounded. If you rotate the board about the x axis, the y axis changes significantly as well and vice versa. But rotating about z (laying board on table and twisting) only affects the z axis. Any idea why this is? It’s not very useful if you can’t separate the axes…

  • Is the Atmel’s SAMD21 low-level ARM Cortex libraries compatible with Arduino Due’s AT91SAM3X8E micro-controller?

    I want to know if I can use this 9Dof IMU at full capabilities with the Arduino Due instead of Zero.

  • If I am using the DMP example I get a drift of one degree about every 3.5 minutes. I thought it odd because the old 9DOF Razor’s magnetometer compensated for the drifting. With a quick test I noticed that the magnetometer is not being used (putting a magnet nearby shows no change in the yaw).

    Is this by design? Looking at dmp.begin() arguments it appears there is no argument flag for using the magnetometer.

  • Does anyone understood what are the Euler angle axes and the sequence which is used (to decompose quaternions into eulers)? It is supposed to send (pitch, roll, yaw) but I do not get which are the axes of these rotations? Are the Euler axes the ones of the Accelero/Gyrometer? If yes, then it means that the angles which are send should be rotation around the Yaccelero (“Pitch”) , rotation around Xaccelero (“Roll”) and then rotation around Zaccelero (“Yaw”). And therefore the final posture of the board should be easily reconstructed by applying successively -in the correct order YXZ, these three rotations. Does anyone have any clues about this?

  • Hi, I’m trying to get this to send data over the pins marked TX and RX on the 8 pin header on this module. Any idea which Serial port it corresponds to. Nothing seems to be working other than the SerialUSB at the moment.

  • Sorry if this an amateur question, but is it possible to make this a wireless unit with a lipo and a Bluetooth or other such device? If so, what are the connections? Wanting to make a wireless head tracker for PC games like flying and driving.

    • You should definitely be able to do that. The connections will depend on what type of wireless you want to do and how. The easiest is probably a bluetooth/wifi module that you can connect over the hardware serial ports on the board. The other (and much trickier) option is to use the OTG feature on the board and connect a USB boothtooth/wifi dongle. In this case you will probably end up writing ‘drivers’ for it, but it is also possible someone has already done it. Look into the Simblee board, the ESP8266, nRF boards, and the Bluetooth Mate as a few cheaper wireless options. If you have any other questions feel free to email our techsupport department.

      • So using a Bluetooth Mate, its just as simple as

        Razor IMU Mo —-> Bluetooth Mate Silver GND —> GND 3v3 —> VCC TX —> RX RX —> TX

        What does the RTS 0 and CTS I get wired to? Are they needed? Would this then be wireless to a computer paired by Bluetooth using a USB mini module?



  • Driver installation on Windows 8.1 Pro doesn’t work. Driver is found but INF file doesn’t contain informations of numerique signature. Could you help me ? Edit: On Windows 10 Family, driver installation is not requiered ! Just plug and play. But I need to work with on my W8.1Pro. Windows says that you are the solution…

  • When I followed the hookup guide, and finished “Install Arduino SAMD Boards” section, first I tried to verify firmware code “_9DoF_Razor_M0_Firmware.ino” but Arduino displayed fatal error: sam.h: No such file or directory. Then I tried to verify and upload “MPU9250_Basic.ino” located at the SF MPU-9250 library. I obtained the same fatal error.. Did anybody face this problem when verifying and uploading code to Razor IMU?

    • Arduino’s latest versions of the SAMD board definition’s (1.6.9+) tripped a few things up with the 9DoF Razor’s board definitions. We just pushed a compatible update to the board manager.

      Update the “SparkFun SAMD Boards” core to 1.3.2 by following the same steps in the Installing the SparkFun Board Definition section of the tutorial, but instead of clicking “Install” click “Update”. That should fix it.

  • Any idea of the fastest sampling rate to the uSD card?

  • Congratulations on the new MPU-9250 library. :D

  • Wouldn’t have been better to have the sensor at the center point of the board? If this board is spun (about the mid-point of the mounting holes), the accelerometer and gyroscope sensors will show periodic variations, rather than a simpler 0 acceleration and pure rotational changes.

  • I’m curious, how does this compare to the Razor board it replaced? Obviously, it uses an ARM processor instead of the Atmel one but how about the sensor itself? It’s an all-in-one unit now but I’m curious if the old one may have any advantage over this one in any way or if this is better all around.

    • This board has a much better IMU sensor. The old one used 3 separate chips for accel, gyro, and mag, while this board uses the all in one MPU-9250 IMU. That alone makes it better, no issues with small misalignments, but also, the newer sensor is generally better; less noise and more sensitive.

Customer Reviews

No reviews yet.

Related Tutorials

9DoF Razor IMU M0 Hookup Guide

December 1, 2016

How to use and re-program the 9DoF Razor IMU M0, a combination of ATSAMD21 ARM Cortex-M0 microprocessor and MPU-9250 9DoF-in-a-chip.