Inspiring Mindstorms EV3 Programming for FLL Part 10: EV3 Light Calibration

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.

We use the Color Sensor Block’s calibration mode to calibrate the light sensor. According to the online help, there are three calibration modes:

  1. Calibrate Minimum: to specify the minimum light intensity (black color)
  2. Calibrate Maximum: to specify the maximum light intensity (white color)
  3. Calibrate Reset: to restore the Color Sensor calibration to its default state

The following image shows the color sensor calibration modes.

Light Sensor Calibration Mode
Light Sensor Calibration Mode

EV3 Light Calibration Program

The logic for the light calibration is as follows:

  1.  Reset the light sensor’s calibration
  2.  Read the light reflection intensity for the black line
  3. Set the above values to the minimum
  4. Read the light reflection intensity for the white line
  5. 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.

EV3 Light Calibration Program
EV3 Light Calibration Program

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.