2

I've been playing with the DHT22, but the humidity values are very intriguing.

During the night or indoors the sensor is returning 99%. While the temperature values looks good.

Here is a visualization for the last 12 hours: enter image description here

Before 10:30 the sensor was indoor, I put it out to test if I still have the same values. The sensor is fully exposed to the sun after 10:30.

I'm using the Adafruit DHT python library to fetch the values:

import Adafruit_DHT as dht
import time


def get_data(sensor, pin):
    h, t = dht.read_retry(sensor, pin)
    return h, t


def main_loop():
    while True:
        h,t = get_data(dht.DHT22, 4)
        payload = {
            'temperature': round(t, 2),
            'humidity': round(h, 1),
            'timestamp': int(time.time() * 1000)}
        print payload
        time.sleep(60)



if __name__ == '__main__':
    main_loop()

As you can see, the sensor is plugged in the GPIO#4 of the RPi3.

I don't know if this is a problem, if the sensor is broken, but 99% humidity is very excessive.

Since I don't have anything else to verify these values, how can I understand the problem and fix it ?

  • 1
    "the temperature values looks good" -> Are you sure? It jumps 10 degrees in as many minutes at about the same time as the humidy seems to be correcting (10:30-40). There are also some excessive inverse value changes in this table generally, I think. You should really explain how you are taking the measurements if you expect anyone to make an informed guess about the issue. – goldilocks Sep 11 '16 at 18:23
  • 1
    What is the question? – joan Sep 11 '16 at 19:00
  • 2
    You shoud not expose a DHT22 directly to the sun. For more, please read: electronics.stackexchange.com/questions/236530/… – Rui F Ribeiro Sep 11 '16 at 19:54
  • 1
    Try different software, e.g. my abyz.co.uk/rpi/pigpio/examples.html#pdif2_DHTXXD – joan Sep 11 '16 at 20:32
  • 1
    Connect the sensor to a +3V pin, instead of a +5V pin (that was my main problem in the link above) – Rui F Ribeiro Sep 12 '16 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.