How to Detect Soil Humidity with Microbit
Overview
In life, you may often water some flowers and plants from time to time to prevent them from withering, but not need to pour more. It may requires experience. So can we make a system that allows the machine to automatically water the plants’ soil when it is dry? Of course yes.
In this project, you will learn how to use a soil sensor and micro:bit to detect the humidity of your plants’ soil. Display the analog value on the micro:bit LED matrix or on the serial monitor. The greater the humidity, the greater the analog value.
Note: We recommend you to purchase a water pump(not included in this kit) and make an automatic watering system by relay module.
Component Required
-
Micro:bit main board*1
-
Keyestudio Micro bit Sensor V2 Shield*1
-
USB Cable*1
-
keyestudio Soil Humidity Sensor*1
-
DuPont jumper wire*3
-
Premium Battery Holder 6-cell AA*1
-
1.5V AA Battery*6
Component Introduction
Soil Humidity Sensor:
This simple soil sensor is ideal for detecting the humidity of your plants’ soil. If the soil lacks the water, the analog value output by the sensor will decrease, otherwise, it will increase.
Connection Diagram
Test Code
Test Results
Wire up according to connection diagram. Plug in external power and upload code to micro:bit,open CoolTerm, click Options and select SerialPort, set COM port and baud rate(115200). Click OK and Connect. Insert soil humidity sensor into soil. The humidity value varies with the humidity. The higher the humidity is, the larger the humidity value will be.
When the humidity value is more than 500, micro: bit will display“”, otherwise, “
” will appear.