6

Light and Gryo Sensor Calibration

LightSensorExampleSome sensors need to be calibrated to make sure they work correctly. I’ve made an EV3 project to help my FIRST LEGO League teams calibrate their sensors and would like to make it available to all the kids out there doing FLL. Something similar was included with NXT for calibrating the light sensor, but the EV3 software is missing it, and I’d like to fill that gap.

The project file Calibration.ev3 includes two simple calibration programs. One to calibrate a gyro sensor and one to calibrate a light sensor (actually a color sensor used as a light sensor).

Gyro Sensor Calibration

Calibration is necessary for the gyro sensor because if the robot isn’t stationary when turned on or when the gyro is plugged in, the gyro may not understand what it means to be still. This can make the sensor value drift.

Gyro sensor calibration

How does it work?

  • The wait block makes sure your robot is completely stationary before calibrating. Do not touch the robot.
  • Toggling between “Rate” mode and “Angle” mode makes the gyro understand the current movement as “still”.
  • Wait a short time for calibration to complete.

Light (Color) Sensor Calibration

The light sensor may read different values depending on how bright or dark the room is. You’ll want to calibrate it any time the lighting might change to make sure it knows what values are “black” (0) and “white” (100).

calibratelight
Light sensor calibration

How does it work?

  • The program uses wait blocks to wait until you move the robot to the right place.
  • Then it takes a measurement and uses that value to calibrate the light sensor.
  • Since the sensor uses a raw value with a wide range, it is important to set both the bottom and the top of the range, which is why you need two measurements.

I hope that these programs will help students who are otherwise frightened by the challenges that come with using sensors that require calibration.

Download: Calibration.ev3

The following two tabs change content below.
Benjamin

Benjamin

Benjamin has been a mentor for FLL teams for 4 years. He enjoys programming and teaching, and currently works as an engineer at National Instruments.
Benjamin

Latest posts by Benjamin (see all)

2 thoughts on “Light and Gryo Sensor Calibration

  1. Apologies for being dense, the program is given so I think quite easy to set it up with the EV3 program but how to use it to calibrate?

    I know the in thing now is to let learner learn by doing but when he doesn’t know what to do, someone must help him along so I hope there will be someone willing

    1. Hi Peter, thanks for the feedback. Have you downloaded the attached *.ev3 file or are you just going off the screenshot? The project file includes instructions.

      I’ll amend the post to make this clearer.

Leave a Reply