I’m really new to both Raspberry and the whole electronics world: I’m experimenting with the board, using Windows IoT (since I’m quite familiar with C# as a development platform). I’m not, however, bound to this OS: I can switch to Raspian and see if I can play with Mono to use C# or change the language.

Anyway, for my project – after blinking LEDs for a while – I’d like to connect a sensor to detect positioning and later on a camera. As for the sensor, I noticed on Adafruit that they have a nice piece which includes accel/mag/gyro: they sell it as “for Arduino” and I’m not yet at the point where I can tell the difference what goes well with what.

Can I use this with Raspberry/Win? Do I have to revert to Raspian? Do I have to look for a completely different sensor?

Thank you!

2 Answers


The linked sensor appears to require special Arduino software to work as a useful device.

To get it to work you would either need to use an Arduino or port some pretty specialized code to the Raspberry Pi.

Unless you really need the claimed additional accuracy I would choose another sensor. Google 9DOF Raspberry Pi.

  • Thank you for pointing me in the right direction, I can find more info and tutorials now that I know that 9DOF or 9 degrees of freedom sensor is what I’m looking for. Something like this sparkfun.com/products/13944looks promising. I don’t have requirements in terms of accuracy, I need to start something, experimenting and see what happens. – ccalboni Nov 7 ’17 at 11:30
  • That should be fine, You just need to check it can be powered from 3V3 (rather than 5V). – joan Nov 7 ’17 at 12:01
  • Specs say “Operating Voltage: 3.3V”, should be fine with the Raspi pin 1 – ccalboni Nov 7 ’17 at 12:42


Question summary

[OP] new to Rpi and electronics, but quite familiar with Win C#

Now experimenting, but not bound to Win IoT

Can switch to Raspian Mono C# or even change language

Want to use sensor to detect position

Want to know if Adafruit accel/mag/gyro sensor for Arduino also for Rpi/Win?

Or should look for a different sensor?


The OP introduces his background, his objective, and asks a couple of questions.

His objective is clear: detect position using a sensor.

He is considering a couple of alternatives, but he is very flexible on OS, language, and sensor

I am more or less on the mirror side of the OP. I am quite familiar with electronics and have 10 years hobbyist experience in Arduino and Rpi. I am familiar with Python, but know very little Win C#.

I have decided to do some research, and see if I can give an answer, or part of an answer.

Since I have almost zero experience in gyro/accelero/magnetic sensors, I need to do quite a bit of research first. So I am starting to write random, unstructured research notes which would finally be deleted, and hopefully replaced by my answer.

Research Notes

What is 9DOF?

As titled, the OP wants to use 9DOF sensors. I don’t really know what the hell exactly is 9DOF. 🙂 So I googled and started reading the following article.

9dof – The highest quality sensors – xsens.com‎

I skimmed xsens but could not find what is 9DOF. I only made a summary.

Xsens PCB fuses the following:

  1. Attitude and Heading Reference System (AHRS),
  2. Vertical Reference Unit (VRU), and
  3. Inertial Measurement Unit (IMU) on PCB,

And produces the following output:

  1. Inertial data,
  2. Magneticic field,
  3. Free acceleration,
  4. Roll/pitch,
  5. Heading tracking,
  6. Referenced yaw

Almost all the above terms are new to me, though I guess output 5 “Heading tracking” should be important to avoid airplane crashing. 🙂

6/9 DOF, MEMS, IMU, Gyro/Accelero/Magneto sensor reading notes

I still don’t know what is 9-DOF. So I wikied the following to read. Finally I now know that 6-DOF is for mechanical (3 translation, 3 rotating), 3-DOF is for magnetic, adding together is 3 + 3 + 3 = 9 DOF. I found Wikipedia good. So I am reading more wiki articles.

And the summary of 6 degrees of freedom:

  1. Moving up and down (elevating/heaving)
  2. Moving left and right (strafing/swaying)
  3. Moving forward and backward (walking/surging)
  4. Swivels left and right (yawing)
  5. Tilts forward and backward (pitching)
  6. Pivots side to side (rolling)

Degrees of freedom (mechanics) (DOF) – Wikipedia

Microelectromechanical systems (MEMS) – Wikipedia

Inertial measurement unit (IMU) – Wikipedia

Gyroscope (Gyro) – Wikipedia

Accelerometer (Accelero) – Wikipedia

Magnetometer (Magneto) – Wikipedia

AdaFruit or SparkFun, That is the Question

The OP mentions AdaFruit but not SparkFun. I think one reason is that Adafruit is more friendly to everybody, but SparkFun more friendly to technical people. Anyway, I googled both and summarized below.

After considering many factors, my first choice is MPU9250.

AdaFruit Motion Sensors Catalog

Accelero – AXDL335, AXDL345, AXDL326, AXDL337, AXDL 343, LIS3DH, MMA8451

Gyro – L3GD20H,

9-DOF – BNO055, FXOS8700 + FXAS21002, L3GD20H + LSM303

10-DOF IMU – L3GD20H + LSM303 + BMP180

SparkFun Gyro/Accelero/Magneto

Triple Axis Accelerometer and Gyro Breakout – MPU-6050 $29.95

VR IMU Breakout – BNO080 (Qwiic) $34.95

SparkFun IMU Breakout – MPU-9250 $14.95

6-DOF IMU – ITG3200/ADXL345

6-DOF IMU – – ITG3200/ADXL345

Accelerometer – MMA8452Q $10.49 Accelerometer – ADXL335 $14.95

Accelerometer Breakout – LIS331 VR IMU (Qwiic) – BNO080 High Precision

SPX-14618 Qwiic IMU – MPU-9250 SPX-14896 – $148.00

Accelerometer, Gyro and IMU Buying Guide

Gyroscope Tutorial – SparkFun

Gyro Tutorial – AdaFruit

SparkFun Accelerometer and Gyro – MPU-6050 $29.95

SparkFun IMU Breakout – MPU-9250

MPU-9250 Hookup Guide – SparkFun

The OP’s AdaFruit 9DOF Consideration

The OP mentioned FXOS8700 which is not popular than MPU9250. I usually thing that more people googling means more popular. I know 6-DOF MPU6050 is more popular, but the vendor says MPU6050 is discontinued, and replaced by MPU9250.

FXOS8700 16,200 search results

MPU9250 409,000 search results

MPU6050 2,210,000 search results

After read SparkFun’s buying guide, MPU9250 is my final choice.

Now I am starting to read the SparkFun tutorials, then the datasheet.


The OP’s preferred language – C#

It is very likely that I will use Rpi Python 3.5.3 to test out MPU6250. I remember the OP is familiar with C#, but flexible to change language.

I am thinking of skimming through C#’s features and see if I can use its features in my python program.

As usual I wikied.

C#- Wikipedia

C# is a general-purpose, multi-paradigm programming language encompassing

strong typing,

lexically scoped,





object-oriented, and


programming disciplines.

It was developed around 2000 by Microsoft (.NET) and later approved as a standard by Ecma and ISO.

I once thought of trying C# in Rpi, using things like Mono, WinIoT etc. Just now I googled and found too many cons than pros. I also read the following article and very much agree with all the thing the author said. My quick and dirty conclusion is that for a lazy hobbyist like me, python is the only choice.

Python vs C#: Comparison of the Programming Languages – Jakub Protasiewicz 2018jul19

Guido van Rossum talked about useful type-annotation features in TypeScript, which have inspired similar features in Python

Arduino 9-DOF sensor for Arduino also good for Rpi

The OP asks if AdaFruit’s sensor ofr Rpi is also good for Rpi. My answer is YES. But the trouble is that AdaFruit almost always provide library, tutorial, and demo code for Arduino, but nothing for Rpi. What is worse is that Ada is switching from Arduino to CircuitPython which is not 100% compatible with Rpi.

So I would suggest the OP to consider SparkFun. SparkFun does not has any good support for Rpi either. So SparkFun in the OP’s case is the lesser evil, because SparkFun’s 9-DOF sensor seems better than AdaFruit.

So I am leaving AdaFruit altogether and start exploring SparkFun.

SparkFun MPU9250 Tutorials Also for Arduino Only, Nothing for Rpi

I skimmed SparkFun’s MPU9250 tutorials and software library and found them all for Arduino, so unhelpful for Rpi newbies. So I am leaving SparkFun as well. My plan is to first study the following references, then goggle for more help.

MPU-9250 Datasheet – Rev 1.0 2014 InvenSense

MPU-9250 Register Map – Rev 1.4 2013 InvenSense

MPU-9250 Breakout Schematic – Rev 10 2016 SparkFun

/ to continue, …

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: