How to connect 2 ToF Sensors to a M5Stack Fire



  • Is it possible to connect 2 ToF sensors to the Fire ?
    As far as I understand the ToF sensors have all the same I2C adress and so it is not possible to connect more than 1 sensor.
    Or is there a way?
    regards
    K.D.



  • There is the unit PaHUB especially for this case:

    "If you want connect mutiple I2C slave devices and some of them may sharing the same address, this unit can resolve I2C address conflicts."

    https://docs.m5stack.com/#/en/unit/pahub



  • The I2C address of the VL53L0X can be changed by a software command. But this is only possible, if only one sensor is connected, because all sensors have the same address, when they are switched on.
    You can first connect one of the sensors and change the address of this sensor. Then you can connect the second sensor. Now you have two sensors with different addresses.
    Unfortunately the sensor forgets the changed address at a restart. Or more precisely, when it loses its supply voltage.
    I hope this helps.



  • If you are using a Grove ToF from Seeed there are pads to add a two pin header for the Xshutdown input and Interrupt output pins. You can use another GPIO to disable the first ToF while you program the second one to a different address. You do have to reprogram it every time you power up. Probably just easier to get the PaHUB.



  • Thank you for the answer.
    I will try the PaHub.

    K.D.