The sonar sensor is a component in the Climate Action Kit. It detects distance in meters and can attach to blocks that come in the Climate Action Kit.
This video will guide you through the basics of how to connect the sonar sensor to the Climate Action Kit breakout board, and how to use the sonar code blocks in MakeCode.
Sonar Sensor | Tutorial
MakeCode Blocks
The Forward Education extension comes with several new blocks you can use to control the sonar sensor. Download the sample code below to your micro:bit to get started with testing your sonar sensor.
Lessons Using the Sonar Sensor
Ready for more? Check out these curriculum-aligned lessons featuring the sonar sensor.