4Overview
6Lesson Plans [HTML]
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
4Lesson Plans [ ]
4Whole Unit Lesson        Plans [ ]

Lesson 6: PROGRAMMING WITH SENSORS

OBJECTIVE
The objective of this lesson is to introduce the students to the components of a communication system. They will inquire into the LEGO sensor as a communication system. This lesson will also build upon their ROBOLAB programming skills. They will design and test a program using sensor commands. They will also inquire into how they could use a sensor in their final project.

BACKGROUND FOR THE TEACHER
Humans have five senses (sight, touch, hearing, smell and tasting). Much like humans, machines and robots can be given sensors to detect various external conditions. A human’s senses work much the same way as a machine’s sensors. The human eye, for example, receives light and depending on the frequency of the light the eye will send a very specific message to the brain. The brain will then decode the message and translate it into what you will see. Similar to the eye, a light sensor receives light and some sort of light sensitive material within the sensor will change as the light hits it and then transmit (send a message) a signal to the computer (brain) of the machine. The signal is most often a change in voltage that the light sensitive material creates as its properties change with the light. The computer then decodes this signal and processes it in a preprogrammed manner that then tells the machine how light or dark it is, how the light is changing, etc. The machine then can be programmed to perform certain operations according to the light conditions.

An example with a Lego wheelchair might look something like the following. A wheelchair has a light sensor attached to the front of it pointing down towards the ground. The wheelchair is traveling on a white floor and when it encounters a black line the wheelchair reverses direction. The light sensor is collecting light readings from the floor and when the light reading changes significantly (when it encounters the black line) the RCX, which is continuously receiving the signal form the sensor, decodes the signal, processes the signal, and then commands the motors to reverse direction.

The Massachusetts Technology and Engineering standards describe a communication (or sensor) system as including the following components: source, encoder, transmitter, receiver, decoder, storage and retrieval. Below is a breakdown of how this relates to the Lego light sensor.

o Source—external light
o Encoder—the light sensor itself
o Transmitter—the wire connecting the light sensor to the RCX
o Receiver—the microprocessor chip within the RCX
o Decoder—algorithm programmed within the RCX
o Storage—the memory within the RCX
o Retrieval—the user program that is stored on the RCX
o Destination—message sent to output (i.e. motors or computer)

STANDARDS ADDRESSED
3.1 Identify and explain the components of a communication system, i.e., source, encoder, transmitter, receiver, decoder, storage, retrieval, and destination.
6.3 Identify and describe three subsystems of a transportation vehicle or device, i.e., structural, propulsion, guidance, suspension, control, and support.

MATERIALS
Computer: 1 per group
Team Challenge kits: 1 per group
Pre-built wheelchairs from previous week
Black electrical tape
Tin can telephone (included in teacher resource kit)

SETUP
Make sure the computers have LEGO IR towers and are set up with ROBOLAB.

GUIDING THE ACTIVITY

Tin Can Demo
Give the tin can telephone to two students. Have them test it out. Let everyone in the class try it out.

Ask the students, “How does it work?”

Take student answers.

Ask them, “What is your ear’s role in all of it, what are your vocal chords role in it?”

Take student answers.

Then write the following words on the board: TRANSMITTER, DECODER, SOURCE, ENCODER, RECEIVER, STORAGE, DESTINATION, AND RETRIEVAL.

Tell the students, “Match these words with the steps in the process of the tin can telephone.”

Go around the room calling on different students to guess what word goes with what part of the tin can telephone.

Teacher Hint: TRANSMITTER-EAR
DECODER-SPEAKER’S CAN
SOURCE-VOCAL CHORDS
ENCODER-LISTENER’S CAN
RECEIVER-EAR
STORAGE-BRAIN
DESTINATION-BRAIN/EARS
RETRIEVAL-BRAIN

LINK TO LEGO ROBOTICS PROJECT
Ask the students, “Why do you think I had you talk about a tin can telephone?” “Why would this be included in our robotics projects?”

Guide the students’ answers to the connection between the tin can telephone as a communication system and how the RCX, motors, and sensors will be a communication system.

Then have the students take out the light sensor from their Lego kit. Ask them, “How do you think this would work?”

Guide the students’ answers to look at the light sensor working with the LEGO RCX as a communication system where there is a source, encoder, transmitter, etc.

PROGRAMMING CHALLENGE
“OK, now you are going to attach a light sensor to your wheelchair and program it.”

Your challenge is to create a program that:
-has your wheelchair drive forward
-then stop as soon as it crosses the line (either black electrical tape or white masking tape… depending on whether the floor is a light or dark)

Give each group of students a piece of black electrical or white masking tape to put on the floor to test their program.
(NOTE: if the light sensor is not close enough to the floor it might not recognize the black tape.)

Sample program (don’t show this to the students):


If there is time, you can give them the following challenges.
Light Sensor Challenge 2 – Have the wheelchair reverse directions after seeing the line and stop at another line.

Touch Sensor Challenge – Have the wheelchair start moving forward when the touch sensor is pressed and then stop when the light sensor is pressed again.

Sample program (don’t show this to the students):


DISCUSSION
“How could sensors and robots like this be used to assist someone who is blind or in a wheelchair?”
Have the students share their ideas.
“How could you use the sensors in your final project?”
Have the students share their ideas … highlight the ideas they have for final project ideas.

END

Home | About ITest | Units & Lesson Plans | Resources | Student Projects | News & Events