Addressing a digital compass sensor on multiple GrovePis

I have stacked two GrovePi’s to equip both with a HMC5883L digital compass. The GrovePi’s have numbers 04 and 06.
The big question is how to address the two sensors on the separate GrovePi’s, given that the sensor address itself is hardwired. I am using the Python

Thanks for any suggestions. Martin

Hi @martin.kersten,

The sensor that you are using is an I2C sensor and though they are connected to different GrovePi all of them share the same bus. Hence you can use multiple of these sensors only when you can change the addresses of the sensors. Looking at the datasheet of HMC5883 it looks like this chip supports only one I2C address, hence you cannot use multiple of these sensors.

You can try using this sensor, which supports two addresses, but you will have to solder a jumper on one of the sensors to change its default address to a different address.

Please let us know if this helps,

Thanks for the information.