Page 2 of 5

Re: DHT22 bug ?

Posted: Fri Jan 12, 2024 2:16 pm
by chipfryer27
Hi

I'm not sure I understand your question.The sensor can obtain readings that are string based and also float, which are +/- assigned and these are easily displayed on a LCD (for example).

Regards

Re: DHT22 bug ?

Posted: Sat Jan 13, 2024 5:25 pm
by kaqkk007
With Arduino and pic controller (18f252) we found that above 40 'c the measurement runs to error , is this a program error or are the DHT probes that bad ?

Re: DHT22 bug ?

Posted: Sat Jan 13, 2024 5:39 pm
by mnfisher
The datasheet gives range of -40 to +80C. I've only tested my code at room temperature though....

Martin

Re: DHT22 bug ?

Posted: Sat Jan 13, 2024 6:34 pm
by kaqkk007
Thanks for reading the + - values I figured it out , at first I only used the int variable and the temp Whole - temp real macros so I didn't succeed .

Re: DHT22 bug ?

Posted: Tue Jan 23, 2024 6:06 pm
by kaqkk007
Is it possible that the DHT sensor only works with 18F pics ? I have done a few with 18f252 , but now it refuses to measure with 16f876 .

Re: DHT22 bug ?

Posted: Tue Jan 23, 2024 6:13 pm
by chipfryer27
Hi

Unlikely.

Most likely when you changed chips the pin connections aren't correct or the oscillator settings are wrong.

If you post your 16F876 file I can have a look.

Regards

Re: DHT22 bug ?

Posted: Tue Jan 23, 2024 6:21 pm
by kaqkk007
I sent the file , hope it will solve the problem , thanks in advance for your help

Re: DHT22 bug ?

Posted: Wed Jan 24, 2024 3:30 am
by kaqkk007
The footprint is the same between the 18f252 and the 16f 876 , the difference with the oscillator is that I use the 252 with 10Mhz quartz and 4 internal multiplication at 40Mhz , and the 16f's counterpart can only be used up to 20 Mhz . The last update I set the dht probe from 4 to 3 and the probe pack from 18 to 17 so it worked with the 252 , but the 16f constantly CRC error . I also tried to stop the interrupt before starting the measurement and then restarted , but it did not help either

Re: DHT22 bug ?

Posted: Wed Jan 24, 2024 7:13 am
by chipfryer27
Hi

If the component is the same (at same version) and works on one chip but not another, it could possibly be something with the chip or maybe timings. The timings can be an issue with that sensor.

To see if it can communicate, have you tried changing the Use Checksum in the component properties to No?

Regards

Re: DHT22 bug ?

Posted: Wed Jan 24, 2024 1:10 pm
by kaqkk007
Hi Yes I tried to turn off the checksum but it only measured an incorrect value