-1

I have 5x vl6180x pololu ToF sensors. I have managed to hook up all of the sensors to the arduino via I2C by making each sensor startup at different times and when they do, changing their addresses, but while I can quite easily read them, they take a very long time, 50ms - 300ms. I'm using the Pololu VL6180x library and when I've investigated the library, I couldn't find any delays in the code. I have also tried to change the clock rate of I2C to 400kHz, but that didn't seem to affect the speed. The datasheet of the sensors says that a sensor might take ~63ms to respond, but is there any way to make it faster? If not, can I read the sensors with the AtTiny13A and send the data from each chip to arduino? Which protocol should i use to communicate with them, if i want to read their measured distance?

Ps. I'm making a robot which needs to move fast and react quickly to each sensor. (11 of sensors in total, none, except ToF are I2C)

0

You can use startRangeContinuous and readRangeContinuous to have the sensor continuously measuring the distance, negating the need to wait for the sensor to do a measurement.

Using readRangeSingle will start a single measurement, and this function will just sit there waiting for the measurement to be done, after which it will return the result.

  • Well, i have just tried it out, it seems that the sensors speed barely changes(remains ~60ms when it doesn't see anything and ~20ms when it does) and it keeps crashing every 5 seconds, stopping me from reading it more. – PotatoMan Jun 7 at 15:45
  • @PotatoMan Maybe it's crashing because 400kHz is too fast for your setup. Is it on a breadboard? Those usually have a relatively high capacitance. If that's the case you could try to decrease your pullup's resistance. – Sim Son Jun 7 at 16:36
  • @SimSon I'm doing it all on a breadboard and tried it out with 10kHz to no avail, but nevertheless i can get a few raw readings and i can see, that, when reading those values, the timing still stays around 10ms - 60ms.. – PotatoMan Jun 7 at 17:37
  • 1
    Without seeing the code, I can't really help. – Gerben Jun 8 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.