Multiple MinIMU-9 v2 on Arduino Due

Hello, jondoe.

There is a problem with the autodetect functions on the Due, but you can work around it by just specifying the device and SA0 state manually (e.g. compass.init(LSM303::device_LSM303DLM, LSM303::sa0_high) instead of just compass.init()).

Back to your first question…

Our existing libraries are written to use the Arduino Wire object, which corresponds to the first I2C bus on the Due and the only I2C bus on most other Arduinos. You might be able to get a second instance of both sensors working by making copies of the L3G and LSM303 libraries and changing them to use Wire1 instead (it sounds like this is what the original poster in this thread did). However, like you said, even this will only allow you to use only 2 IMUs on one Due.

If you really need to use 5 or 6 MinIMUs, here are some ideas:

  • Use an I2C multiplexer (though we haven’t tried this before).
  • Instead of having a single microcontroller handle all of the IMUs, have a separate microcontroller take care of each IMU and then process and report the results to a central master microcontroller that runs the whole system.
  • Use SPI. Although none of our MinIMUs support SPI, you could use our new L3GD20H and LSM303D carriers separately (note that some of the older LSM303s don’t support SPI). With SPI, you use a separate CS (chip select, sometimes called SS, or slave select) line for each chip to tell it when you’re talking to it, which avoids the problem of address conflicts. However, we don’t provide SPI libraries for interfacing with our inertial sensors, so you would have to implement the SPI communication yourself.

- Kevin