SummaryStudent groups are challenged to program robots with color sensors to follow a black line. Learning both the logic and skills behind programming robots for this challenge helps students improve their understanding of how robots "think" and widens their appreciation for the complexity involved in programming LEGO® MINDSTORMS® EV3 robots to do what appears to be a simple task. They test their ideas for approaches to solve the problem and ultimately learn a (provided) working programming solution. They think of real-world applications for line-follower robots that use sensor input. A PowerPoint® presentation and pre/post quizzes are provided.
Engineers incorporate sensors into machines in order to make them perform complex, precise and/or tedious tasks. For example, engineers who work for car manufacturers design robots that paint car parts, such as car bodies, hoods and doors. To achieve an even coat of paint, these robots must maintain a consistent distance between the paint applicator and the part. The robots use sensors to determine the distance between the paint applicator and the surface to be painted. The line-follower concept shown in this activity has applications for running mass transit systems and autonomous cars on highways, as well to deliver mail in office buildings, move items through factory assembly lines, and deliver medications in hospitals.
Complete the previous units (1-4) and the earlier lessons and activities of unit 5 prior to this activity.
After this activity, students should be able to:
- Explain how a color sensor works.
- Develop and explain the logic behind programs that instruct robots to use color sensor readings to make decisions.
More Curriculum Like This
Students learn more about how color sensors work, reinforcing their similarities to the human sense of sight. This lesson and its associated activity enable students to gain a deeper understanding of how robots can take sensor input and use it to make decisions via programming.
Building on the programming basics learned so far in the unit, students next learn how to program using sensors rather than by specifying exact durations. Working with the LEGO® MINDSTORMS® EV3 robots and software, they learn about wait blocks and how to use them in conjunction with move blocks set ...
Students learn about how ultrasonic sensors work, reinforcing the connection between this sensor and how humans, bats and dolphins estimate distance. They learn the echolocation process—sound waves transmitted, bounced back and received, with the time difference used to calculate the distance of obj...
Students learn about how touch sensors work, while reinforcing their similarities to the human sense of touch. They look at human senses and their electronic imitators, with special focus on the nervous system, skin and touch sensors.
Each TeachEngineering lesson or activity is correlated to one or more K-12 science,
technology, engineering or math (STEM) educational standards.
All 100,000+ K-12 STEM standards covered in TeachEngineering are collected, maintained and packaged by the Achievement Standards Network (ASN),
a project of D2L (www.achievementstandards.org).
In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics;
within type by subtype, then by grade, etc.
Each TeachEngineering lesson or activity is correlated to one or more K-12 science, technology, engineering or math (STEM) educational standards.
All 100,000+ K-12 STEM standards covered in TeachEngineering are collected, maintained and packaged by the Achievement Standards Network (ASN), a project of D2L (www.achievementstandards.org).
In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics; within type by subtype, then by grade, etc.
- Define a simple design problem reflecting a need or a want that includes specified criteria for success and constraints on materials, time, or cost. (Grades 3 - 5) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Generate and compare multiple possible solutions to a problem based on how well each is likely to meet the criteria and constraints of the problem. (Grades 3 - 5) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Plan and carry out fair tests in which variables are controlled and failure points are considered to identify aspects of a model or prototype that can be improved. (Grades 3 - 5) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Define the criteria and constraints of a design problem with sufficient precision to ensure a successful solution, taking into account relevant scientific principles and potential impacts on people and the natural environment that may limit possible solutions. (Grades 6 - 8) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Evaluate competing design solutions using a systematic process to determine how well they meet the criteria and constraints of the problem. (Grades 6 - 8) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Analyze data from tests to determine similarities and differences among several design solutions to identify the best characteristics of each that can be combined into a new solution to better meet the criteria for success. (Grades 6 - 8) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Develop a model to generate data for iterative testing and modification of a proposed object, tool, or process such that an optimal design can be achieved. (Grades 6 - 8) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Students will develop an understanding of the characteristics and scope of technology. (Grades K - 12) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Students will develop an understanding of the relationships among technologies and the connections between technology and other fields of study. (Grades K - 12) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Students will develop an understanding of the attributes of design. (Grades K - 12) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
- Students will develop abilities to apply the design process. (Grades K - 12) Details... View more aligned curriculum... Do you agree with this alignment? Thanks for your feedback!
Each group needs:
- LEGO MINDSTORMS EV3 robot, such as EV3 Core Set (5003400) for $389.95 at https://education.lego.com/en-us/products/lego-mindstorms-education-EV3-core-set-/5003400
- LEGO MINDSTORMS Education EV3 Software 1.2.1, free online, you have to register a LEGO account first; at https://www.lego.com/en-us/mindstorms/downloads/download-software
- computer, loaded with EV3 1.2.1 software
- Line-Follower Challenge Pre-Quiz, one per student
- Line-Follower Challenge Post-Quiz, one per student
To share with the entire class:
- Line-Follower Challenge Presentation, Microsoft® PowerPoint® file
- computer and projector, to show the presentation
- measuring tape or ruler, to measure the tape
- black electrical tape, to mark the oval course, ~5 ft per oval
- (optional, if floor is dark-colored) large sheet of white paper or plywood, on which to tape ovals
Note: This activity can also be conducted with the older (and no longer sold) LEGO MINDSTORMS NXT set instead of EV3; see below for those supplies:
- LEGO MINDSTORMS NXT robot, such as the NXT Base Set
- LEGO MINDSTORMS Education NXT Software 2.1
- computer, loaded with NXT 2.1 software
Today's challenge involves making a robot follow a line using its color sensor. Let's first look at how a color sensor works using the TRY ME option on the LEGO EV3 intelligent brick.
Then, each group will develop a program to make its robot follow a black line. How will you do that? Here's a tip: Use your color sensor as the robot's "eye." With input provided from its "eye" sensor, the brick/computer stays informed of when it is on the tape and when it is not. When the brick/computer has this information, it can decide how to move the robot's motor so that the color sensor is directed at the tape. Doing this ensures that the robot follows the line.
design: Loosely defined, the art of creating something that does not exist.
engineering: The use of science and mathematics to solve problems to improve the world around us.
Before the Activity
- Gather materials and make copies of the Line-Follower Challenge Pre-Quiz and Line-Follower Challenge Post-Quiz, one each per student. The quizzes and their answers are also embedded in the presentation, so they can be presented to the class as a whole, if desired.
- Assemble the LEGO MINDSTORMS EV3 taskbots by following instructions in the core set or at https://www.youtube.com/watch?v=Dhe2jXi3Fc4.
- Find a clear space on a smooth floor for one (or more) oval-shaped track(s) created with ~5 feet of black tape. Place the tape on the floor to create the track. Prepare according to details on slide 7. So the black tape provides high contrast, light-colored floors are best. If your floor is dark, then lay down a large sheet of white paper or wooden plywood over the floor to tape onto.
- Use the Line-Follower Challenge Presentation, a PowerPoint® file, to teach and conduct the activity. Set up a computer/projector to show the presentation to the class.
- Review the solution program on slides 8-14 to make sure you fully understand the logic used in this program, so as to be able to explain it to students after they have had a chance to try developing their own programs.
- Arrange for enough computers so you have one for each student group. Make sure each computer has the LEGO software loaded.
With the Students: Line-Follower Challenge
- Administer the pre-quiz (also slide 2 with answers on slide 3) and discuss the answers as a class after students have filled out the sheets.
- Use slide 4 to introduce the line-follower design challenge: To have the robot follow a black line. To do this, the robots will use color sensors as their "eyes."
- (slides 5-6) Before students begin the design challenge, provide a refresher on how the color sensor works. Explain reflectivity of light and have students explore the TRY ME option on the LEGO intelligent brick and determine the color sensor readings for different surfaces. Refer to the How Does the Light Sensor Work? lesson in unit 4: How Do Sensors Work? for numbers related to the color sensor readings for different surfaces. In general, higher numbers indicate brighter light (as a percentage of light that is the maximum the sensor can read), and lower numbers indicate a lower brightness of light. Explain that colors close to white reflect more light and colors close to black reflect less light.
- Show students the oval-shaped course(s) created on the floor with black tape, prepared as described on slide 7.
- Divide the class into groups of three students each. Give the groups 15-20 minutes to create their line-follower programs.
- Direct groups to begin by brainstorming the logic for program that instruct the robot to successfully follow the line. Encourage students to use what they have learned about programming from previous activities.
- Provide each group with a LEGO taskbot and have students download their programs onto the EV3 intelligent bricks.
- Give the groups 20-30 minutes to test their robots on the track and make changes to their program designs. To test a line-follower program, position the robot's color sensor over the line and start the program. The testing and redesign steps of the engineering design process are when engineers test their ideas to see if they meet the challenge, and re-design, as necessary.
- Gather the class together so each group can demonstrate the performance of its robot and designed program.
- Once students have attempted to complete the line-follower challenge, walk them through the logic of the complex solution (on slides 8-13) and explain how to generate the program step by step.
- Once groups have prepared the provided program, direct them to download it to their EV3 intelligent bricks. Provide each group with a chance to test to see if the program is successful. Note the troubleshooting tips on slide 14.
- As a class, discuss the activity, particularly what students learned and any issues or problems. Ask students: How many groups experienced some unsuccessful program design attempts? What were some of your programming design ideas that did not work? Did the successful program design surprise you? Can you understand how sometimes engineers say they learn more from failures than successes?
- Administer the post-quiz (also on slide 15 with answers on slide 16) and review the answers as a class. Slide 17 presents vocabulary words and definitions.
Providing more than one track helps in the testing phase so groups spend less time waiting for a turn at the track.
If the robot does not follow a black line, check for these common problems:
- The black line may need to be thicker; if the line is very thin, the color sensor response time might be too slow.
- The light level used in the switch statement (step 2) might need to be raised or lowered, depending on the surface color/reflectivity of the black line. It is often helpful for debugging to view the output of the color sensor directly from the EV3, via the View menu option.
- Make sure the sensors/motors are connected to the correct ports.
- Read back through the instructions and make sure all the properties for the commands are set correctly.
Pre-Quiz: Before starting the activity, administer the two-question Line-Follower Challenge Pre-Quiz by handing out paper copies (also on slide 2). Use the pre-quiz to assess students' prior knowledge of how color sensors work and encourage them to brainstorm how a program for this challenge could include the robot turning. The answers are provided on the Line-Follower Challenge Pre-Quiz Answer Key (and slide 3).
Activity Embedded Assessment
Line-Follower Challenge: Assess each group's performance in the line-follower challenge using the following rubric (maximum 30 points).
- The LEGO robot designs were appropriate, with correct color sensor attachment (10 points maximum)
- The program logic was correct. (10 points maximum) (Note: Refer to solution on slides 8-13.)
- The group iterated several times and improved its design. (10 points maximum)
Concluding Discussion: At activity end, lead a class discussion so students can share their observations, difficulties, questions and conclusions. How many unsuccessful program design attempts did you team go through? What were some of your programming design ideas that did not work? Did the successful program design surprise you? Mention that sometimes engineers say they learn more from failures than successes. Use this opportunity to gauge student comprehension.
Post-Quiz: At activity end, administer the two-question Line-Follower Challenge Post-Quiz by handing out paper copies (also slide 15). Review students' answers to assess their individual understanding of the logic in the program solution for this challenge and ability to relate this logic to real-world engineering problems. Answers are provided on the Line-Follower Challenge Post-Quiz Answer Key (and slide 16).
- For more advanced students, add more explanatory material on the topics of sensors and transducers.
Additional Multimedia Support
Instructions to assemble the LEGO "5 Minute Bot" at https://www.youtube.com/watch?v=Dhe2jXi3Fc4
ContributorsSachin Nair, Pranit Samarth, Satish S. Nair
Copyright© 2014 by Regents of the University of Colorado; original © 2013 Curators of the University of Missouri
Supporting ProgramGK-12 Program, Computational Neurobiology Center, College of Engineering, University of Missouri
This curriculum was developed under National Science Foundation GK-12 grant no. DGE 0440524. However, these contents do not necessarily represent the policies of the National Science Foundation, and you should not assume endorsement by the federal government.
Last modified: January 31, 2018