Outdoor soil moisture sensor

hello,

i am looking for an OUTDOOR soil moisture sensor that is compatible with Home Assistant.

Any suggestion? Any esp32 board that is suitable for outdoor use?

After trying a home waterproofed Miflora, then some Zigbee moisture sensors given the same treatment, I now use one of these: Soil Moisture Sensor - VH400

Good topic on reliable ESP32 boards:

ESPHome sensor calibration:

sensor:

  - platform: adc
    pin: GPIO36
    name: "Lawn Moisture Raw Voltage"
    id: raw_v
    unit_of_measurement: "V"
    device_class: voltage
    attenuation: 11db
    update_interval: 10s

  - platform: template
    name: "Lawn Moisture"
    unit_of_measurement: "%"
    device_class: humidity
    state_class: measurement
    lambda: |-
      return (id(raw_v).state);
    filters:
      - calibrate_polynomial:
          degree: 5
          datapoints:
          # Map from sensor -> true value
          - 0.1 -> 0
          - 0.2 -> 1
          - 0.3 -> 2
          - 0.4 -> 3
          - 0.5 -> 4
          - 0.6 -> 5
          - 0.7 -> 6
          - 0.8 -> 7
          - 0.9 -> 8
          - 1 -> 9
          - 1.1 -> 10
          - 1.2 -> 12.5
          - 1.3 -> 15.004
          - 1.4 -> 19.812
          - 1.5 -> 24.62
          - 1.6 -> 29.428
          - 1.7 -> 34.236
          - 1.8 -> 39.044
          - 1.9 -> 42.118
          - 2 -> 44.75
          - 2.1 -> 47.382
          - 2.2 -> 50.014
          - 2.3 -> 52.646
          - 2.4 -> 55.278
          - 2.5 -> 57.91
          - 2.6 -> 60.542
          - 2.7 -> 63.174
          - 2.8 -> 65.806
          - 2.9 -> 68.438
          - 3 -> 71.07
      - sliding_window_moving_average:
          window_size: 12
          send_every: 12
          send_first_at: 12

The raw voltage was just a sanity check I used to confirm my % moisture readings. You can omit it if you wish and just use:

sensor:

  - platform: adc
    pin: GPIO36
    name: "Lawn Moisture"
    attenuation: 11db
    update_interval: 10s
    device_class: humidity
    state_class: measurement
    filters:
      - calibrate_polynomial:
          degree: 5
          datapoints:
          # Map from sensor -> true value
          - 0.1 -> 0
          - 0.2 -> 1
          - 0.3 -> 2
          - 0.4 -> 3
          - 0.5 -> 4
          - 0.6 -> 5
          - 0.7 -> 6
          - 0.8 -> 7
          - 0.9 -> 8
          - 1 -> 9
          - 1.1 -> 10
          - 1.2 -> 12.5
          - 1.3 -> 15.004
          - 1.4 -> 19.812
          - 1.5 -> 24.62
          - 1.6 -> 29.428
          - 1.7 -> 34.236
          - 1.8 -> 39.044
          - 1.9 -> 42.118
          - 2 -> 44.75
          - 2.1 -> 47.382
          - 2.2 -> 50.014
          - 2.3 -> 52.646
          - 2.4 -> 55.278
          - 2.5 -> 57.91
          - 2.6 -> 60.542
          - 2.7 -> 63.174
          - 2.8 -> 65.806
          - 2.9 -> 68.438
          - 3 -> 71.07
      - sliding_window_moving_average:
          window_size: 12
          send_every: 12
          send_first_at: 12
2 Likes

Thanks for answering!!

is it power with battery?

From where did you buy?

The sensor is powered from the ESP32 5V rail, which is not battery powered.

The probes are available for purchase on the website I linked to.

I came across this recently. Haven’t looked at it in depth yet.

It would be so cool to have a ble equivalent of ESPHome, and use sensors like that moisture one you’ve linked (and lux sensors etc)

If you have an Ecowitt weather station or a GW1100 gateway, I’ve had good results from these battery powered soil moisture sensors.

1 Like

Nice solution. I read good reviews. So i can do my job with only the Wifi/RF Gateway plus the soil moisture sensor, right?

Yes, that is my understanding (Looks like you can buy this kit.) You only need the GW1100 gateway and the sensor. I have this package with 2 soil sensors, leaf wetness detector (not ingergrated with HA yet) and the CO2 Monitor. All (except leaf sensor) working well in HA.

1 Like

I discovered if you angle the leaf sensor (for water run off) it works as an extremely fast detecting “rain sensor”. Detects rain way before the rain gauge does.

ALSO: Make sure you install the provided black rubber cap on the soil sensor battery cover.

I’m quite curious about how these sensors transmit data.

They appear to use RF?

I don’t suppose you have a RF receiver and could try to capture a few signal packages?

With them being RF they shouldn’t need to be paired with a gateway, they should just start transmitting data when powered up?

It is RF (North American:915MHz; Europe:868MHz; Other areas:433MHz) and no, I don’t have a receiver.

1 Like

Just saw your edit, No (traditional) pairing needed, the gateway finds the devices ‘automatically’.

1 Like

Thanks. I was about to order one to have a tinker with.

But I initially mistook the USD price for my AUD currency and thought they were quite good value, but with conversion and shipping, I think they’re slightly too pricey for me.

Think I’ll stick with my DIY waterproofed Mi Flora’s for the moment. Not happy with battery life like a lot of others though…

I bought a bunch of these for indoor use a while ago but haven’t gotten around to using them yet.

AU $0.61 50%OFF | NEW ! Capacitive soil moisture sensor not easy to corrode wide voltage wire for arduino

Hey Tom, I’m still relatively new to a lot of this but I’ve worked with VH400 for years outside of home assistant and currently am trying to integrate them into ESPHome. I’ve been attempting to use the ESP8266 NodeMCU because of the onboard A0 pin but I have a bunch of ESP32’s laying around as well- just curious what your setup is to connect the VH400 analog to the ESP32?

I’m not sure what you mean, you just replied to the details of my setup?

Sorry I wasn’t clearer- there isn’t an analog pin on the ESP32’s right? Did you use an ADC device? I guess my real question is whether there was some advantage to using an ESP32 instead of an ESP8266

No there is not one, there are actually eighteen analogue inputs on the ESP32 :slight_smile:

So I didn’t bother with an external ADC. Even though the ESP32 ADC suffers from a bit of non-linearity at the extreme ends of the range too, just like the ESP8266 ADC.

The advantage is that I needed the extra i/o for other things (irrigation control) and I pretty much only buy Quniled ESP32s now. The performance is better, there are more i/o and built in hardware peripherals for little extra cost.

2 Likes

Wow, I had no idea the ESP32’s had a multiplexing feature like that. Thank you for the response!

I bought the v2.0 of these (Capacitive Soil Moisture Sensor Corrosion Resistant For Arduino Moisture Detection Garden Watering Diy - Sensors - AliExpress) and designed an outdoor 3D printed cover for them (Printables). They are not meant for outdoor use, but with some conformal coating and the cover, I am sure they will last a long time. More details are in the link for the printed cover and here goes the code I use with ESP32 in ESPHome (calibration might differ for you, I used an empty cup and a cup of water to get the extremes):

  - platform: adc
    pin: GPIO34
    name: "Soil Moisture"
    update_interval: 5s
    unit_of_measurement: "%"
    device_class: humidity
    state_class: measurement
    accuracy_decimals: 1
    icon: mdi:water-percent
    attenuation: auto
    filters:
    - sliding_window_moving_average:
        window_size: 60
        send_every: 60
        send_first_at: 60
    - calibrate_linear:
        - 2.48 -> 0.00
        - 0.93 -> 100.00
    - lambda: |
        if (x < 0) return 0; 
        else if (x > 100) return 100;
        else return (x);
4 Likes