DHT22 temperature sensor with Raspberry Pi- can't get working

Thread Starter

Leo17

Joined Nov 18, 2020
16
Hello! So, for a project i am using a DHT22 temperature sensor with my Raspberry Pi. (https://www.optimusdigital.ro/en/te...2-temperature-and-humidity-sensor-module.html this is the sensor) and i cannot get it installed and at this point i don't even know if it's working or not.
I installed the adafruit library and tried multiple scripts for it but everytime it says "Sensor not found check wiring"- or something similar. Only once when i connected it to the data pin 7 it said that "Unable to set line 7 as input". Do you guys have any idea what to do? Is there any other libraries instead of the one from Adafruit so i can try it as well? And how can i check if it's working or not?
 

Wolframore

Joined Jan 21, 2019
2,609
Please post exactly how you wired, picture or schematic if you’re able to provide one. What seems obvious is not to others reading this and may help to diagnose.
 

HW-nut

Joined May 12, 2016
97
Hello! So, for a project i am using a DHT22 temperature sensor with my Raspberry Pi. (https://www.optimusdigital.ro/en/te...2-temperature-and-humidity-sensor-module.html this is the sensor) and i cannot get it installed and at this point i don't even know if it's working or not.
I installed the adafruit library and tried multiple scripts for it but everytime it says "Sensor not found check wiring"- or something similar. Only once when i connected it to the data pin 7 it said that "Unable to set line 7 as input". Do you guys have any idea what to do? Is there any other libraries instead of the one from Adafruit so i can try it as well? And how can i check if it's working or not?
 

Thread Starter

Leo17

Joined Nov 18, 2020
16
Did you try the link I provided?
Hello! Thank you for your adive, yes i tried it before but i gave it one more try now.The code seems to not work when i try it but maybe i made a mistake i m not sure i am going to post here the error and the code1606638189404.png1606638237917.png
 

Thread Starter

Leo17

Joined Nov 18, 2020
16
Update on the topic, i tried the adafruit library multiple times just to get the same error 'failed to get reading try again'.I tried connecting the pi to multiple gpios and then tried the DHTXXD library and everytime i got ' 3 0,0 0,0', I am starting to think more and more that my sensor is faulty. Do you guys have any other ideas on how to test it or how to make it work?Thanks
 

Wolframore

Joined Jan 21, 2019
2,609
Do you have another device to try? Do you have an arduino you can test the sensor on or another sensor to see if that one is faulty?
 

Thread Starter

Leo17

Joined Nov 18, 2020
16
Do you have another device to try? Do you have an arduino you can test the sensor on or another sensor to see if that one is faulty?
I have more Raspberry Pi’s but no arduino i m afraid. I have multiple things connected to the pi i tried to connect the sensor to so it shouldnt be the pi who is faulty
 

Wolframore

Joined Jan 21, 2019
2,609
I'm not suggesting your Pi is bad but rather the implementation of the sensor and it's library. Arduino being simpler, might be a good way to check whether it is the sensor that's bad.
 
Are you connecting the data pin from the sensor to a pin that supports PWM in your pi?

Have you measured the output of the data pin using a oscilloscope after powering the sensor? What outcome do you get?

P.s: I would try adding the 10k resistor too. The datasheet of your sensor says you can SOMETIMES leave this off.
 

Thread Starter

Leo17

Joined Nov 18, 2020
16
Are you connecting the data pin from the sensor to a pin that supports PWM in your pi?

Have you measured the output of the data pin using a oscilloscope after powering the sensor? What outcome do you get?

P.s: I would try adding the 10k resistor too. The datasheet of your sensor says you can SOMETIMES leave this off.
I tried multiple gpios and it s the same result, i added the 10k resistor but no luck as well. Unfortunately i don t have a oscilloscope yet :(
 

Thread Starter

Leo17

Joined Nov 18, 2020
16
For more info, this is the error when i run DHTXXD:
1607166810158.png
this is the error when i run the adafruit library:
1607166852274.png
and this is the script for configuring the adafruit library:
1607166913905.png
 
Top