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 $3.99
End Date: Sunday Mar-11-2018 22:22:12 PDT
Buy It Now for only: $3.99
5X DHT11 Temperature and Relative Humidity Sensor Module for arduino
5X DHT11 Temperature and Relative Humidity Sensor Module for arduino $9.98
End Date: Wednesday Feb-28-2018 11:35:01 PST
Buy It Now for only: $9.98
Temperature and Relative for Raspberry Pi 2PCS Humidity Sensor Module DHT11
Temperature and Relative for Raspberry Pi 2PCS Humidity Sensor Module DHT11 $5.97
End Date: Saturday Mar-10-2018 8:32:51 PST
Buy It Now for only: $5.97
DHT11 Temperature and Humidity Sensor Module for Arduino UNO MEGA 2560 AVR PIC
DHT11 Temperature and Humidity Sensor Module for Arduino UNO MEGA 2560 AVR PIC $1.29
End Date: Friday Mar-2-2018 1:12:05 PST
Buy It Now for only: $1.29
ESP8266 DHT11 Temperature Humidity WiFi Wireless Module Pin Adapter ESP 01 01S
ESP8266 DHT11 Temperature Humidity WiFi Wireless Module Pin Adapter ESP 01 01S $4.66
End Date: Thursday Mar-8-2018 6:36:44 PST
Buy It Now for only: $4.66
New DHT11 Temperature and Relative Humidity Sensor Module for arduino
New DHT11 Temperature and Relative Humidity Sensor Module for arduino $1.09
End Date: Monday Feb-19-2018 2:40:52 PST
Buy It Now for only: $1.09
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: Tuesday Mar-13-2018 0:20:27 PDT
Buy It Now for only: $0.99
1PCS Arduino DHT11 Temperature and Relative Humidity Sensor Module NEW
1PCS Arduino DHT11 Temperature and Relative Humidity Sensor Module NEW $1.09
End Date: Monday Mar-12-2018 23:35:24 PDT
Buy It Now for only: $1.09
1X DHT11 Temperature and Relative Humidity Sensor Module for arduino
1X DHT11 Temperature and Relative Humidity Sensor Module for arduino $4.59
End Date: Sunday Mar-11-2018 22:14:01 PDT
Buy It Now for only: $4.59
Automatic DHT11 Digital Temperature And Humidity Sensor Moudle Probe for Arduino
Automatic DHT11 Digital Temperature And Humidity Sensor Moudle Probe for Arduino $0.99
End Date: Wednesday Mar-7-2018 10:56:01 PST
Buy It Now for only: $0.99

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