The Eye Sensor within the VEX 123 Robot allows the robot to detect both the presence of nearby objects and the color of that object. 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.
The sensor is located on the front of the robot.
Tip: For the most accuracy when using the Eye Sensor, avoid shadows, glare, or overly dim lighting.
Detecting Colors
The Eye Sensor can read the hue of the reflected light and can compare it against preset hue ranges to identify basic colors like red, green, or blue.
A hue is a number on the color wheel from 0–360 degrees that represents the type of color.
When you use a Coder Card like if red, if green, or if blue, 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.
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 it 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.
For the if bright Coder Card to activate, the object in front of the sensor needs to reflect at least 70% of the light. If the reflection is lower than that, it’s considered dark, and will instead work with the if dark Coder Card.
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 robot.
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 in Coder Cards like:
- drive until object – moves the robot forward until something is detected ahead.
- if object – runs a stack of cards if there’s something nearby.
- if no object – runs a stack only if nothing is in front of the sensor.