1

I'm currently working on a rough VR system using the Raspberry Pi 3, and, of course, for that, I need a way to track the custom headset and controllers. I need the sensors to be compatible with Python 3, so that I can track them in 3D space.

Does anyone have any recommendations on any sensors like this?

ringMaster
  • 21
  • 2
  • I have been playing with ADXL345 and found it newbie friendly, comparing to MPU6050: (1) https://raspberrypi.stackexchange.com/questions/102041/cant-use-my-raspberry-pi-3-b-for-i2c-in-high-speed-mode, (2) (2) https://raspberrypi.stackexchange.com/questions/105071/i2c-mpu9250-gyro-accelero-magneto-9-dof-sensor-micropython-programming-problem

    (3) https://raspberrypi.stackexchange.com/questions/101095/rpi4b-buster-circuitpython-blinka-servo-board-installation-problem / to continue, ...

    – tlfong01 Jan 06 '20 at 01:40
  • (4) https://raspberrypi.stackexchange.com/questions/74865/adafruit-9-dof-or-other-accelerometer-magnetometer-gyroscope-sensor-for-raspberr. BTW. Rpi3B+ cannot change the flat I2C 100kHz rate. This is a problem because smBus cannot do Rpi3B+ cannot change the flat I2C 100kHz rate. This is a problem because smBus cannot do cycle stretching, and must lower I2C speed to 50k or even 10Bd. In other words, you might need to upgrade to Rpi4B to play with MPU6050/9260. That is the reason I follow MagPi 84 Page 45 recommendation on lowering the I2C speed. – tlfong01 Jan 06 '20 at 01:50
  • But then I found Bosch BNO055 even better, because there IMU staff is more open than Inversense. So my advice to newbie with a long plan, to try both MPU6050 and ADXL345 and make up your mind later. – tlfong01 Jan 06 '20 at 01:50
  • One more reason I prefer ADXL345 over MPU6050 is that ADXL345 is 3-DOF, while MPU6050 is 6-DOF. Actually both have a rather steep learning curve for newbies. I have a ADXL345 working testing program in python and happy to post it here for sharing, in case you are going into ADXL345. And another reason is that you can easily upgrade ADXL345 to industrial grade ADXL355, without changing software. – tlfong01 Jan 06 '20 at 02:14
  • More references here: (1) MPU6050 i2cdetect: https://imgur.com/gallery/6gNrOJe

    (2) MPU6050 forum posts (with schematic and tutorials): https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=234304&hilit=mpu6050+tlfong01#p1440890

    (3) MPU6050 forum posts: https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=234304&hilit=mpu6050+tlfong01#p1440912

    (4) MPU6050 forum posts:https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=234304&hilit=mpu6050+tlfong01#p1440912. Happy sensing and cheers! :)

    – tlfong01 Jan 06 '20 at 02:23
  • I have more mpu6050 (also MPU9250 which is not recommend to those faint of heart newbies) posts in other forums, including AAC (All About Circuits) projects (https://forum.allaboutcircuits.com/forums/the-projects-forum.6/). I need to do some searching, in case you wish to have more references at the hardware circuit level. – tlfong01 Jan 06 '20 at 02:28
  • ADXL345 3-DOF Accelerometer is perhaps easier than 6-DOF MPU6050, the initial setup and testing is quite tedious. I have tested OK both the SPI and I2C and built up basic functions for future development. You may like to skim my programming record to get t feeling of the complexity. The penzu record actually includes basic API and I2C setup and testing record, useful for debugging. The ADXL345 related functions and output samples are HIGHLIGHTED IN BRIGHT RED, so you can just pay attention to those highlighted sections: https://penzu.com/p/926a24f6. Feel free to ask me any newbie questions. – tlfong01 Jan 06 '20 at 06:51

1 Answers1

1

The MPU-6050 is a great choice.
enter image description here
To use it on Raspberry Pi 3, you need a python module. Follow instructions:

1. install the python-smbus package

sudo apt install python3-smbus

2. Install this package from PyPi repository

pip install mpu6050-raspberrypi  

If you find a problem, post an issue here.

M. Rostami
  • 4,323
  • 1
  • 17
  • 36