Python Code to Interface DHT11 sensor with Raspberry Pi
#DHT11 sensor measures both air temperature and moisture. Relative humidity is the ratio of
#actual moisture in the air to the highest amount of moisture air at that temperature can hold.
#DHT11 is connected to GPIO pin.
type = 11
pin = 04
temp, hum=dhtreader.read(type, pin)
if temp and hum:
print dhtreader.read(type, pin)
print “Humidity=”, hum,”%”,”\n”
print “No data”