# Robotics & Engineering

LEGO Robotics resources

I enjoy teaching students the engineering process, building, and programming using the LEGO Mindstorms kits. I currently am running an exploratory course for middle school students and have developed the following sequence of challenges for them to follow as they learn basic programming. I have used variations of this sequence to train students (and their coaches) to solve FIRST LEGO League related challenges. The  files were written in LEGO Mindstorms Software v2.0.

Challenge Set 1: Basic Motor control

• Students must use a single motor block to move exactly the length of their work table without falling off.
• Students must do a perfect 90 degree turn.
• The robot must drive straight along one edge of a rectangular table, turn left (or right), make a sound, and then drive along another edge. Can you make your robot go all the way around the table without falling off?
Challenge Set 2: Reaction with Sensors ( lightsensorchallenge.rbt)
• With a light sensor attached and pointing down, the robot must drive forward to the edge of the desk or table and stop when it no longer “sees” the table surface.
• Make the robot drive straight until it passes over a light colored piece of paper, then back up for a second or so.
• Make the robot repeat the behavior in the previous step, but using one of the other sensors in the basic kit.
• (depending on interest) Students should again make the robot stop when it gets to the edge of the table, but this time the robot should make a slight turn in one direction or another. Place all of these blocks in an infinite loop, and the robot should stay on the table or desk indefinitely!
Challenge Set 3: Using Loops. (looping with sensors.rbt)
• Download the loop program to your robot and watch what happens. Modify the program to make it repeat that behavior four times instead of two. Make the robot say something instead of make a tone.
• Change it so that your robot drives straight for 2 seconds, turns 90 degrees, and then repeats this behavior four times. What shape has your robot made?
• Delete the loop. Make the robot drive straight for an unlimited amount of time with a motor block. Then use a wait block that waits until the light sensor senses dark. Then make the robot back up for 1 second. Then put these three blocks inside of a loop and watch what happens.
Challenge Set 4: Following using sensors. (following challenge.rbt)
• Set up a copy paper box and a robot with motors on B and C. Use an ultrasonic sensor (on port 1) that points toward the left side of the robot. Run the program and observe what happens. The robot <strong>should</strong> move around the box and maintain its distance until it runs into something.
• Adjust the robot and the program so that it goes clockwise around the object instead of counter-clockwise as originally programmed.
• Replace the ultrasonic sensor with a light sensor pointed at the ground. Modify the program so that the robot follows the edge of the table using the value of the light sensor to guide it. Hint: The structure of the
program will be the same, so you don’t need to add or subtract any blocks.

Challenge Set 5: Making Decisions with a Switch (decision making with a switch.rbt)

In this challenge, students learn to use a device called a switch. This is how a robot can decide to do one thing or another based on a sensor value, time, or other condition.

In the program, you can see that the switch has two branches. The top one will be followed if the touch sensor is pressed. The bottom one will be followed when the touch sensor is NOT pressed.

• Without downloading the program to your robot, see if you can predict what will happen when you run the program, and then download and run the program to see if you were correct. If not, try to figure out why.
• Modify the program to move your robot forward when a touch sensor is pressed, and backward when it is not pressed.
• Create a program that uses two touch sensor to control your robot. When the left touch sensor is pressed, the left motor should run forward. The right motor should run forward when the right touch sensor is pressed. This will learn you to learn one other trick, but there is a pretty big hint hidden in the program. BIG HINT: what might you do with that branch of the program running upward? (You can make a branch of your own like this by hitting shift with your mouse pointer over the LEGO beam for the program.)
• Find another interesting use of the switch and use it to do something cool with your robot.
Challenge Set 6: Counting with Loops (counting with loops.rbt)
We’ve already seen how loops can be used to do things over and over again. It’s also possible to use them to do other tasks for the robot, such as counting.
The program runs the drive motors forward and then runs a loop that contains sensor blocks. The first waits for an object to be close, and then waits for an object to be far. This makes it so that the robot knows it has passed an entire object before looking for a new object.
• Modify the program to drive your robot past THREE objects and stop.
• Make your robot drive past the length of your LEGO box and then stop. This does NOT require changing the motor blocks at all!
• Make your robot drive forward past two objects, then backward past the two objects, and then play a song or sound before stopping.
• Change the program to use the light sensor to count lines of white tape on the floor. Your robot should stop after the fourth line of tape.
Feel free to modify and use these activities with your own students! Just do me the favor of letting me know how you used them and how it went.

I am a huge fan and supporter of FIRST (For Inspiration And Recognition of Science and Technology) programs. I currently am involved in both  and   at the Hangzhou International School. I also have a habit of keeping in contact with a number of   teams during the build season.

### 2 responses to “Robotics & Engineering”

1. L. Dantzler

I am by no means a “math” person, but, I am very impressed with your work and what I think it means for how much students can learn. I retired last year, but, had the opportunity to coach our middle school Lego Robotics team for 6 years. I really believe that FLL has so much to offer students and wonder what your opinion is about it being offered as an exploratory class for interested students. If more than one teacher/coach in a school were to teach the class.. just think how many students would have the opportunity to participate. The way it is now… a school usually has one team with a maximum of 10 students. The time needed to really do well with the project each year, is trememndous and, of course, it is done as an after school program. What are your thoughts on having it as an exploratory? What arguments would you use to convince your district that this would make a positive impac ton real world learning, etc.

• Hey – thanks for the comments.

The best part about having it as a class is that you have dedicated and consistently scheduled time to devote to working on the project. It’s very difficult to know precisely how long it will take for students to ‘get’ a robotics task, especially because it is so fundamentally different from the other activities they generally work on. Having the ‘exploratory’ title takes some of the pressure off performance for grading purposes (phew!) and helps focus on the activity itself rather than meeting a specific schedule.

Another major point to bring up is the healthy mindset of iterative learning that an activity like FLL can help develop in young minds. Nobody gets it right the first time – even those that do try to make their robot design even better. If we could have students thinking that way about their math and language arts classes (instead of the more common I’m no good at _________) it leads the student to have a more healthy relationship with making mistakes.

The last suggestion is that FLL represents an interdisciplinary real world problem that most students don’t get a chance to tackle. It resembles the types of big picture tasks that adults often handle in their jobs and apply skills in creative design, problem solving, writing, communicating ideas effectively to different audiences…the list goes on and on. It’s hard NOT to find ways to connect elements of state learning standards to the processes students go through when participating in FLL or LEGO robotics in general. These are often the skills that everyone agrees our students should be developing in school, but few actually know how to develop in a structured way.