Learn 4: Experiment With Color Sensing

This is the fifth challenge within the Robotics with GoPiGo and Python Curriculum.

Your task is to design a robot program to deliver a selection of mail to the residents of GoPiGo Drive, a small cul-de-sac containing 3 houses.

Learn how to how to use and calibrate the color sensor.

4. Calibrating the Color Sensor

          • Place the robot on top of the printed color calibration sheet with the color sensor above the red square, exactly as we did when we tested the sensor.
          • Click on the Calibrate Color Sensor button.

We have told the robot the order of the color samples on that sheet. Armed with that knowledge it will calibrate its color sensor as follows:

      1. based on its sensor reading, light up its right eye the color that it thinks it has seen
      2. re-calibrate its settings for that color to match the sensor readings
      3. light up the left eye to confirm the color that it has just re-calibrated
      4. drive forward to the next color sample on the sheet and repeat 1-3 above

Once it has completed color calibration, the eyes will flash on and off.

What we are doing here is replacing the pre-defined default settings for each color with the red, green, blue and clear values read in the current environment.

After calibration has been completed, check the sensor accuracy by re-running the calibration. You should notice that the robot’s guesses (right eye color) will now match the confirmed color samples (left eye color).

Tags: