I have an Arduino Nano Clone connected to 16 VL53L0X sensor modules.
A 11.1V LiPo battery is connected to 7809, the output of which goes parallely into the Vin of the Nano and a 7805. The 7805 output is then connected to the power pins of all the 16 sensors. All the GND pins are common.
The SCL(A5) and SDA(A4) pins of the Nano are pulled up via 4k7 resistors connected to the Nano's 5V pin.
I am using the Pololu VL53L0X library GitHub - pololu/vl53l0x-arduino: Pololu Arduino library for VL53L0X time-of-flight distance sensor and the code inspired from https://forum.pololu.com/t/vl53l0x-maximum-sensors-on-i2c-arduino-bus/10845/7 and every time I run the code with 16 sensors the i2c hangs on the Wire.endTransmission() in the writeReg function, when setting up different addresses for each sensor.
I then carefully unplugged sensors from the circuit one by one. As soon as there were only 12 sensors left the code started to run perfectly and completed the execution of setting addresses. After which I ran the i2c scanner code I2CScanner: Arduino as I2C bus scanner – todbot blog and found only 9 of those 12 devices responded.
I have gone through these topics and checked every possible error I could from them but its not changing the end result.
https://forum.arduino.cc/index.php?topic=575006.0
https://forum.arduino.cc/index.php?topic=529027.0
https://forum.arduino.cc/index.php?topic=547735.0
https://forum.arduino.cc/index.php?topic=124286.0
https://forum.arduino.cc/index.php?topic=256630.0
https://forum.arduino.cc/index.php?topic=461237.0
https://forum.arduino.cc/index.php?topic=243653.0
https://forum.arduino.cc/index.php?topic=516227.0
My doubts are:
Could this be because the sensors are not getting enough current if somehow Nano is drawing most of the current from 7809 which leaves less current for the 7805 and hence the sensors?
Why would only 9 sensors be detected out of 12 by the i2c scanner? I don't have additional sensors to be able to replace them with and check the issue so before I buy more of these i'd like to know if maybe someone has faced a similar issue.
Could the problem be solved by changing the pololu library or the code in some way?