Microbit Robotics Teacher Training
Beginner
15 mins
75 points
What you need:
Chromebook/Laptop/PC

Sonar

In this lesson, you will learn about the concept of sonar, how it functions, and its usage in robotics. You will also see how a microbit can sense distance using sonar.
Learning Goals Learning Outcomes Teacher Notes

1 - Introduction to Sonar

Sonar, short for Sound Navigation And Ranging, is a technique that uses sound waves to detect and locate objects underwater. In robotics, sonar sensors are used to measure the distance between the robot and an object by emitting sound waves and measuring the time it takes for the sound waves to bounce back after hitting an object.


2 - How Sonar Works

Sonar works by emitting sound waves from a transmitter and then detecting the reflected sound waves using a receiver. The time it takes for the sound waves to travel from the transmitter to the object and back to the receiver is used to calculate the distance between the sonar sensor and the object. This is done using the formula: Distance = (Time x Speed of Sound) / 2



3 - Sonar in Robotics

In robotics, sonar sensors are commonly used for obstacle detection and avoidance, as well as for measuring distances. They can be found in a variety of robotic applications, including underwater robots, drones, and autonomous vehicles. Sonar sensors provide a cost-effective and reliable way for robots to navigate and interact with their environment.

4 - Microbit and Sonar

Let's take a look at how to use a micro:bit with a sonar sensor to detect objects and measure distances. To do this, you need to connect a sonar sensor to the micro:bit and write code that sends a trigger pulse, listens for the echo, and calculates the distance based on the time it takes for the echo to return.

When you run the code (in the attached image), the micro:bit will display the distance measured by the sonar sensor in centimeters on its LED screen.


Unlock the Full Learning Experience

Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our courses.

Copyright Notice
This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more