Hardware Setup:
- 8× SparkFun Qwiic Mini dToF Imager (TMF8821)
- 1× SparkFun Qwiic Mux Breakout (TCA9548A) at address 0x70
- Testing on two platforms:
- Renesas RA6M5 (with micro-ROS/FreeRTOS)
- Arduino Seeeduino XIAO SAMD21
Goal:
Get 8 TMF8821 sensors working simultaneously at 10Hz measurement rate each through the Qwiic Mux.
Current Status & Problems:
On Renesas RA6M5:
- Successfully ported the TMF882X SDK with proper I2C shim layer
- Performance degrades significantly as sensors are added:
- 2 sensors: ~13Hz ✓
- 6 sensors: 4-6Hz (barely usable)
- 8 sensors: System freezes or <3Hz
- We’ve implemented proper I2C bus mutex (with FreeRTOS) for thread safety, mux settling delays (10ms), and staggered sensor polling
- I2C configured at 400kHz with proper timeout handling
- Note: We publish the readings through micro-ROS topic
On Arduino SAMD21:
- Single sensor works perfectly through multiplexer
- Cannot initialize 8 sensors - RAM overflow (region overflowed by ~54KB)
- Each
SparkFun_TMF882Xobject consumes ~7KB RAM - 8 sensors × 7KB = 56KB, but SAMD21 only has 32KB RAM
What We’ve Tried:
Verified hardware: Each sensor works individually
Proper mux channel switching with delays
I2C bus mutex (with FreeRTOS) for thread safety (Renesas)
Increased I2C timeouts (50ms → 500ms)
Reduced measurement rate (33ms → 100ms)
Added delays between sensor reads (5-10ms)
Checked power supply (USB 5V/2A - adequate for 8×57mA sensors)
Performance still degrades with >5 sensors on Renesas
Cannot test 8 sensors on Arduino due to RAM limitations
Questions:
-
Is there a working Arduino example for multiple TMF8821 sensors through a mux? The current library design seems incompatible with multi-sensor setups on RAM-constrained boards.
-
What’s the expected I2C bus load for 8 sensors? The TMF882X SDK makes ~15-20 I2C transactions per measurement per sensor. At 10Hz × 8 sensors, that’s ~1600 I2C transactions/second. Is this realistic on a shared I2C bus?
-
Are there recommended timing parameters for high-density TMF8821 deployments? (mux delays, I2C clock speed, polling intervals, etc.)
-
Has anyone successfully run 8+ TMF882X sensors simultaneously? If so, what platform and what configuration?
Any guidance would be greatly appreciated!
Additional Technical Details:
- I2C bus speed: 400kHz (tried 100kHz - worse performance)
- Mux settling delay: 10ms after channel switch
- Sensor measurement period: 100ms (10Hz target)
- All sensors configured for 3×3 zone mode (SPAD map 6)