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 $2.95
End Date: Saturday Feb-1-2020 8:45:20 PST
Buy It Now for only: $2.95
DHT11 Temperature and Relative Humidity Sensor Module for arduino with cable
DHT11 Temperature and Relative Humidity Sensor Module for arduino with cable $0.99
End Date: Tuesday Feb-11-2020 7:50:10 PST
Buy It Now for only: $0.99
3 Pack DHT11 Digital Temperature and Humidity Sensor Temperature sensor Arduino
3 Pack DHT11 Digital Temperature and Humidity Sensor Temperature sensor Arduino $4.99
End Date: Thursday Feb-13-2020 12:01:15 PST
Buy It Now for only: $4.99
DHT11 Temperature and Relative Humidity Sensor Module for arduino
DHT11 Temperature and Relative Humidity Sensor Module for arduino $1.08
End Date: Saturday Jan-25-2020 18:38:08 PST
Buy It Now for only: $1.08
DHT11 DHT 11 Digital Temperature and Humidity Sensor Temperature sensor Arduino
DHT11 DHT 11 Digital Temperature and Humidity Sensor Temperature sensor Arduino $0.99
End Date: Sunday Feb-16-2020 2:39:32 PST
Buy It Now for only: $0.99
1PCS Arduino DHT11 Temperature and Relative Humidity Sensor Module Hot
1PCS Arduino DHT11 Temperature and Relative Humidity Sensor Module Hot $1.00
End Date: Thursday Jan-23-2020 23:25:37 PST
Buy It Now for only: $1.00
5X DHT11 Temperature and Relative Humidity Sensor Module for arduino
5X DHT11 Temperature and Relative Humidity Sensor Module for arduino $8.75
End Date: Saturday Feb-15-2020 21:22:12 PST
Buy It Now for only: $8.75
Digital DHT11 DHT 11Temperature and Humidity Sensor Temperature sensor Arduino
Digital DHT11 DHT 11Temperature and Humidity Sensor Temperature sensor Arduino $1.04
End Date: Sunday Feb-9-2020 22:36:29 PST
Buy It Now for only: $1.04
DHT11 Temperature Humidity Sensor Module Digital Humidity Sensor w Dupont Wires
DHT11 Temperature Humidity Sensor Module Digital Humidity Sensor w Dupont Wires $3.60
End Date: Monday Feb-10-2020 5:17:11 PST
Buy It Now for only: $3.60
DHT11 New Humidity Sensor Module for arduino Temperature and Relative
DHT11 New Humidity Sensor Module for arduino Temperature and Relative $3.88
End Date: Thursday Feb-6-2020 6:21:04 PST
Buy It Now for only: $3.88

« 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>