ULTRASONIC SENSOR – WALL-E or JOHNNY FIVE?

INTRO AND LEARNING GOALS
Everyone’s favourite sensor – in terms of looks anyway! Here we will look at how you can easily attach the sensor and get it up and running quickly…
- Understand how to attach the sensor to the robot
- Explore how to use LEGO® MINDSTORMS® Education software
- Create a program using the Ultrasonic Sensor block to get your robot to stop at objects
- Explore what your robot can do!
THE BASICS OF HOW IT WORKS
The Ultrasonic Sensor emits high frequency sound waves – too high for the human ear to detect. Having emitted the sound wave, the sensor then measures the amount of time it takes the sound wave to come back from the surface that it has reflected off.
On the basis that we are going to work in centimetres – the Ultrasonic Sensor can measure distances from 0 to 255 cms. It has a stated accuracy of 1 cm or 0.3 inches – your experiences will define whether you deem this to be true or not! The sensor cannot detect objects that are very close to the sensor (closer than about 3 cm or 1.5 inches). So let’s get using it and find out just how good it is!
ATTACHING THE SENSOR…

Here you can see that the Ultrasonic sensor is attached centrally at the front of the robot. It is not too near the ground (but if your object was low down this position might be too high), and there are no wires in the way. It is in the best position for it to function.

Here the Ultrasonic sensor is quickly attached using an axel – we did this because the school bell was about to go! It is not perfect but it gets the job done (but it may be triggered by the side of the robot being in its field of vision).
EV3 LAB PROGRAMMING…
We are about to create a program to get our robot to stop when it senses a wall in front of it. There is one video as the block on the tablet and desktop are very similar…
EV3 CLASSROOM PROGRAMMING…
We are about to create a program to get our robot to stop when it senses a wall in front of it…

SOME TEACHING THOUGHTS… from John
- The sensor has a wide “field of view” and may detect a closer object off to the side instead of a farther object straight ahead.
- The sensor cannot detect objects that are very close to the sensor (closer than about 3 cm or 1.5 inches). Why not get students to test this out?
- LEGO states: “The Ultrasonic Sensor works best to detect objects with hard surfaces that reflect sound well. Soft objects, such as cloth, may absorb the sound waves and not be detected. Objects with rounded or angled surfaces are also harder to detect.” Get students to investigate this – don’t just believe LEGO!

ROBOT WORKOUT (WHERE NEXT?)
- If you get your robot to stop and turn around when it detects a wall, you can then put the program inside a loop. Now your robot will keep on running, while detecting objects! Keep jumping in front of your robot – hours of fun and great exercise! 😉
- Use the Ultrasonic sensor to get your robot to park – just like you would park your car in real life. Don’t forget to add some ‘parking beeper’ sound effects!
You must be logged in to post a comment.