DHT22 bug ?

Post and discuss new components that you have created.
chipfryer27
Valued Contributor
Posts: 1146
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: DHT22 bug ?

Post 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

kaqkk007
Posts: 26
Joined: Sat Feb 04, 2023 1:09 pm
Has thanked: 2 times
Been thanked: 1 time

Re: DHT22 bug ?

Post 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 ?

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: DHT22 bug ?

Post by mnfisher »

The datasheet gives range of -40 to +80C. I've only tested my code at room temperature though....

Martin

kaqkk007
Posts: 26
Joined: Sat Feb 04, 2023 1:09 pm
Has thanked: 2 times
Been thanked: 1 time

Re: DHT22 bug ?

Post 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 .

kaqkk007
Posts: 26
Joined: Sat Feb 04, 2023 1:09 pm
Has thanked: 2 times
Been thanked: 1 time

Re: DHT22 bug ?

Post 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 .

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: DHT22 bug ?

Post 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

kaqkk007
Posts: 26
Joined: Sat Feb 04, 2023 1:09 pm
Has thanked: 2 times
Been thanked: 1 time

Re: DHT22 bug ?

Post by kaqkk007 »

I sent the file , hope it will solve the problem , thanks in advance for your help

kaqkk007
Posts: 26
Joined: Sat Feb 04, 2023 1:09 pm
Has thanked: 2 times
Been thanked: 1 time

Re: DHT22 bug ?

Post 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

chipfryer27
Valued Contributor
Posts: 1146
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: DHT22 bug ?

Post 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

kaqkk007
Posts: 26
Joined: Sat Feb 04, 2023 1:09 pm
Has thanked: 2 times
Been thanked: 1 time

Re: DHT22 bug ?

Post by kaqkk007 »

Hi Yes I tried to turn off the checksum but it only measured an incorrect value

Post Reply