Teach lesson
Arduino Visual Robot (1/4): first safe movement
Students program the Arduino visual robot to move safely, test start and stop behavior, and record evidence from the real remote robot.
Learning Outcomes
Program a real mobile robot with motor and time blocks.
Connect left/right motor speeds with forward motion, turns, and stopping.
Record observable evidence from a real robot run.
Student activity preview
Activity Content
Preview only. In a class session, students can fill in responses and submit their work to the teacher.
Before moving the robot
8 min
Before programming, locate what each part does. In these lessons you will use
the physical robot's motors and LEDs, its line and proximity sensors, and the
A/B/C buttons that appear in the lab's web interface.
A two-motor robot can move forward, turn, or stop depending on the speed of each wheel. In this lab you will build a block program, verify it, upload it, and watch a real robot execute it.
Today you will test short movements:
- Drive forward slowly.
- Stop after every movement.
- Turn by changing the two wheel speeds.
- Record what you actually see on the camera.
Predict what the robot should do if both motors are set to 150 for half a second and then both motors are set to 0. Explain why it helps to add a final stop block that sets both motors to 0.
Create the first movement
22 min
Open the Arduino Robot Visual lab.
The robot editor is like the one in Part 1 (the board): the block categories are on
the left and the Verify / compile and Upload into robot buttons are at the
top. Here there are also robot-specific categories: Motors, LEDs,
Buttons, Proximity, and Line sensors. The main loop is the big
block that repeats without stopping (in Part 1 you saw it as `Arduino loop
forever`): put inside it whatever you want the robot to do over and over.
Open the robot visual editor.
Choose the recommended robot option:
First available robot (of any type of circuit)/Any circuit.Find the
Motors,Time, andCommscategories.Inside the main loop, add
Change two motors speed.Set left speed to
150and right speed to150.Add
wait 500 milliseconds.Add another motor block with left
0and right0.Optional: add a serial message such as
forward and stop(useSetupwithSerialat9600, thenprint) for extra evidence.Verify/compile, upload to the robot, and watch the run.
Block image and text reference:
In the main loop:
[Change two motors speed]
Left: 150
Right: 150
[wait] 500 milliseconds
[Change two motors speed]
Left: 0
Right: 0
If you add a serial message, first use Setup with Serial at 9600, then use a print block with the text you want to record.
This table will have three rows by the end of the activity: one for forward
and stop, one for Turn Test A, and one for Turn Test B. For now, after the first
upload and observation, fill only the first row (Forward and stop) and leave
the other two rows for the turns phase. In each row, write the left and right
motor speeds, the time in milliseconds, what movement you saw, and whether the
robot stopped at the end.
| Test | Left motor | Right motor | Time (ms) | Observed movement | Stopped at the end? |
|---|---|---|---|---|---|
Describe one concrete piece of evidence that your program ran on the real robot. Include what you saw on the camera and any serial message you used.
Controlled turns
15 min
Test two short turns. Use speeds from 125 to 150 so the motors have enough strength, and use times from 300 to 700 ms. Remember: a negative speed makes that wheel spin backward; that is why, with one wheel forward and the other backward, the robot turns almost on the spot.
Test A:
In the main loop:
[Change two motors speed]
Left: 150
Right: -150
[wait] 400 milliseconds
[Change two motors speed]
Left: 0
Right: 0
Test B:
In the main loop:
[Change two motors speed]
Left: 0
Right: 150
[wait] 500 milliseconds
[Change two motors speed]
Left: 0
Right: 0
After observing each turn, go back to the previous table and fill one row for
Test A: turn on the spot and one row for Test B: wider curve. Do not delete
the first forward-and-stop row.
Compare the two turns. Which one turned more on the spot? Which one looked more like a curve? Use your observation, not just the theory.
If the robot moved too much or too little, what would you change first: speed or time? Justify your choice.
Exit evidence
10 min
First movement evidence
Submit a screenshot or description of your program and evidence from at least two tests: the forward-and-stop test and one turn test. It must be clear that the robot ends with both motors set to 0.
Explain how these blocks are similar to and different from other movement blocks you have seen.