Range Sensor

The REV Color/Range sensor is a very versatile device used in robotics, particularly in FTC. It combines both color sensing and proximity detection capabilities.

This section will cover the proximity detection aspect of the sensor. The distance sensor works by bouncing infrared light off an object and using the time between sending and receiving the light to calculate the distance between the sensor and the object.

The distance sensor is useful for both object detection and obstacle avoidance. The distance sensor can indicate if an obstacle is close or not to the robot, allowing for the robot to react accordingly. The range sensor can also be attached to the intake of the robot, allowing the robot to sense if an object has been collected or not.

Using the sensor is easy. Simply use the block getDistance

to determine the distance of the closest object in front of the distance sensor. You can select the units the distance is recorded in.

This is often used in logic statements to check if the robot has encountered an obstacle. For example, if the range sensor detects if there is an object within 20cm from the front of the robot, the robot will move backwards for 1 second.

Putting this within a for loop for continuous detection

You get a simple anti collision algorithm!

The range sensor can prove to have numerous uses if you are creative! Several examples are present in this book. Feel free to experiment.