These sensors loose the copper covering one electrode. Moreover, it provides very imprecise values, which decrease over days due to the copper corrosion on the electrode.
This SHT-10 based soil sensor fails when temperature falls while humidity is 100%. Due to the sinter metal mesh encloser, the condensed water stays for days
raspi-config # Interfacing Options -> I2C reboot
i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -
apt-get update apt-get install i2c-tools build-essential python-dev python-smbus python3-dev python3-smbus git python-pip python3-pip pip3 install adafruit-circuitpython-ads1x15
import time import board import busio import adafruit_ads1x15.ads1115 as ADS from adafruit_ads1x15.analog_in import AnalogIn # Create the I2C bus i2c = busio.I2C(board.SCL, board.SDA) # Create the ADC object using the I2C bus ads = ADS.ADS1115(i2c) # Create single-ended input on channel 00 chan0 = AnalogIn(ads, ADS.P0) chan1 = AnalogIn(ads, ADS.P1) chan2 = AnalogIn(ads, ADS.P2) # Create differential input between channel 0 and 1 #chan = AnalogIn(ads, ADS.P0, ADS.P1) print("{:>5}\t{:>5}\t\t{:>5}\t{:>5}\t\t{:>5}\t{:>5}".format('raw', 'v','raw', 'v','raw', 'v')) while True: print("{:>5}\t{:>5.3f}\t\t{:>5}\t{:>5.3f}\t\t{:>5}\t{:>5.3f}".format(chan0.value, chan0.voltage, chan1.value, chan1.voltage, chan2.value, chan2.voltage)) time.sleep(0.5)