Simple soil moisture measurement

Moisture measurement with the Raspberry Pi Pico

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

A sensor (either resistive ME-110 or capacitive HW-390) evaluates the soil moisture, the Raspberry Pi Pico microcontroller converts the sensor signal into a 16bit digital value.

Excluding the Pico and the sensor, the material costs can be as low as 2€ (I bought a whole bag of 7-Segment-Displays on discount for around 3€, for example). With a custom made PCB, a capacitive sensor and the Pico around 12€.

That means this device is quite easy to modify dependent how much money one wants to spend, e.g. running several sensors simultaneously (Pico has three ADCs) or even changing the method of display entirely (e.g. LCD I2C-Display, OLED).

PCBs provided by the courtesy of

Either one of these sensor types can be used if you choose to flash the code from my github repository (with sensor output connected to ADC0/GP26, Pin 31):

  • capacitive type sensor HW-390
  • resistive type sensor ME-110

What you see in the photo are the first prototypes with custom made PCB (Version 1.0):

Currently the algorithm is capable to distinguish between both sensor types during an initialisation procedure.

You'll find more descriptions and explanations in the code comments.

Further HW/SW improvements might or should include:

  • "hiding" the Pico under the PCB (new design) and getting rid of all the green/white wiring (that just maintains some flexibility with the PCB prototype and is used for fault-injection test, but is otherwise obsolete)
  • reducing the overall geometrical size of the device
  • getting rid of the CD4511BE ICs, the Pico drives the segments directly (the advantage with the ICs is however that you use just 8 Pico ports instead of 14 and the Pico GPIOs are not "stressed" with high current for the segments; with VBUS you can get easily 30mA for one individual segment (brightness), while a GPIO can provide max. 14mA)
  • getting rid of 5 resistors and 1 CD4511BE IC by implementing a multiplexing logic with 2 transistors (however, this measure reduces costs not significantly if you use only two displays)
  • running several sensors simultaneously on one single PCB (with switching every few seconds between the sensor values on the 7-Segment-Display)
  • alternative power supply via e.g. solar cells
  • wireless sensor (might abandon this idea completely in order to keep costs low)
  • downsizing to a cheaper microcontroller

Further ideas appreciated.


Transistor for the multiplexing logic (here for SC56-11EWA, red). Many different transistors possible, use what is available.

Adobe Portable Document Format - 259.49 kB - 10/05/2021 at 12:24



Transistor for the multiplexing logic (here for SC56-11GWA, green). Many different transistors possible, use what is available.

Adobe Portable Document Format - 212.59 kB - 08/25/2021 at 04:16



Single Digit Numeric Display with common cathode.

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



Schematic circuit diagram. Pin numbers for the 7-Segment-Display depend on the individual module you use (in this schematic used: SC56-11).

Adobe Portable Document Format - 39.80 kB - 08/11/2021 at 14:52



Data sheet resistive type sensor.

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


View all 7 files

  • 1 × Raspberry Pi Pico
  • 1 × Moisture Sensor Iduino ME110 (resistive)
  • 14 × Resistor 47 Ohm Value should be increased for red 7-Segment-Displays (100 Ohm or even more). Had never problems with 47 Ohm resistors though
  • 2 × CD4511BE Logic ICs / Decoders, Encoders, Multiplexers, Demultiplexers
  • 1 × BC56-11EWA Displays and Inverters / LED Displays

View all 10 components

View project log

Enjoy this project?



Similar Projects

Does this project spark your interest?

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