Indoor Plants-monitoring Device

Indoor Plants-monitoring Device


It is set for people who are too busy to water the plants. With the help of the temperature and moisture sensor, the soil moisture sensor and the light sensor, it’s able to detect the status of the plants and have the data displayed on the OLED dispay, also, the LED would light on for reminding us of watering the plants.

micro:bit x 1

Nezha expansion board x 1

Soil moisture sensor x 1

BME280 Temp. and moisture sensor x 1

Light sensor x 1

Rainbow LED x 1

OLED display x 1

RJ11 wires x 5

Bricks x N


Nezha expansion board is able to get connected with Lego bricks, please assemble a device as the below picture indicates:

Hardware Connections

Connect the light sensor to J1 port; soil moisture sensor to J2; rainbow LED to J3; OLED display and BME 280 to IIC port on Nezha expansion board.

Software programming

Go to MakeCode editor:( Nehza extension package by clickinig “Advanced” in the settings on the right upper side.

Search with “Planet X” in the dialogue box and download it.

Code: Programme to show icon while on start, initialize the rainbow LED connecting to J3 port.

Display the value of temperature sensor, moisture sensor, light intensity and soil moisture sensor on the OLED display in forever brick.

Judge if the value from the soil moisture is below 40, if yes, set the rainbow LED light on in red and flash; if the value is over 50, set the rainbow LED light on in green.

Completed code:



TThe value of the temperature, moisture, light intensity and soil moisture in the current environment will display on the OLED screen. If the value of the soil moisture is below the setting point, the LED flashes in red for reminding or it lights on in green.