Reading Multiple Sensors via a Multiplexer

We can now successfully read data from multiple sensors via an Adafruit Multiplexer using Python code. The multiplexer is connected to the  I2C pins on the Raspberry Pi and provides for communication to up to 8 I2C sensors/components on the same I2C bus.  One of the main roles of multiplexer is to ensure that there is no conflict between I2C sensors that have the same address on the I2C bus.

The picture at the top of this post is that of the test rig that we used to proved this for us, using a ToF sensor and the 6DoF. Granted, it's a veritable spaghetti junction of wires... but that's test rigs for you!

The sensors can be seen in the image dangling down in front of our test rig, plugged into the Pimoroni Breakout Garden Extender connectors, touching the carpet.

The Adafruit multiplexer is the board with pins sticking up on the right of the picture, sitting atop the chassis, held in place by a rubber band, Heath-Robinson style.

If you look really hard, you might also spy an early use of an electrical connector strip (chocolate block) to share the Raspberry Pi's 5V power rail GPIO pins at the other end of the chassis. More on wiring looms in a later blog post.

comments powered by Disqus