R
O B O
Ti p s :
• After the lamp has been turned on you have to wait a short while (about one second) before you can
query the phototransistors. Otherwise the phototransistor will detect "dark", meaning a track, where
there is none, because the reading is done before the lamp is fully lit.
• As track you can use black duct tape that is about 20mm (or 0.787 in.) wide or simply draw a black
track with this width on white paper. The turns should not be too tight otherwise the robot will lose
sight of the track too frequently. First use the Interface test to make sure that the phototransistors are
able to detect your track accurately. Don't forget to switch on the lamp when you do this.
• Adjust the lamp so both phototransistors output the value 1 on a light background, even with motors
M1 and M2 turned on. If the battery charge is a little low, the lamp will be somewhat darker when
the motors are turned on. If the lamp hasn't been adjusted properly it is possible that the
phototransistor will read "dark" even though it hasn't found a track.
• Tracking works in a similar way as light-seeking. You just have to adjust the search so the model
drives straight ahead for a bit, after the full rotation, before searching again.
• Please note that the model is supposed to drive straight ahead whenever both
phototransistors output the value "dark" (=0).
• You will find the finished program under Tracker.rpp.
A s s i g n m e n t 2
● Create a track with curves of varying degrees of tightness. Which is the smallest
radius the model can handle?
● When correcting the track, experiment with different speeds of M1 and M2. Which
combination offers the best result?
● Create a round track. Try to optimize the speeds in such a way that the robot
achieves the best possible lap time. This assignment lends itself perfectly to a
competition between several robots.
■ All of the robots we have built so far were able to cover a certain distance as well as follow a light
source or a track. But what happens if there is an obstacle in its way? Well, either the obstacle is pushed
aside or the robot keeps running against it senselessly until the battery is empty. It would, of course, be
much more intelligent if the robot would be able to recognize the obstacle and avoid it accordingly. To
accomplish this, the robot is equipped with a flexible circular bumper with three pushbutton sensors.
With this bumper it can differentiate if an obstacle is to the left, to the right or behind it.
How it reacts to the obstacle remains only a question of the programming.
First assemble the model "Robot with Obstacle Detection". Only one pushbutton sensor (I1) is
necessary to measure the distance traveled. For this reason we can remove the
pushbutton sensor I2 from the Basic Model and use it for the obstacle detection.
M
S
O B I L E
E T
A
B
C T I V I T Y
O O K L E T
GB+USA
Robot with Obstacle
Detection
4 4
3 3
4 4
3 3