Light and Gyro Sensor Calibration

Jan 2017
LightSensorExample

Some 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

Related Articles

Up Arrow
FEEDBACK
Up Arrow