Using TWO MiniMU-9 v3 Sensors

I’m trying to drive a camera towards a computed aim point. Thus I need to access two separate AHRS sensors (MiniMU-9 v3) in my project (i.e. current orientation versus desired orientation).

I easily got ONE sensor working and can access all axes. Now I want to read the other one, too, for a comparison, but I’m stuck.

I had hoped it was as simple as hooking them both up in parallel to the Arduino’s SDA and SCL ports, with one sensor’s sa0 driven LOW by physically wiring it to the Arduino’s GND. But I suspect it’s a bit more involved.

Even it the wiring is correct, I’m still a little lost as to how to specify each sensor in my code’s main loop.

Any help would be appreciated.

Thank you!

Hello.

The sensors on the v3 MinIMU-9s have a pin (SA0) for changing the sensor slave addresses, which allows for two MinIMUs to be on the same I²C bus. The MinIMU board connects the SA0 pins of its two ICs together, and pulls them all to VDD through a 10 kΩ resistor. You can drive the SA0 pin low to change the slave address.

In your code, you can distinguish the two sensors of each type by their different addresses. If you are using our LSM303 and L3G libraries, you can do that with arguments to the init function:

LSM303 compass1;
LSM303 compass2;
L3G gyro1;
L3G gyro2;

void setup() {
  compass1.init(LSM303::device_D, LSM303::sa0_high);
  compass2.init(LSM303::device_D, LSM303::sa0_low);
  gyro1.init(L3GD20_DEVICE, L3G_SA0_HIGH); 
  gyro2.init(L3GD20_DEVICE, L3G_SA0_LOW);
}

(Note the different syntax between the two libraries for the init functions; we hope to rewrite the L3G library to be more consistent with the LSM303 library soon.)

-Jon

Thank you so much, Jon!