What is the best way to connect multiple sensors in parallel?
I have multiple IMU sensors and I want to connect all of them in parallel with esp32 via SPI (but not using a breadboard). I want to attach all of them in same line in a certain structure.
What is the best way to do that in an organized way because there are many wires?
Exactly what sensors? Supply a link. If these are open collector types (say TSOP3838) it is no problem. If these have a push/pull output or other interface then maybe diodes or other solutions are necessary.
That’s interesting…
Perhaps a sketch of how your mechanical assembly will appear.
If the sensors are aligned and mounted on the same axis, the only difference will be the rate of acceleration and speed.
These can be calculated from a single sensor ??
To me it looks like both MPU9250 and BMP280 on that GY-91 module can use either I2C or SPI. However, each device supports a maximum of 2 I2C addresses.
Probably the easiest way is to use SPI. This will, however, use a number of ESP32 pins.
For SPI, the SPI Clock, SPI MOSI and SPI MISO pins are a bus shared between all the modules. However the Chip Select Pins for the MPU9250 and for the BMP280 have to be unique.
In other words, for any number of modules, you need 3 pins plus, for each module, 2 additional pins.
There may be some tricks for reducing the number of pins.
I know the connections, and I programmed the sensors via SPI, now i am searching about a method how to align and mountain all the sensors on the same axis in an organized way.
"In other words, for any number of modules, you need 3 pins plus, for each module, 2 additional pins."
Three lines are bused to each module, CLK, MOSI, MISO, but each module needs 1 select not 2. To save pins the selects can be generated with a multiplexer device such as a 74HC138 or 74HC154. Not knowing what the hardware is you may need a different device and or with inverted outputs.
Are you sure?
Each GY-91 module contains two entirely separate SPI devices a MPU9250 and a BMP280. The GY-91 breaks out two CS pins, one for each of the two SPI devices. Having said that, the MPU9250 appears to have rich configuration options and could possibly handle the BMP280 as a its own slave.
Posting a link to technical information on the module will help. The unit I found does not even have 2 SPI buses but has an additional I2C bus. That indicates you can use either as I do not have documentation on your unit.