EV3 Light calibration is to teach our robot’s color sensor what color is black and what color is white.
Why do we need to calibrate the color sensor? Depending on the time of the day like the morning or afternoon, or different places, like where we practice or the competition stadium, the light sensor’s inputs are different depending on the light in that area. We use the light sensor for line following and line detection. The different reads for the dark and light make the line following and detection inconsistently in different environments. The light calibration’s purpose is to adjust the color sensor to the different conditions of the environment.
EV3 Light Sensor Block
We use the Color Sensor Block’s calibration mode to calibrate the light sensor. According to the online help, there are three calibration modes:
- Calibrate Minimum: to specify the minimum light intensity (black color)
- Calibrate Maximum: to specify the maximum light intensity (white color)
- Calibrate Reset: to restore the Color Sensor calibration to its default state
The following image shows the color sensor calibration modes.
EV3 Light Calibration Program
The logic for the light calibration is as follows:
- Reset the light sensor’s calibration
- Read the light reflection intensity for the black line
- Set the above values to the minimum
- Read the light reflection intensity for the white line
- Set the above values to maximum
The following image shows the EV3 Light Calibration program. As you can find, we added text displays and confirmation tune for black/white selection and completion of calibration.
Using the Light Calibration Program
We use the light calibration program before we start any mission programs. If the surroundings haven’t changed, we don’t repeat the light calibration before running mission programs.
If there’s 2 or more Color Sensors, the same calibration will apply to all sensors. There is no need to make a different calibration program for each color sensor.