DHT11 Humidity Sensor

DHT11 Humidity SensorRequires 4.7k Resistor

I went for a plane unmounted version

http://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging

I've had lots of issues reading the humidity which is why the code is so long.  It takes a parameter HumidyPin which is the pin the sensor is attached to.  I now have 2 sensors attached to the system hence why it's a parameter.  It's hard coded for a type 11 sensor

The code uses the Adafruit humidity application

def pdshumidity(HumidityPin):
    if debug:
        print("Reading Humidity")
    LoopCount=0
    if debug:
        print('Trying Humidity = loop count ' + str(LoopCount))
        print("          Starting try for Humidity")
    output = subprocess.check_output(["/home/pi/pds/Adafruit_DHT", "11", str(HumidityPin)]);
    if debug:
        print("          Finished trying Hunmidity")

    matches = re.search("Hum =\s+([0-9.]+)", output)

    if debug:
        print("          Trying to find matches")

    while (not matches):
        output = subprocess.check_output(["/home/pi/pds/Adafruit_DHT", "11", str(HumidityPin)]);
        matches = re.search("Hum =\s+([0-9.]+)", output)
        LoopCount = LoopCount+1
        if debug:
            print('     Humidity loop count ' + str(LoopCount))
        if (LoopCount > 1):
            if debug:
                print('     Humidity sleeping due to failure ' + str(LoopCount))
            time.sleep(10)
        if (LoopCount > 20):
            humidity = 0
            matches = 1
    humidity = float(matches.group(1))
    if debug:
        print("          Humidity check finished")

    return humidity
1X DHT11 Temperature and Relative Humidity Sensor Module for arduino
1X DHT11 Temperature and Relative Humidity Sensor Module for arduino $4.95
End Date: Saturday Aug-1-2020 9:45:20 PDT
Buy It Now for only: $4.95
1PCS Arduino DHT11 Temperature and Relative Humidity Sensor Module New
1PCS Arduino DHT11 Temperature and Relative Humidity Sensor Module New $1.70
End Date: Friday Jul-24-2020 0:25:35 PDT
Buy It Now for only: $1.70
DHT11 Digital Temperature and Humidity Sensor for Arduino DHT 11
DHT11 Digital Temperature and Humidity Sensor for Arduino DHT 11 $1.70
End Date: Sunday Jul-5-2020 2:38:18 PDT
Buy It Now for only: $1.70
DHT11 Temperature and Relative Humidity Sensor Module for arduino
DHT11 Temperature and Relative Humidity Sensor Module for arduino $1.08
End Date: Saturday Jul-25-2020 19:38:08 PDT
Buy It Now for only: $1.08
New DHT11 Temperature And Relative Humidity Sensor Module For Arduino
New DHT11 Temperature And Relative Humidity Sensor Module For Arduino $0.15 (2 Bids)
End Date: Thursday Jul-9-2020 20:01:35 PDT
3 Pack DHT11 Digital Temperature and Humidity Sensor Temperature sensor Arduino
3 Pack DHT11 Digital Temperature and Humidity Sensor Temperature sensor Arduino $6.99
End Date: Friday Jul-17-2020 2:08:41 PDT
Buy It Now for only: $6.99
5X DHT11 Temperature and Relative Humidity Sensor Module for arduino
5X DHT11 Temperature and Relative Humidity Sensor Module for arduino $14.99
End Date: Saturday Jul-4-2020 18:19:00 PDT
Buy It Now for only: $14.99
DHT 11 DHT11 Digital Temperature and Humidity Sensor Temperature Sensor
DHT 11 DHT11 Digital Temperature and Humidity Sensor Temperature Sensor $0.10 (1 Bid)
End Date: Tuesday Jul-7-2020 23:46:26 PDT
3X 3 PCS DHT11 Temperature and Relative Humidity Sensor Module for arduino
3X 3 PCS DHT11 Temperature and Relative Humidity Sensor Module for arduino $9.75
End Date: Tuesday Jul-7-2020 11:15:26 PDT
Buy It Now for only: $9.75
DHT 11 DHT11 Digital Temperature Relative Humidity Sensor Module Arduino 5PCS
DHT 11 DHT11 Digital Temperature Relative Humidity Sensor Module Arduino 5PCS $16.79
End Date: Wednesday Jul-22-2020 16:59:39 PDT
Buy It Now for only: $16.79

« Previous12345...910

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>