Connecting a soil moisture sensor to the Blue Pill board
We will start this section by learning how to use a sensor to measure soil humidity in a plant pot, and you will later learn how to connect it to the STM32 Blue Pill board to build a plant pot moisture-monitoring system.
Introducing soil moisture sensors
A soil moisture sensor consists of two pads that measure the amount of water in the soil. The sensed value is acquired by allowing the the electric current running through the soil to pass through, and according to resistance, this shows the level of humidity in the plant pot.
You can find a generic breakout module that is pretty straightforward to use. This is shown in the following photo:
The pads are connected to the breakout board with the included female-to-female jumper wires. The breakout board connects to the STM32 Blue Pill board with four pins, outlined as follows:
-
...