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
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: Friday Dec-13-2019 12:01:15 PST
Buy It Now for only: $4.99
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: Wednesday Dec-11-2019 7:50:10 PST
Buy It Now for only: $0.99
Digital TemperatureRelative Humidity Sensor DHT11 Module for Arduino
Digital TemperatureRelative Humidity Sensor DHT11 Module for Arduino $1.14
End Date: Friday Dec-27-2019 4:31:54 PST
Buy It Now for only: $1.14
DHT11 Temperature and Relative Humidity Sensor Module for arduino
DHT11 Temperature and Relative Humidity Sensor Module for arduino $1.08
End Date: Wednesday Dec-25-2019 18:38:08 PST
Buy It Now for only: $1.08
5pcs DHT11 Digital Temperature and Humidity Sensor NEW
5pcs DHT11 Digital Temperature and Humidity Sensor NEW $3.56
End Date: Wednesday Dec-25-2019 18:48:46 PST
Buy It Now for only: $3.56
1PCS DHT11 DHT22 AM2320 AM2302 Digital Temperature Humidity Wemos Sensor M85
1PCS DHT11 DHT22 AM2320 AM2302 Digital Temperature Humidity Wemos Sensor M85 $0.99
End Date: Friday Dec-20-2019 7:36:53 PST
Buy It Now for only: $0.99
1 2 5 10PCS DHT11 Temperature and Relative Humidity Sensor Module for Arduino
1 2 5 10PCS DHT11 Temperature and Relative Humidity Sensor Module for Arduino $0.99
End Date: Saturday Dec-28-2019 18:21:36 PST
Buy It Now for only: $0.99
New 1Pcs DHT11 Humidity Sensor Module for arduino Temperature and Relative US
New 1Pcs DHT11 Humidity Sensor Module for arduino Temperature and Relative US $3.89
End Date: Monday Jan-6-2020 9:02:11 PST
Buy It Now for only: $3.89
DHT11 12 22 AM2302 TemperatureHumidity Sensor Module Replace SHT11 15 Arduino
DHT11 12 22 AM2302 TemperatureHumidity Sensor Module Replace SHT11 15 Arduino $1.27
End Date: Sunday Jan-5-2020 19:01:56 PST
Buy It Now for only: $1.27
ESP8266 DHT11 ESP 01 01S Temperature Humidity WiFi Transceiver Module Adapter
ESP8266 DHT11 ESP 01 01S Temperature Humidity WiFi Transceiver Module Adapter $1.70
End Date: Friday Dec-27-2019 19:39:25 PST
Buy It Now for only: $1.70

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