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
5PCS DHT11 Temperature and Relative Humidity Sensor Module for arduino
5PCS DHT11 Temperature and Relative Humidity Sensor Module for arduino $9.98
End Date: Thursday May-11-2017 14:16:44 PDT
Buy It Now for only: $9.98
2X 2PCS DHT11 Temperature and Relative Humidity Sensor Module for arduino
2X 2PCS DHT11 Temperature and Relative Humidity Sensor Module for arduino $5.98
End Date: Monday May-22-2017 1:42:29 PDT
Buy It Now for only: $5.98
DHT11 Digital Temperature and Humidity Sensor Humiture Sensor for Arduino
DHT11 Digital Temperature and Humidity Sensor Humiture Sensor for Arduino $8.20
End Date: Thursday May-11-2017 10:13:26 PDT
Buy It Now for only: $8.20
DHT11 Temperature and Relative Humidity Sensor Module for arduino
DHT11 Temperature and Relative Humidity Sensor Module for arduino $1.19
End Date: Wednesday May-10-2017 20:38:43 PDT
Buy It Now for only: $1.19
New DHT11 Temperature and Relative Humidity Sensor Module for arduino
New DHT11 Temperature and Relative Humidity Sensor Module for arduino $4.49
End Date: Monday May-1-2017 11:12:31 PDT
Buy It Now for only: $4.49
5 PCS DHT11 Digital Temperature Humidity Sensor Moudle Probe For HVAC Arduino
5 PCS DHT11 Digital Temperature Humidity Sensor Moudle Probe For HVAC Arduino $8.26
End Date: Saturday May-6-2017 3:24:56 PDT
Buy It Now for only: $8.26
New DHT11 Temperature and Relative Humidity Sensor Module for arduino
New DHT11 Temperature and Relative Humidity Sensor Module for arduino $4.49
End Date: Thursday May-4-2017 12:33:18 PDT
Buy It Now for only: $4.49
5 PCS DHT11 Digital Temperature Humidity Sensor Moudle Probe For HVAC Arduino US
5 PCS DHT11 Digital Temperature Humidity Sensor Moudle Probe For HVAC Arduino US $6.99
End Date: Wednesday Apr-26-2017 1:52:05 PDT
Buy It Now for only: $6.99
DHT11 Digital Temperature and Humidity Sensor NEW CA
DHT11 Digital Temperature and Humidity Sensor NEW CA $0.88
End Date: Wednesday May-24-2017 7:22:23 PDT
Buy It Now for only: $0.88
1PCS DHT11 DHT22 AM2320 AM2302 Digital Temperature Humidity Wemos Sensor M85
1PCS DHT11 DHT22 AM2320 AM2302 Digital Temperature Humidity Wemos Sensor M85 $3.14
End Date: Friday May-19-2017 8:36:53 PDT
Buy It Now for only: $3.14

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