Any chance you could give a hint a the best way to read 3x separate MP-9250’s. I’ve been loving your guides and can’t wait for more.
I just need to be guided in the right direction.
One MPU-9250 will be the reference and the other two will be read and compared to the reference.
Thanks
dan
Hi Dan.
I don’t have a MPU-9250 to experiment with. So, I’m not sure if my advice will work.
There is a library from Sparkfun to interface with the MPU9250 and the Arduino.
I’m not sure if it works with the ESP32. However, there’s a fork of this library to make it compatible with the ESP32. It says it is a “work in progress”, so I’m not sure if it actually works. Here’s the library:
And the basic example: https://github.com/rupin/SparkFun_MPU-9250-DMP_Arduino_Library/blob/master/examples/MPU9250_Basic/MPU9250_Basic.ino
I’ve also found out another library that seems very easy to use. So, if it works I would go with this one:
Here’s a simple example: https://github.com/asukiaaa/MPU9250_asukiaaa/blob/master/examples/GetData/GetData.ino
I hope this helps.
Then, let me know if any of these libraries worked or if you found out another solution.
Regards,
Sara
I think a multiplexer will do the trick for multiple I2C devices. It would be great if you (or maybe you already have) done a tutorial on basic communication methods for various sensor modules.
Thanks for the help.
Hi Richard.
I think you can connect multiple I2C interfaces on the same I2C bus as long as they have different I2C address. But because you’re using the three equal sensors, they should have the same I2C address.
The ESP32 has two I2C buses, so you could control two at the same time.
To control 3, a multiplexer is probably the best solution. However, at the moment, we don’t have any tutorial about multiplexers.
The TCA9548A supports up to 8 I2C devices, so it can be a good module for your project: https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview
Regards,
Sara