Did you know that the color sensor can measure more than just colors?

To access the full video please subscribe to FLLCasts.com
- #1126
- 20 Feb 2019
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

Robotics with LEGO - Level 3.0 - Security systems
This is the fifth level of the Robotics with LEGO curriculum for students in fifth to twelfth grades.
In this level students will learn how to work with data measured by the sensors. The concept of Algorithm is introduced and the programs perform calculations without knowing the values beforehand. The programming blocks transfer data between each other via data wires. The robots are designed to address the problems of security systems. Variety of alarm systems are built and the physical principles of different security methods are considered.
- 50
- 1:03
- 213

Lesson 2 - Weighing security stand
Weighing plate, using weight change block
The sensor of the robot from the previous lesson was binary. This means there was only one state possible – either there is an object or there is no object. Therefore, it was very easy to press the plate, take the exhibit and put a stone instead. And the system could not detect us anyway. That is why now we have to think of something better in order to protect the valuable exhibits.
A clever solution is to have a robot which “senses” each change in weight. If the weight is greater, this will mean there is someone pressing the plate and the system should trigger the alarm. If the weight becomes lower, this will mean someone has stolen the exhibit and the alarm should also go off.
- 8
- 5
- 15
- 3d_rotation 1

Level C1. "Transportation". Robotics with LEGO
This is the fifth level in the Robotics with LEGO curriculum for students in third or fourth grade.
For the first time robots with steering wheels are built in this level. Those robots use one or two drive motors. The work of the differential and its usage in vehicles is explored. Students learn in-depth the working of the light sensor to create better line-following programs. The first two-wheeled motorcycle-robot is built.
- 33
- 1:03
- 110

Lesson 4 - Robotic car
Introduction
Every year, thousands of people die in car accidents. One possible solution is to use robotic cars, which will potentially lower the number of accidents caused by human error. The problem with robotic cars is that there isn't an easy way for them to navigate properly along the road.
How can robots navigate properly along the road? Would you travel in a robotic car?
In the next few lessons we will be using lines that the cars can follow along their road. Many people are scared to travel in robotic cars, because of the lack of control and sometimes technology can fail. That's why our goal is to make a car with no errors, so there would be no incidents with people.
- 3
- 3
- 10
- 3d_rotation 0

Robotics with LEGO - Level 2.0 - Robots in Factories
The third level of the Robotics with LEGO curriculum for students from fifth to twelfth grades.
Robots in this level use two or three sensors at a time and students create more complex programs for them. The work of the differential and its usage in vehicles with one drive motor is explored. Robots interact with each other and transfer information or material between themselves. Students learn in depth how to create smoother line-following programs. In the end of the workday, robots leave the conveyor belt and relax with a recreational game of volleyball.
- 44
- 15:01
- 129