This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MPU 9250 9-Axis and bmp280
#8
I very much admire your desire to learn! I've read the datasheet for the MPU9250 to understand the operation in pass through mode.

Firstly, if you try to follow the above instructions then you have lost nothing - everything is reversible.
The problems as I see it are:
1. You will have to write and maintain your own code specific for each sensor you wish to attach. That is the only way of extracting data from the remote sensor if you go that way. Furthermore the code will only be useful for the MPU9250 which is not a current device.
2. The BMP280 can provide three sets of data - pressure, temperature and, if required, altitude. The sample code above is reading just one piece of data (data = bus.read_byte_data(external_sensor_address, register_address). I do not know how you would say, write code to ask for temperature or temperature specifically, you would need to work out which register address to query if indeed it is possible.
3. Accessing the data from your BMP280 via your own code this way means that you can't just treat it like a normal I2C device where you just configure OpenPlotter with its address and define the data streams (e,g environment.outside.pressure etc) and after that Openplotter does all the hard work and makes that data available into SignalK. How do you get the data from your code into OpenPlotter? It's not impossible that's for sure but something else you would have to develop and maintain.

Connecting the SDA/SCL pins together of the BMP280 and MPU9250 directly to the Pi solves all of the above. Or get a sensor what has both the IMU and environmental sensor together. I use a Waveshare one with a MPU9255 and BMP280 on the same device.

I'd be delighted to know how you get on if you give this a go. For practical purposes, there is a very much simpler way to proceed but if it's the wish to learn you're after then go for it, I wish you the best of luck. Quite how useful in the future knowing how to code for an MPU9250 (a device that is already end of life since 2018) will be I don't know.

The external sensor option on the MPU9250 is really intended so that the remote sensor is managed from the MPU9250 by code specifically written for the MPU9250 rather than to make that remote sensor visible to a third device in this case the Pi. Pass through is probably OK but it looks a bit like a kludge to me but I am far from an expert.

When you crack it, send the data to OpenAI !

Best of luck


Edit: And don't forget that connecting them the way I suggested is exactly how the I2C bus was designed to work. UP to 128 devices can be accessed by your Pi/ESP32/whatever on the same SDA/SCL lines as long as they have different addresses of course. Why wouldn't you make use of that simple design feature?
Reply


Messages In This Thread
MPU 9250 9-Axis and bmp280 - by luchin0 - 2023-05-17, 03:37 PM
RE: MPU 9250 9-Axis and bmp280 - by baltika_no_9 - 2023-05-17, 04:30 PM
RE: MPU 9250 9-Axis and bmp280 - by luchin0 - 2023-05-17, 04:43 PM
RE: MPU 9250 9-Axis and bmp280 - by baltika_no_9 - 2023-05-17, 05:14 PM
RE: MPU 9250 9-Axis and bmp280 - by luchin0 - 2023-05-17, 06:01 PM
RE: MPU 9250 9-Axis and bmp280 - by luchin0 - 2023-05-24, 06:08 PM
RE: MPU 9250 9-Axis and bmp280 - by baltika_no_9 - 2023-05-24, 08:07 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)