Did you know that the color sensor can measure more than just colors?
- 20 Feb 2019
- LEGO MINDSTORMS
- EV3, Programming, Light and Color Sensor
- М.Кирилов, A.Pavlov, D.Staykov, D.Simova, С.Матинян, M.Grozev, А.Бучков
In this lesson we are going to use the color sensor for detecting the amount of reflected light. In which cases and how would you use this setting?
Applications of the setting:
- If we put the sensor under the robot, it can tell us when the robot moves to a different surface of the same color
- We can use it to approximately measure the distance to an object/surface. The color sensor cannot replace the ultrasonic sensor, nor measure distance in centimeters. Nevertheless, it can tell us whether the robot is approaching or moving away from an object. The color sensor operates in a range from 1 to 5-6 centimeters – where the ultrasonic sensor cannot be applied.
- The robot could be programmed to use proportional line following or two state line following or we could just control where the robot follows the line.
How does this setting work?
You may already know that every object reflects some amount of light in order to be seen. The sun light and most of the interior lights contain many colors in them. Some objects absorb certain colors more than others and that defines their color. The light that isn’t absorbed is reflected, which is what our eyes see. For example, the green leaf of a flower is green because it absorbs all light except green and the green light repels and comes into our eyes. We can use the reflection to measure the percentage of the light that returns to the sensor.
The sensor has a light-emitting diode that sends out light to the object. The object absorbs some part of the light and reflects the rest. Darker objects absorb more light and lighter objects reflect more light. The sensor measures how much of the light is reflected and gives us a number from 0 to 100 percents which tells us whether an object is dark or light.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons