Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106286

Soil Moisture Sensor sends bad data

$
0
0

Hi everyone,

I asked a similar question before but I don´t really move forward.
I have a soil moisture sensor (This one: Bodenfeuchtesensor, Feuchte-Detektor und Pflanzenfeuchte-Messgerät) and a NodeMCU V2. Because of the soil moisture I want that either pumps pump water or valves open for the watering. But the sensor gives the following data:
60 % → 0,67188 V
63 % → 0,66992 V
0% → 0,67090 V
12 % → 0,67285 and/or 0,67383
100% → 0,67480.
For once the data is very very close together and the other thing is, you see that, 0% moisture has a higher Voltage than 63 % (The % is measured by a expensive sensor from a friend). I looked into some other post and they have a difference of 0,4 V between 0 and 100 %. The current code is below. Additional a water flow sensor is installed at the board which works.

esphome:
  name: bdf-sp-m
  friendly_name: BDF_SP_M

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: ""

ota:
  - platform: esphome
    password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bdf-Sp-M Fallback Hotspot"
    password: ""

captive_portal:

sensor:
  - platform: adc
    pin: A0
    name: "BDF_SP_M.1"
    id: moisture_sensor
    update_interval: 60s
    accuracy_decimals: 4

  - platform: pulse_counter
    name: "Water Flow"
    id: flow_sensor
    pin: 2  # Change to GPIO 2 (D4)
    state_class: measurement
    filters:
      - lambda: return (x / 400.0);  # Convert pulses to L/min
    unit_of_measurement: "L/min"

  - platform: integration
    name: "Water Consumption"
    device_class: water
    state_class: total_increasing
    unit_of_measurement: 'm³'
    accuracy_decimals: 4
    sensor: flow_sensor
    time_unit: s
    icon: "mdi:water"
    filters:
      - lambda: return (x / 1000);  # Convert to m³

I connected the sensor the following way:

Sensor Node MCU V2
+ GND
- 3,3V
D0 Nothing
A0 A0

If I switch + and - the P LED glows, the way it should be but the Data gets even more ridiculous:
In soil: 0,1 V
In Air: 0,55 V (!!!)
I had the sensor also now a couple of minutes in water. The voltage increased all the time. I set the update interval to 10 seconds. Two measurements in row showed the same voltage, the next one increased always be 0,0098 V.
I´m still new to this and I have no idea what I´m doing wrong or what I have to do.
If anyone has an idea I would be so grateful. Thanks in advance :slight_smile:

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106286

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>