RobTillaart / DHTNew

Arduino library for DHT11 and DHT22 with automatic sensor recognition
MIT License
96 stars 15 forks source link

Still problems with measuring negative values (AM2301) #57

Closed matchacos closed 3 years ago

matchacos commented 3 years ago

Hello

I am using several senses (dht22, am2301) to manage domotics at home and my outside sense blocked at 0°C when outside temperature was going down during the night.

Actually I tried another set of senses to verify the causes in my fridge and it appears that the two last versions of the library doesn't function quite well with (at least) my am2301 senses

I tried to measure temperatures in the fridge with different descending versions of the library.

When I re-installed the 0.4.3 version it brings correct values.

In facts the 0.4.5 version blocks at 0°C for negative values. The 0.4.4 version gives me -3267 +/- values when negative.

My two tested boards are arduino nano and uno (both chinese lowcost) and they both give same results.

Perhaps it is linked to your last modifications like in the last issue (#52 ) ...? Thanks for your work anyway and good luck

matchacos commented 3 years ago

The way the AM2301 codes negative temperatures seems to be the same than the AM2302 does. Here is the datasheet for this item: http://www.aosong.com/userfiles/files/media/AM2301%E8%A7%84%E6%A0%BC%E4%B9%A6-%E8%8B%B1%E6%96%87%E7%89%88%EF%BC%8820210407%EF%BC%89.pdf

RobTillaart commented 3 years ago

@matchacos I looked at the temperature code of 0.4.5 and it is definitely wrong for negative temperatures. In fact it maps all negatives on zero, just like you noticed.

A new develop branch (0.4.6) will be created a.s.a.p.


develop branch is available, please verify if it works.

matchacos commented 3 years ago

Nickel! I tried it with the new files I found and it worked well. The negative temperatures are now collected without any hiatus. No problem appeared to me. Thanks a lot

RobTillaart commented 3 years ago

Thank you for finding and verifying! Will merge branch tomorrow.

R.

On Fri, 9 Apr 2021, 21:13 matchacos, @.***> wrote:

Nickel! I tried it with the new files I found and it worked well. The negative temperatures are now collected without any hiatus? No problem appeared to me. Thanks a lot

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/RobTillaart/DHTNew/issues/57#issuecomment-816901622, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADQ77GK3QFIQHSAZNZDB4TTH5GU3ANCNFSM42S4TB5A .