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: Friday Sep-7-2018 22:22:12 PDT
Buy It Now for only: $3.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: Saturday Sep-8-2018 8:50:10 PDT
Buy It Now for only: $0.99
Digital TemperatureRelative Humidity Sensor DHT11 Module for Arduino
Digital TemperatureRelative Humidity Sensor DHT11 Module for Arduino $0.99
End Date: Sunday Sep-16-2018 5:31:54 PDT
Buy It Now for only: $0.99
for Raspberry Pi Humidity Sensor Module Temperature and Relative DHT11 2PCS
for Raspberry Pi Humidity Sensor Module Temperature and Relative DHT11 2PCS $5.94
End Date: Tuesday Sep-11-2018 9:39:17 PDT
Buy It Now for only: $5.94
1PCS Arduino DHT11 Temperature and Relative Humidity Sensor Module Useful
1PCS Arduino DHT11 Temperature and Relative Humidity Sensor Module Useful $0.99
End Date: Tuesday Aug-21-2018 0:25:37 PDT
Buy It Now for only: $0.99
DHT11 Temperature and Relative Humidity Sensor Module for arduino
DHT11 Temperature and Relative Humidity Sensor Module for arduino $1.08
End Date: Saturday Sep-8-2018 19:38:08 PDT
Buy It Now for only: $1.08
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: Monday Sep-3-2018 11:56:01 PDT
Buy It Now for only: $0.99
DHT11 12 22 AM2302 TemperatureHumidity Sensor Module Replace Arduino SHT11 15
DHT11 12 22 AM2302 TemperatureHumidity Sensor Module Replace Arduino SHT11 15 $0.92
End Date: Saturday Aug-18-2018 8:18:55 PDT
Buy It Now for only: $0.92
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: Tuesday Sep-11-2018 8:36:53 PDT
Buy It Now for only: $0.99
ESP8266 DHT11 ESP 01S Temperature Humidity WIFI Wireless Transceiver Module
ESP8266 DHT11 ESP 01S Temperature  Humidity WIFI Wireless Transceiver Module $1.79
End Date: Thursday Aug-23-2018 14:11:41 PDT
Buy It Now for only: $1.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>