Connection
First, connect the cable to the capacitive sensor and then place the other side of the cable into the first slot on the universal fixture. Make sure that the sensor does not come into contact with liquids during assembly or during measurement.
When connecting, the expansion board must be turned off and the micro:bit disconnected from the power supply. After connecting the sensor to the universal fixture, the fixture can be turned on using the power switch and the measurement can begin.
Programme
Basic program
According to the instructions, we connected the capacitive sensor to the universal fixture. To open the sample program, click on the arrow in the upper right corner, which will redirect you to the MakeCode environment. This program serves as a sample for capacitive sensors version 2.0 and works with data obtained from pin 2, to which the sensor is connected.
The program evaluates the moisture values as follows: if the value is higher than 700, the micro:bit signals that the probe is not inserted into the soil. A value between 380 and 700 indicates a dry substrate and watering is recommended. If the value is between 280 and 380, the moisture is sufficient. Remember that the values given are only indicative - different types of plants may require different levels of watering.



