> For the complete documentation index, see [llms.txt](https://sharinghub-eng.kittenbot.hk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sharinghub-eng.kittenbot.hk/functional_module/powerbrick/ultrasound.md).

# Ultrasound and Sound Module

![](https://kittenbothk.readthedocs.io/en/latest/_images/06_04.png)

This module combines ultrasound sensor and a microphone into the same module.

The ultrasound sensor is used to measure the distance of objects, the microphone is used to measure the loudness.

![](https://kittenbothk.readthedocs.io/en/latest/_images/IMG_2577.GIF)

![](https://kittenbothk.readthedocs.io/en/latest/_images/IMG_2576.GIF)

### Details

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/06_011.png)

### Specifications

* Voltage: 3V-5V
* Dimensions: 56mm X 24mm X 16mm
* Connector: 4Pin PH2.0
* Ultrasound Detection Range: 4cm-200cm(Recommended)
* Analog Return Value Range: 0-1023

### Precautions

* Ultrasound works better on items with smooth surfaces, the smooth surface should be perpendicular to the module.
* Ultrasound emits signal in the shape of an arc, make sure there is no obstacle in the signal range.
* The microphone only determines loudness of a sound, it can’t measure decibels. Measuring decibels require professional equipment.

### Connecting the module

Connect the Ultrasound Module to Armourbit with a 4Pin cable.

![](https://kittenbothk.readthedocs.io/en/latest/_images/ultrasound_wire.png)

### MakeCode Coding Tutorial

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/mcbanner.png)

#### Load Powerbrick Extension:

#### Search "Powerbrick" in the search bar.

![](https://kittenbothk.readthedocs.io/en/latest/_images/powerbrick_search.png)

#### Or search the following link.

<https://github.com/KittenBot/pxt-powerbrick>

#### Ultrasound Module Blocks:

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/ultrasoundblocks1.png)

#### Measuring distance

{% embed url="<https://makecode.microbit.org/_VUTJ1xDtzVfR>" %}

[Sample Program](https://makecode.microbit.org/_VUTJ1xDtzVfR)

#### Measuring ambient noise

{% embed url="<https://makecode.microbit.org/_RKL0iE4iP63i>" %}

[Sample Program](https://makecode.microbit.org/_RKL0iE4iP63i)

#### Makecode Video

{% embed url="<https://www.youtube.com/watch?v=Jwj449zjnYE>" %}

#### Demo Video

{% embed url="<https://www.youtube.com/watch?v=sNdLvYbQ930>" %}

### Extension Version and Update

There may be updates to extensions periodically, please refer to the following link to update/downgrade your extension.

[MakeCode Extension Update](/programming-platforms/makecode-tutorial/makecode-extension-updates.md)

### KittenBlock Coding Tutorial

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/kbbanner.png)

#### Load Powerbrick Extension

Select Powerbrick from the hardware column.

![](https://kittenbothk.readthedocs.io/en/latest/_images/addextension1.png)

#### Ultrasound Module Blocks:

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/kbultrasoundblocks1.png)

#### Measuring distance

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/kbultrasounddist1.png)

[Sample Code Download](https://bit.ly/PowerbrickM4_01sb3)

#### Measuring ambient noise

![](https://kittenbothk-eng.readthedocs.io/en/latest/_images/kbultrasoundlevel1.png)

[Sample Code Download](https://bit.ly/PowerbrickM4_02sb3)

### FAQ

1：Why is there no reaction when I click the blocks?

Make sure you have connected the Micro:bit correctly and flash the firmware again.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sharinghub-eng.kittenbot.hk/functional_module/powerbrick/ultrasound.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
