Picking the sensors​

A project log for Soil moisture monitoring in a flower garden

When do your flowers have enough water, and how do you know?

Joseph EoffJoseph Eoff 03/02/2021 at 20:257 Comments

There are tons of soil moisture sensors available, and tons of plans for them available on the internet.

Sadly, most of the ones intended for hobbyist use are actually rather useless.

These things need to sit outside - rain, shine, watering can, and garden hose.

So, tell me why none of the hobbyist models are water proof.  Tell me why they have wires.

I compared a lot of commercially available sensors, and looked at a lot of DIY designs, and couldn't convince myself that they were any more than playthings for learning the principles of how such things work - but were not really working tools.

There's comparable equipment for professionals, but the good stuff is too expensive for hobby use - and the low end stuff is as bad as the hobbyist stuff.

After much searching, I found these sensors made by Xiaomi:

That's a waterproof, battery powered, Bluetooth connected sensor for moisture, nutrients, temperature, and light.

The hardware is pretty decent, and the software is fine if all you are doing is monitoring a couple of potted house plants.

The hardware has two things going for it:

  1. There's compatible hardware sold under different names that are cheaper.
  2. There are open source projects that provide libraries to read the data from the sensors.

I used a handful of those sensors last summer to track the soil moisture in selected spots in the garden - running around the yard with my Android phone every couple of days to collect the data from the scattered sensors.

From that data I made a few charts, including this one which shows how the soil moisture varies over the course of the day, and that the soil dried out somewhat over a period of a about a month:

I intend to space sensors in a one meter grid across the garden, and make "heat map" style charts of the moisture for every day over the coming spring and summer.


There are several companies that produce compatible hardware.

I have found similar sensors from Xiaomi, VegTrug, Royal Gardineer, and Wanfei.

They are all "four in one" (moisture, fertilizer, temperature, and light) sensors with Bluetooth.

My Royal Gardineer sensors work with the same software that I got with my Xiaomi branded sensors.

Collectively, the sensors are known as "mi flora" sensors.

There's more information about them in the miflira GitHub repository.

If you search a bit, you will find several projects (Python, ESP32, and probably others) that implement the miflora protocol.


Chris Gervang wrote 03/23/2021 at 18:15 point

Hey, just thought I’d let you know I got 10 Vegtrug sensors installed. Pretty smooth experience. I did a soil drying experiment (sample size 1 so far) to correlate % moisture to water % by weight, and it’s inconclusive at one sample but interesting to come up with the technique. I used an old air fryer (convection oven) to quickly dry 240ml of packed soil, weighing it before and after. Came out to 20% water by volume and weight (50g).

I also found a website that suggests a good rule of thumb is to assume Soil is around 55% of the volume in a sample, with the remainder being Air.

Next I want to fully saturate my soil, and run a few more controlled scenarios: Drying soil completely, starting with a consistent volume and weight of soil. Then adding a controlled amount of water, mixing it well, taking sensor measurements.

It may not correlate well in the end, and I’ve read plenty of research oriented reviews saying resistance based sensors aren’t suited for science (and I think these are resistance based?? Let me know). But it’s fun.

  Are you sure? yes | no

Chris Gervang wrote 03/07/2021 at 21:34 point

Have you researched the ECOWITT WH51 system?

They only measure humidity, have a gateway for 8 sensors, and it seems data collection is over http endpoint. I am interested in them, but haven't found a super great open source library - this was the most promising:
And a MQTT convertor

  Are you sure? yes | no

Joseph Eoff wrote 03/07/2021 at 21:51 point

Nope.  I don't recall seeing those at all.

I just checked, and they do have the Ecowitt equipment - but it costs more than the miflora sensors and it seems you need at least one base station. says the Ecowitt sensors aren't currently available.

  Are you sure? yes | no

Chris Gervang wrote 03/07/2021 at 19:14 point

Thanks for posting all these learnings! I’m also interested in tracking moisture throughout my garden boxes. I was wondering if you could share a little more about how to get the components you’re using?

I was wondering too if you’ve run across sensors that I could bury at the bottom and middle of boxes? I think it’d be super interesting to track a matrix and see that I’m always watering deep enough.

  Are you sure? yes | no

Joseph Eoff wrote 03/07/2021 at 19:35 point

Hi, Chris.  The original sensors I used were from Xiaomi.  Most of the ones I have now are from Royal Gardineer.  Same gadget, different name on the package.

I bought mine from Amazon, but that's not  The American site doesn't seem to carry them.

Here's a link to the page of one seller:

This is a search on that returns the Wanfei and Vegtrug versions:

They all speak the same Bluetooth protocol and can be used pretty much interchangeably with the software from other manufacturers.

  Are you sure? yes | no

Chris Gervang wrote 03/07/2021 at 21:23 point

Thanks for the links. Looks like I can get a Wanfei sensor in the states!

  Are you sure? yes | no

Joseph Eoff wrote 03/07/2021 at 19:50 point

I've updated the log entry with more information on the sensors.

I saw some sensors last year while I was searching that could be buried at different depths.  They were wired sensors, and more expensive than I liked, so I didn't pay much attention to them.  I don't remember what search terms I used to find them - that was last year in March or April.

  Are you sure? yes | no