Daisy chaining motion sensors with PiicoDev

Hi there,

I have a project where I would like to use around 30 motion sensors connected to one Raspberry Pi. Looking at the PiicoDev Motion Sensor board for this.

Since they only have 2 available addresses, but can daisy chain, I’m wondering if through a multiplexer setup I would be able to daisy chain all 30 sensors. And if that can’t work, how can I interface this many sensors together? I’d like them to all be through one host (either Raspberry Pi or Arduino, but preference is the pi) since timing synchronisation is paramount to the project.

Could someone please provide a diagram to indicate how to set this up, and how the addresses are selected? This board: SparkFun Qwiic Mux Breakout - 8 Channel (TCA9548A) can handle up to 64 addresses. How could this be implemented?

Thanks for your help

4 Likes

Hey @Luke140868, this sounds like a rad project.

There are a couple ways I can think of you could go about solving this problem.

Option 1: using 4x MUX
Dedicate a bus from each mux to handle one distance sensor. This is probably the simplest, flattest way to do it using off the shelf parts that connect easily.
Since our PiicoDev module is compatible with SparkFun’s VL53L1X board, any example code they have for using their Qwiic Mux Breakout should work with our own Distance Sensor. In SparkFun’s guide it appears that they have working Arduino and Python drivers for their mux.

Here each mux would need to have a unique address selected by soldering a combination of these jumpers. For example, with 4 muxes you would leave jumpers open on the first, solder 0 on the second, solder 1 on the third and solder 0+1 on the fourth.

Option 2 Changing device addresses
It is possible to program a new address into a VL53L1X. From what I gather the address needs to be set, and then the device restarted by toggling the SHuTdown pin. The only gotcha is that I don’t think the address changes are persistent between power cycles, so you would need to contrive a way to reprogram the address of each device, on each new powerup. This would amount to having a dedicated wire for every SHT pin on every distance sensor module…
For more information on that topic, there’s a GitHub issue on SparkFun’s repo

5 Likes

Thanks Michael, this is great info. Could I expand on this by daisy chaining two sensors on each mux bus? Trying to limit the number of cables that will be physically alongside one another.

Would that work with option 1 or would it require a reprogramming (which I will gladly avoid doing :slightly_smiling_face:)

And would there be any issues you can foresee with powering this many devices from the raspberry pi?

In case you’re wondering what the project is, I’m trying to create a mimic rokoko mocap suit, that hopefully won’t cost me $5000. Theirs uses 19 inertial sensors, I’m hoping I can achieve some crappy results with 30 odd motion sensors and a morph suit. Wish me luck haha

4 Likes

Just googled this and that sounds sick! Please share your results with the forum.

4 Likes

Apologies Luke! Some reason I had the distance sensor in mind, but you’re talking about the motion sensor! Yes, the motion sensors could be daisy chained 2x per bus as below, where one out of every pair has its address jumper soldered.

It looks like the Mux example SparkFun provides is pretty flexible. They use it with a different accelerometer. I know SparkFun have a MPU-6050 arduino library, so it should be pretty easy to modify that Mux example for using the MPU-6050 found on a PiicoDev Motion Sensor.

The Raspberry Pi can supply a few hundred milliamp at 3.3V, which should be plenty for the system. You could take a belt-and-braces approach and include a regulator to step the Pi’s 5V supply down to 3.3V if you have concerns.

Things get tricky when you scale them… I look forward to seeing how this project comes together :smiley: Consider writing up your progress on our projects page.

ps. if your controller has two or more hardware I2C buses available, you might find you can increase your sample frequency, since both buses can operate simultaneously. eg. dedicate one bus per mux as below

6 Likes

Will do!

2 Likes

Thanks Michael, super helpful yet again. Gives me a bit to get started with, so I’ll check back in here once I get going on it.

I am expecting this, so expect me to lean on this forum when I hit that bit haha :slight_smile:

Will do.

4 Likes