What distance sensor would you reccomend?

Hi everyone,

Our team is currently designing a robot for the RoboCupJunior Rescue Maze competition, and we are looking for advice on choosing the right distance sensors for our navigation.

Our planned setup includes:

Microcontroller: Teensy 4.1
Sensor Layout: 4 sensors total (2 facing forward for alignment, 1 on the left side, and 1 on the right side)

We need sensors that are reliable and perform consistently regardless of ambient lighting or varying wall textures/colors.

Which sensors (e.g., specific Time-of-Flight or Ultrasonic models) have worked best for your teams using a Teensy? If you recommend I2C sensors, any tips on handling address conflicts or multiplexing would also be incredibly helpful.

Thank you for your advice!

Hi coolpixle,

We used a Raspberry Pi 5 and ran our distance sensors through I2C on that with a multiplexer. I’m not totally sure how the Teensy changes things; I’d be willing to share details on our setup if you think that would be helpful regardless.

Emma

Hi Emma,
We will be very happy to know which kind of sensors you used?

Hi coolpixle,

We used the Adafruit VL53L0X Time of Flight Distance Sensor with I2C. We handled the addresses with the Adafruit TCA9548A 1-to-8 I2C Multiplexer Breakout.

I found that the multiplexer was extremely easy to set up with the Pi and made it very straightforward to add additional I2C sensors (IMU, color sensor, etc.). It is very easy to use in code as well (we used Python).

As a general tip you can do i2cdetect -y 1 to check if you have something in the I2C bus. Sometimes if you get permission errors accessing the I2C ports, chmod can help (you might need sudo). I definitely dealt with my fair share of weird errors.

I will say that with these distance sensors we occasionally noticed that it wasn’t perfectly accurate, but they were what we had on hand and they did the job. It might be helpful if you have the time and resources to do some benchmarking with different distance sensors. We didn’t get to do that so I unfortunately don’t have much to say regarding personal experiences with the differences between ToF and Ultrasonic.

Hope this helps & good luck!
Emma

P.S. It does look like Adafruit has a better/newer version of the VL53L0X, however. So you might want to look into that. They also have one that’s shorter ranged and is more accurate at smaller distances but that longer range is probably more valuable.

I will look into that.
Thank you for your time!