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?
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.
[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.
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.
I skimmed xsens but could not find what is 9DOF. I only made a summary.
Xsens PCB fuses the following:
- Attitude and Heading Reference System (AHRS),
- Vertical Reference Unit (VRU), and
- Inertial Measurement Unit (IMU) on PCB,
And produces the following output:
- Inertial data,
- Magneticic field,
- Free acceleration,
- Heading tracking,
- 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:
- Moving up and down (elevating/heaving)
- Moving left and right (strafing/swaying)
- Moving forward and backward (walking/surging)
- Swivels left and right (yawing)
- Tilts forward and backward (pitching)
- Pivots side to side (rolling)
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.
Accelero – AXDL335, AXDL345, AXDL326, AXDL337, AXDL 343, LIS3DH, MMA8451
Gyro – L3GD20H,
9-DOF – BNO055, FXOS8700 + FXAS21002, L3GD20H + LSM303
10-DOF IMU – L3GD20H + LSM303 + BMP180
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
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# is a general-purpose, multi-paradigm programming language encompassing
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.
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.
/ to continue, …