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, the Raspberry Pi Pico µC 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 (with 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.

3. Humidity sensor

Prototypes are also utilized for relative humidity measurements with HIH 4020 sensor (see photos). Algorithm has to be modified for this as a matter of course. 

A very basic output in a web browser can look like this:

3. 7-Segment-Displays

At present I am using three different variants of common cathode 7-Segment-Displays which are pretty much interchangeable:

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

Red LEDs usually have the lowest threshold voltage, green LEDS the highest (keeping in mind the statistical dispersion with LEDs).


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. 

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.

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



Data sheet resistive type sensor.

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



CMOS BCD-to-7-Segment Latch Decoder Drivers. Note: VDD (Pin 16) = VBUS (5V). For common cathode 7-Segment-Display.

Adobe Portable Document Format - 1.18 MB - 03/30/2021 at 09:54


  • 1 × Raspberry Pi Pico µC
  • 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 4 project logs

Enjoy this project?



Does this project spark your interest?

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