The Eye Sensor, when attached to a VEX GO Robot, allows the robot to detect both the presence of nearby objects and the color of what’s in front of it. The sensor plays an important role in helping the robot make decisions based on what it “sees”—such as detecting a red marker, spotting an obstacle, or choosing which way to turn during an activity.
For the best results when using the Eye Sensor, try to avoid shadows, glare, or very dim lighting. You can also use the set eye light power block to adjust the brightness of the sensor’s built-in light. Increasing the brightness can help the sensor detect colors and reflectivity more clearly in dimmer lighting conditions.
Detecting Colors
A hue is a number on the color wheel from 0–360 degrees that represents the type of color.
When you use the eye found object block, the robot checks whether the hue reported by the Eye Sensor falls within a certain range for that color:
- Red: 340°–20°
- Green: 80°–145°
- Blue: 160°–250°
Note: If the hue falls outside of these ranges—even if it still looks like the intended color to the human eye—the project may not behave as expected. This can be mitigated by using the eye hue block and comparison operators (like greater than or less than) to create a custom range of hue values.
Detecting Light
In addition to detecting color, the Eye Sensor can also tell how much light is reflected off a surface. This helps the robot figure out whether something in front of the sensor is bright or dark. Bright surfaces, like white paper or light-colored objects, reflect more light. Dark surfaces, like black tape or areas in shadow, reflect less.
The brightness of an object can be determined by using the eye brightness block.
Detecting Objects
The Eye Sensor can also detect when something is physically close to the front of the robot. This is different from detecting color or brightness. Instead of measuring the color or how much light is reflected, the sensor checks whether an object is close enough to be considered “in front” of the sensor.
An object needs to be approximately 18 mm away from the sensor to be detected. Note that this value can be impacted by environmental factors like ambient lighting.
This kind of detection is used with the following blocks: