Soil moisture measurement device

Control (visual and IoT) of soil moisture or air humidity w/ Raspberry Pi Pico

Similar projects worth following
This is a simple, durable and cheap soil moisture measurement device showing a double-digit value on two 7-Segment-Displays.

A probe (either resistive or capacitive type) delivers an analog value (i. e. voltage) representing the soil moisture, a Raspberry Pi Pico converts the sensor signal into a 16-bit (actually a 12-bit) digital value. This value is subsequently mapped to a 00-99 range by a MicroPython algorithm.

Other sorts of sensors (e.g. HIH 4020, relative humidity) could be connected in lieu of a moisture sensor (with a modified SW), for the concept of display is self-evidently generic.

I've also designed an IoT version of the device (not with Pico W, but with Pico+ESP8266), without any display at all.

1. Prototypes

1.1 IoT design w/ capacitive probe

1.2 Visual control w/ capacitive probe

1.3 Visual control w/ resistive probe

2. Soil moisture sensors

Either one of the following sensor types can be used for the moisture measurement (sensor output here connected to ADC0/GP26):

  • Capacitive type sensor HW-390 (also referred to as v2.0)
  • Resistive type sensor ME110

An initialization routine identifies the connected sensor type (see MicroPython code in my github repo). The capacitive probe should be preferred though since that is the durable sensor that won't corrode - the anode of the ME110 will be corroded after a few hours of operation.

3. Humidity sensor

Prototypes are also utilized for relative humidity measurements with HIH 4020 sensor (7-Segment-Display as well as IoT version). Parts of the already created algorithm had to be enhanced and modified for this obviously (see links to my github repo).

A basic output in a web browser (as to the light sensor, see project log):

Note: there are some robustness measures for the webserver in place, such as using the HW watchdog and using a port different from standard http port 80 (that is dealing with a lot of useless data and requests what may generate confusion in an algorithm).

4. 7-Segment-Displays

I am using three different variants of common cathode 7-Segment-Displays which have slightly different electrical characteristics (they're identical in regards to geometry):

  • SC56-11GWA: green
  • SC56-11EWA: red
  • SC56-11YWA: yellow (those I personally like the most)

This means that red LEDs have the lowest threshold voltage, green LEDS the highest (keeping in mind the statistical dispersion with individual LEDs).


1. Though the ADC of the Pico has some problems, it is surely good enough for this kind of application.

2. Driving the segments (i. e. LEDs) of the 7-Segment-Displays directly is probably not good an idea since one individual Pico GPIO can deliver 12 mA at most, and it is unclear what the Pico's supply current upper limit is (on all its GPIOs combined). The documentation states something about 50mA, what is clearly not enough to drive a lot of segments at once. 

3. The CD4511BE driver has a V_BE voltage drop (see data sheet), and so have the multiplexing transistors. That leads to a diminished voltage budget for the segment LEDs and the resistors R1-R7, respectively, what must be taken into account when calculating the resistor values.


Datasheet phototransistor

Adobe Portable Document Format - 399.44 kB - 07/18/2023 at 04:23


Characterization of Low-Cost Capacitive Soil Moisture Sensors for IoT Networks.pdf

Background information about the capacitive type sensor (source: google search).

Adobe Portable Document Format - 3.77 MB - 05/29/2023 at 08:00



The schematic for the most recent prototype.

JPEG Image - 152.52 kB - 03/05/2023 at 06:57



7-Segment-Display red, common cathode. Green: SC56-11GWA. Yellow: SC56-11YWA.

Adobe Portable Document Format - 184.35 kB - 08/11/2021 at 15:03



Datasheet resistive type sensor.

Adobe Portable Document Format - 390.11 kB - 05/16/2021 at 05:56


View all 6 files

  • 1 × Raspberry Pi Pico Microcontroller board
  • 1 × Moisture Sensor Iduino ME110 (resistive) Probe
  • 7 × Resistor 47 Ohm Value can be increased for red 7-Segment-Displays
  • 1 × CD4511BE Logic ICs / Decoders, Encoders, Multiplexers, Demultiplexers
  • 1 × DIY Board or custom-made PCB plus cables, connectors etc.

View all 9 components

View all 5 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates