Back from the dead - DHT22 / AM2302 problem.

Here we can discuss about the problem found
BeanieBots
Posts: 324
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: Back from the dead - DHT22 / AM2302 problem.

Post by BeanieBots »

Sorry, I obviously missunderstood. Never mind. Not the end of the world but it would have been nice.
The BMPs have temp and pressure, no humidity.
I plan on using one to make a barometer using a small stepper motor to appear like a traditional classic mechanical one.
Hopefully, with the right update rate it can be battery operated. Time and testing will tell.
I go under the knife in a few hours time, so I'll either be very quiet for a few weeks or have nothing better to do than write software and post.
Again, only time will tell!
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: Back from the dead - DHT22 / AM2302 problem.

Post by Electroguard »

Very best of luck BeanieBots.
BeanieBots
Posts: 324
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: Back from the dead - DHT22 / AM2302 problem.

Post by BeanieBots »

Appreciated. I did manage to get some coding done :) (despite the pain, it actually took my mind off it)
Once I've worked out how to post code, images and files I post it.
It will be in the TFT GUI examples as I think that would be the best place for it.
BeanieBots
Posts: 324
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: Back from the dead - DHT22 / AM2302 problem.

Post by BeanieBots »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sun Jul 10, 2022 12:59 pm .. thanks for the normalisation formula.
Doh, I forgot to mention that gain compensation for temperature needs to be done in Kelvin.
If something is at 10'C and the temperature doubles, it will then be at 293'C.
To convert from 'C to K, simply add 273. Then subtract 273 after you have done whatever correction you need to do.
Also, don't forget that to produce a 1% increase in gain, the multiplyer needs to be 1.01.
So, let's say you want to subtract 5'C and increase the overall gain by 1% using y=mx+c.
Starting temperature = 24.3'C
Correction = ((24.3 + 273) * 1.01) - 273 - 5 (excess parentheses used to reduce ambiguity)
=22.3'C
[some might argue that the -5 should be inside the (24.3 + 273) but as this is a 'fudge' anyway, it doesn't really matter.]

Hope that makes sense.
User avatar
Electroguard
Posts: 836
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 268 times
Been thanked: 317 times

Re: Back from the dead - DHT22 / AM2302 problem.

Post by Electroguard »

It wasn't the general 'normalisation' formula that I was thinking of from schooldays, but it doesn't matter, cos I moved on from temp sensor modules long ago anyway.

All 5 of my xiaomi BLE devices read within 1 degree C of each other throughout the usable temp range, and there is no heat buildup to compensate for because they are already self-contained in their own enclosure.
I'll need to change their button cell battery eventually - but I have a spare xiaomi available, so is just a simple matter of swapping a device out and changing its address code in Annex to read the different device, then change the battery in the new spare.
BeanieBots
Posts: 324
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: Back from the dead - DHT22 / AM2302 problem.

Post by BeanieBots »

Indeed, always better to avoid a problem than correct for it.
I'm working on a way to make corrections for humidity but it's no simple task.
Some bits are obvious such as RH will be lower when things warm up. Even if that's non linear, it can still be corrected for with a bit of maths.
The big hurdle is hysteresis which is applicable whether in a warmed enclosure or not.
The problem is inherent in how RH sensors actually work and to-date I have never seen a commercial sensor compensate for it.
My current approach is to keep track of the recent trend and apply a prediction formula.
I have confidence that the method/approach is sound but I don't know of a way to check the results.
For temperature, I have access to lab calibrated standards. For RH I only have one standard to reference against (75%).
If anyone knows of an 'at home' method of calibrating RH (besides the saturated salt method) I'd be very grateful to know.
[Many years ago I used to design laboratory environmental chambers, so it's a bit of an obsession of mine]
rmsta
Posts: 32
Joined: Sat Feb 20, 2021 9:36 am
Location: Sindelfingen, Germany
Has thanked: 134 times
Been thanked: 9 times

Re: Back from the dead - DHT22 / AM2302 problem.

Post by rmsta »

Hello,
I am using BME280 (humidity and pressure) and Dallas18b20 (temperature) for a similar purpose.
Looking into the datasheets accuracy is enough for my application.

https://www.bosch-sensortec.com/product ... rs-bme280/

But at the end, I might not be so experienced with such things.
Regards
Rainer
Post Reply