# Water Level Sensor

Water Level Sensor (HKBM8012G)

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

This is a water level sensor which can detect the presence of water and the water level. The reading is high when the water level is high.

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

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

### Precautions

* If the sensor is not in use for a long time, please store in a dry container to prevent oxidation due to moisture.
* A warning line is printed on the module, do not insert the sensor deeper than this line as this may cause damage to the circuitry.

### Connecting the module

Connect the Environment Module to Armourbit with a 4Pin cable first, then connect the sensor to the module with a 3Pin cable.

![](https://kittenbothk.readthedocs.io/en/latest/_images/water_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>

#### Environment Module Blocks:

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

#### Detecting water level

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

[Sample Code Link](https://makecode.microbit.org/_h4Ebo11zUhTr)

#### MakeCode Tutorial Video

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

#### Demo Video

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

### Extension Version and Updates

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

[MakeCode Extension Update](https://sharinghub-eng.kittenbot.hk/programming-platforms/makecode-tutorial/makecode-extension-updates)

### 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)

#### Environment Module Blocks

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

#### Detecting water level

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

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

### 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.
