Skip to main content

Sugar - Soil Moisture


Soil sensor, used to detect soil moisture, meow home soil module adopts capacitive soil, anti-corrosion, when the humidity is larger, the analog value returned is smaller soil.png


Dimension24 x 24 x 70 mm
Weight6.7 g
SignalAnalog Input
Range0~3.3V for Microbit 0~1023
Detection TargetSoil

Using (Makecode) on Microbit


Coding Platform

Microsoft MakeCode for micro:bit Use Makecode coding platform

Add the Sugar Plugin

image-20240311154521941 image.png

Within Extensions, search for Sugar and click Add

Building Block - Functional Description

S.NoBuilding Block ImageBuilding Block Function
1image-20240316154132099Retrieves Soil sensor value (0-1023)

Circuit Connection


Microbit portWire used
Soil moisture module.pngCube soil moisture moduleP0White PH2.0-3Pin interface wireuntitled.100.png

Connect the light-sensitive module to the P1 of Robotbit Edu using the 3PIN terminal wire. (Only the three pins with analog read function, P0, P1, and P2, can be connected) Turn on the Robotbit power and you can see the red light at the bottom of the soil module light up (indicating that the module is powered normally)


First, map the soil moisture value from 0-1023 to 1023 to 0, so that the wetter the soil, the greater the value Then determine whether the value is below the set value, and a sad face is displayed if it is below the set value image-20240316154542659

Using (KittenBlock) on Microbit



Use the Microbit dot matrix smiley face crying face to feedback the soil conditions and remind you to water the plants Choose to run the program online or offline to see the effect If you are still not clear how to run online or upload offline, please refer to Quick Start

Case # Plant Watering Reminder

When the soil is relatively dry, it shows a crying face, and a smiling face at other times.