Basic Line Follower
Basic Line Follower
PROGRAMMING
LESSON
Basic Line Follower
LESSON OBJECTIVES
1. Learn how humans and robots follow lines
2. Learn how to get a robot to follow a line using Color Mode on
the EV3 Color Sensor
3. Learn how to follow a line until a sensor is activated
4. Learn how to follow a line for a particular distance
5. Learn how to combine sensors, loops and switches
TEACHER INSTRUCTIONS
So now the robot will fall off only the same side.
We will now show you how this works!
2015 EV3Lessons.com (Last edit: 2/28/2015)
If on
black,
turn
right.
If on
white
turn left.
The answer
depends on what
side of the line
you are following!
2015 EV3Lessons.com (Last edit: 2/28/2015)
C
B
10
11
CHALLENGE 1 SOLUTION
12
13
CHALLENGE 2 SOLUTION:
SENSOR
14
CHALLENGE 2 SOLUTION:
PARTICULAR DISTANCE
15
DISCUSSION GUIDE
Why is it important for the robot to follow the same side of the
line?
The robot only knows to check if it is on or off the line.
This is a basic line follower. What are some things that were not
good about this line follower? Do you think the line follower can
be improved?
It wiggles a lot. Smoother line followers are described in the
Advanced lessons
What sensor measures how far you have travelled?
The rotation sensor used in Challenge 2 solution measures
how much the wheels have turned
How would you write a line follower that will stop when it sees a
line? Or another color?
Change the loop exit condition to use the color sensor.
2015 EV3Lessons.com (Last edit: 2/28/2015)
16
CREDITS
This tutorial was created by Sanjay Seshan and Arvind Seshan
from Droids Robotics.
More lessons are available at www.ev3lessons.com
Authors Email: [email protected]
This work is licensed under a Creative Commons AttributionNonCommercial-ShareAlike 4.0 International License.
17