SPIKE™ Prime Set

Training Camp 3: Reacting to Lines

Write programs using the Colour Sensor to make the Driving Base autonomous.

30-45 min.
Beginner
Key Stage 3
lesson-header

Lesson plan

1. Prepare

  • Read through the pupil material in the LEGO® Education SPIKE App.
  • You'll need a thick black line on a white or light surface for this lesson:

    ▷ Draw a black line on a sheet of white paper
    ▷ Use electrical tape on a light surface
    ▷ Print out the ‘line ideas’ PDF
    ▷ Use a spare black axle element from the LEGO SPIKE Prime Set

2. Engage (5 Min.)

  • Use the ideas in the ‘Ignite a Discussion’ section below to engage your pupils in a discussion relating to this lesson.
  • Use the video to explain the lesson.

3. Explore (20 Min.)

  • Have your pupils work in pairs to build the Driving Base with the Colour Sensor.
  • Ask them to play the first programming stack to move their Driving Base forward and stop perpendicular to a black line.
  • Have them try the second programming stack and describe what happens.

4. Explain (5 Min.)

  • Facilitate a discussion about how the Colour Sensor detects the black line.

5. Elaborate (15 Min.)

  • Have your pupils work through the next program to make their Driving Base follow a black line.
  • Ask them to optimise this code to create an even better line-follower program.

6. Evaluate

  • Give feedback on each pupil's performance.
  • In order to simplify the process, you can use the assessment rubrics that have been provided.

Ignite a Discussion

Use these ideas to engage your pupils in a discussion about competition fields and the lines that are often seen on them.

  • Ask your pupils how they could use these lines to help make their Driving Base program more effective.
  • Explain the different types of lines and intersections:

    ▷ Thin lines
    ▷ Right angles
    ▷ T-junction lines
    ▷ Non-continuous lines
    ▷ Black lines cut by a coloured line

Have your pupils watch this video to see what they're about to do.

lesson-header

Building Tips

A Simple Driving Base with the Colour Sensor
Use the simple Driving Base model with the Colour Sensor. Remember to use the cable clips.

teacher-color1

Using the Colour Sensor
The Colour Sensor can be used in 2 different modes to solve this challenge (i.e. colour mode or Reflected Light Intensity mode).

The Reflected Light Intensity mode of the Colour Sensor will give maximum precision. Following a line is an alternating detection of 2 colours or 2 reflected light intensities. Spend some time with your pupils exploring the ways in which the sensor reports values. For example:

SPIKE Competition Ready Training camp 3 Teacher Building Tip - en-gb

Using the Motors in Power Mode
When turning on two motors using the Regulated Speed Mode of the Movement Blocks, the Hub will gradually send power (voltage) to the motors in order to reach the desired speed and keep it constant, regardless of whether the Driving Base is driving on a flat surface or a slope.

When turning on the two motors in the Power Mode of the Movement Blocks, the Hub will immediately send the desired power (voltage) to the motors.

In the case of a line-follower program, the Driving Base motors must perform small and fast movements (most likely below 10 degrees, to oscillate the Driving Base between the white and black spaces). In these situations, programming using Power Mode is recommended because it's more reactive, resulting in a more accurate line follower.

You'll find this block in the ‘More Movement Blocks’ extension.

Coding Tips

Main Program

SPIKE Competition Ready Training camp 3 Step03-Program - en-gb

Possible Solution

SPIKE Competition Ready Training camp 3 Teacher Solution - en-gb

Other Programs

SPIKE Competition Ready Training camp 3 Teacher Other - en-gb

Differentiation

Simplify this lesson by:

  • Explaining the Reflected Light Intensity mode of the Colour Sensor

    ▷ Find out more about the Colour Sensor in the help section of the SPIKE App.

Take this lesson to the next level by:

  • Challenging your pupils to modify their programs to follow lines of different sizes, colours and shapes.

Assessment Opportunities

Teacher Observation Checklist
Establish a scale that suits your needs, for example:

  1. Partially accomplished
  2. Fully accomplished
  3. Overachieved

Use the following success criteria to evaluate your pupils' progress:

  • The pupils are able to program their Driving Base to react to lines using the Colour Sensor.
  • The pupils can use an ‘IF / ELSE’ statement in their program to make a simple line-follower.
  • The pupils can optimise their line-following program to be more accurate.

Self-Assessment

Have each pupil choose the brick that they feel best represents their performance.

  • Blue: We've made our Driving Base stop at a perpendicular line.
  • Yellow: We've programmed our Driving Base to follow a line.
  • Violet: We've modified our line-following program to move our Driving Base faster and more effectively.

Peer-Assessment
Encourage your pupils to provide feedback to one another by:

  • Having one pupil use the coloured brick scale above to score another pupil’s performance
  • Asking them to present constructive feedback to one another so that they can improve their group’s performance during the next lesson
student-06

Language Arts Extension

To integrate language arts skills development:

  • Present a program called ‘differentiated line follower’ (see the ‘coding tips’ section) and have your pupils try to decode how the program works.
  • Ask your pupils to evaluate the performance of this program compared to their previous line-follower programs.

Note: This will require additional time.

Maths Extension

To incorporate the development of maths skills:

  • Ask your pupils to use these terms to explain how a line-follower program works when using the Reflected Light Intensity mode of the Colour Sensor:

    ▷ Threshold value
    ▷ Mean value
    ▷ Greater than, less than
    ▷ Range
    ▷ Percentage

Note: This will require additional time.

The pupils who enjoyed this lesson might be interested in exploring these career pathways:

  • Information Technology (IT Applications)
  • Manufacturing and Engineering (Machine Technology)
  • Manufacturing and Engineering (Pre-Engineering)

Teacher Support

The pupils will:

  • Program their Driving Base to stop at a black line
  • Program their Driving Base to follow a black line

LEGO® Education SPIKE Prime Set

CAS Computing Progression Pathways

Algorithms:
Uses logical reasoning to predict outputs, showing an awareness of inputs. (AL)

Programming and Development:
Understands the difference between, and appropriately uses if and if, then and else statements. (AL)

Uses a variable and relational operators within a loop to govern termination. (AL) (GE)

Uses a range of operators and expressions e.g. Boolean, and applies them in the context of program control. (AL)

Programming and Development:
Knows that computers collect data from various input devices, including sensors and application software. (AB)

Information Technology:
Uses criteria to evaluate the quality of solutions, can identify improvements making some refinements to the solution, and future solutions. (EV)

Pupil Material

Download, view or share the Student Worksheet as an HTML page or as a printable PDF.