Moving a robot around with Lego Mindstorms
| Aim | Teamwork, robot building, and programming. |
|---|---|
| Duration | 10h |
| Technology | robot, internet |
| Materials | lego pieces, robot, PC, USB cables, cardboard, colored pencils |
| Student/teacher Ratio | six students / teacher |
| Age of students | 10-13 years old |
Special information
By getting pupils to code the robot to form a geometrical shape they will better understand geometrical concepts. Beginners will be able to program the robot to follow both a straight line and a rectangular outline. More advanced students will to able to program the robot to follow the outline of a triangle, hexagon or circle.
Step by step overview
Step 1: The students were organized into six small groups of two children each. Each group built a certain part of the robot (arms, legs, body, head) and another group put all its parts together.

Step 2: The students drew three geometrical shapes (rectangular, triangle, circle) on three large sheets of paper. Then they stuck their drawings down onto the floor.
Step 3: The teacher showed the students where and how to download the program to be able to work with the robot. We had only one robot and the students couldn’t work all at the same time. We chose a team of two students and let them program the robot. After they had managed to program the robot this team of students helped the other five teams understand how the robot can be programmed.
Step 4: At first they created a new program and named it. Each team then named the same program differently.
1 Mode Selector: We selected the sound we wanted. File Name Input -They chose the right words for the robot to say from a list of sound effects inputs. After which, they chose a maximum value for the volume.
2 The block Move tank.
Select the two motors (A, B, C, or D) that you want the Move Tank block to control by using the Port Selector on the top of the block. Click on each motor letter to choose the port for that motor. The first port should be the motor on the left side of the vehicle, and the second port should be the motor on the right side.
They used the Move Steering Block, which was connected to the B and C motors controlling the tracks of the robot (on the Steering Block they can choose the direction by changing the steering parameter and they can also choose the power and the duration - how long it should drive for).
Firstly, the power of the tracks was set to maximum speed 100, straight ahead, then to the left 100. The power of the tracks was then set to the right at maximum speed 100 “Power Right”. The duration was set to five seconds. The tracks had to stop when the movement was finished, “Brake at End: True”. So this block carried out the command to move straight ahead, at full speed for five seconds.
Step 5: Move steering - On For Degrees On for Degrees turns both motors on, waits until one of them has turned for the number of degrees of rotation in the Degrees input, and then turns both motors off. This can be used to make your robot travel a specific distance or turn a specific amount. 360 degrees of rotation corresponds to one full turn of a motor.
You can control the speed and direction of your robot using the Power and Steering inputs. Use Brake at End to stop your robot after exactly the specified number of degrees.
The block “Steering Move” from “Action” was set to perform the following command: the robot had to turn to the right by an angle of 90 degrees. After adding this block the robot steers 90 degrees and travels for the width of the rectangle. By adding this block more than one time the robot will follow the route of the rectangle. The steering wheel had to stop when the movement was finished: “Brake at End: True”.
Step 6: After they had written this program the students used a USB cable to save it to a robot. Expand/ Collapse DOWNLOADING A PROGRAM – PROGRAMMING MODE. When your program is ready, you can download it to your EV3 Brick.

Tips to make the workshop go smoothly
You need at least six robots for 12 students to run an workshop. A robot can be quite expensive. The EV3’s software can be downloaded from http://www.lego.com/en-us/mindstorms/learn-to-program.
Extensions and challenges
The robot can have more than one shape. More advanced students will to able to program the robot to follow the drawing of a triangle hexagon, circle.
Sources of additional information
http://www.lego.com/en-us/mindstorms/learn-to-program
http://www.lego.com/en-us/mindstorms/downloads/user-guide
