IAQ Shield - DHT22 issues

@mtnscott / @peekay123,
Do you have an opinion on the accuracy of the DHT22 sensor ?
I just opened a new :

And compared the results with another sensor and the indoor air quality shield readings with them sitting next to each other.
10.2C 65% Humidity = THGR122NX
10.6C 63% Humidity = Oregon BAR388HGA
15.5C 50% Humidity = IAQ Shield DHT22

I realize the temperature difference on the shield is because I have sensors with heaters on them and I guess that would have some effect on the humidity, but it seems the Humidity is still quite a lot different than I would expect.
@RWB - did you ever compare your SHT15 with a DHT22 ?

@rockvole The DHT22 sensor datasheet can be found here The stated accuracy is +/- 2% with a max of +/- 5%. I have not compared it with the SHT15. I find the differences to be interesting. Do you know what sensor the Oregon is using?. I’m not surprised that the two Oregon sensors match as they probably should coming from the same company. I have found the DHT11 DHT22 and BMP180 all read differently. So I can’t really explain the differences other than the accuracy and conditions.

@Rockvole I do not have the DHT22 sensor so I have not tested it against the DHT22 sensor or any other temp sensor to date. I just assume that the SHT15 sensor is as accurate as they say it is.

Might as well order up and SHT15 or newer temp/humidity sensor and see how it compares and let us know how it goes.

@Rockvole, my experience with DHT22 sensors is limited to those readings. I can tell you that having two DHT22s on the same board, back to back and same distance from the Core gave me different readings. I didn’t keep any data on those readings so I can’t tell how much they were off unfortunately.

It looks like the DHT22 on the indoor air quality shield is faulty - perhaps it was broken due to oscillation issues I have been having. It could have always been broken but I want to try a temperature / humidity experiment soon so that’s when I realized. I tried another DHT22 on a breadboard and the PietteTech library and got readings similar to the Oregon sensors.

1 Like

Actually it looks like the DHT22 on the IAQ shield is still working. It seems that the other components on the board cause the temperature to rise by 5C which in turn drops the humidity by 17%. The temperature / humidity is the foundation for IAQ - so I really want to get it right.
My idea was to have a way to turn off all the sensors on the board in order to reduce heat (and just turn them on when I need to take readings).
Do you think that would work? There are a couple of components which I think are power related which get pretty hot. I think the heat is coming up from the PCB because I shielded the DHT22 with some plastic and it doesnt make any difference to its temperature readings.
An alternative would be use a wired DHT22 (like the grove temperature sensor). I guess if that is in the
same enclosure though it would still be affected.

@Rockvole, the board definitely conducts heat. Turning your sensors on only when you need them is a good idea and would be relatively easy to implement with transistors. The sensors take a few seconds to heat up so depending on the “thermal mass” of the enclosure, the DHT22 may be affected anyway. Perhaps @BDub, @bko, @kennethlimcp have some ideas to add. :smile:


@Rockvole, i shifted the posts to a new thread so as to not flood the Library thread for DHT22. Hope you don’t mind :wink:

1.) I haven’t looked at the sensors but i remember those gas sensors need the heating element to be on as long as you are reading from it and not on/off heating. (need to verify this)

2.) I would place them apart as much as possible from the DHT22 since the surrounding air is heated up by the gas sensor heating element.

3.) The Nest Protect has humidity and gas sensors inside. I would look at the teardown and see how they play with the layout to overcome this issue.

Let’s keep the discussion going! :smiley:

1 Like

Good Idea @kennethlimcp

@peekay123 if we use transistors to turn the sensors on and off - do the transistors also dump heat ?

These components on the board also generate heat - I think they are to do with power:
One marked 269-50 PR-326 gets quite hot.
Two marked as 6X 47 25V heat up somewhat.
Is there a cooler way to do what these components do ?

I was looking at the smart citizen project :

They originally used the DHT22, but for the next revision of their board they moved to a HPP828E031 (HTU21D)
I cant find an explanation for the change. They probably have less problems with heat since they have 2 boards and I guess they put the power components on the Base Board.

One thing I noticed is the DHT22 on the original board sits at an angle away from the PCB.
I tried the same thing on the IAQ shield - I removed the screw from the DHT22 and tried to pull the sensor forward but it looks like it is well stuck down :frowning:

1 Like

I think the chip on the board which gets hot is a MC332690-5.0 low dropout voltage regulator.
Perhaps adding a heatsink to this would help the heat to transfer away from the PCB ? Or maybe changing it for one which sits away from the PCB ?

This, plus adding a switch to all the sensors will hopefully allow useful readings from the temperature / humidity sensor.

1 Like

I’ve just got around using my Spark and I have it set up just like on @mtnscott git hub page (no other components and using a 1K pull-up) and his lib and example, it has been running about 12500 samples overnight. The temp reads about 21C and the humidity about 26%. Next to it I have a regular household termo/hygro and it reads about 19C and 41%.

The difference in humidity seems a bit too high for 2 degrees. I have tried using a second DHT22 (RHT03) and I get the same result.

Update: I found that if I remove the 1k pull-up the humidity readings go up by 8% and the temp by 2 degrees. I have double checked that it’s wired right so I really can’t get why I get this change (but then I’m a developer not an electronics guy ;-))

Update2: It’s really strange but the humidity seems inverted? When I breath on the sensor the humidity went down… so I’m now running with a “100 - DHT.getHumidity()” and values are finally looking good? I read the spec, since my sensor is labeled RHT03, and compared the timings with the PietteTech_DHT code and it looks fine (I’m getting paranoid). Is it my sensors that are wired backwards or just me?


Interesting findings @jon - how do you have your DHT22 oriented - is it sticking vertically in the air or flush with the board ?

@Rockvole it’s oriented vertically (standing up, not bent) and exactly like in https://github.com/piettetech/PietteTech_DHT/blob/master/DHT22%20Example.png and on the same distance from the Spark and with no other components. So my readings are around 30% humidity when it should be 40-ish. If I don’t have the “100 - DHT.getHumidity” the humidity goes down when I breath on the sensor (now it’s around 70% but going up). Also when the sensor hits 100% (or 0% inverted) it kind of tips over the humidity counter so to say.

I can read the code @mtnscott wrote and it looks right as far as I know and others are using it and it works fine. But in my case it seems to read the humidity wrong or I have two defect sensors (ordered a whole bunch of new ones just in case).

This is how I “handle” the readings. With this code it matches reality
humidity = (100 - DHT.getHumidity()) - 25;
if (humidity <= 0) humidity = 100;

Does any of this make any sense as to what could be the problem? Like I said I have two sensors giving the same result.

Hi @jon I just tested my configuration and when I breathe on the sensor it goes to the max value of 99% humidity. I’m not sure what is going on in your configuration, can you check the voltage connections on the sensor and data lines?

I’ve also tested with the AM2302 and get the same results.

@rockvole If you take a closer look at the smart citizen board, they have an air gap cut-out around the onboard temp / humidity sensor. That’s probably to manage the thermal conductance of the board. You may want to try that on your next board rev.

Thanks for spotting that - hopefully spark will be able to do that.

@mtnscott I measure 3.295VDC at the power pin and 3.294V (but flickering a bit as expected I guess) at the data pin of the sensor. I will move the spark to a USB3 port for more juice if you think that can be the problem? Should I consider powering if off 5V at VIN, since it’s rated up to 6v?

Today when I came home it was stuck reading 100% humidity (with my "fix), the temp was still right. When powering off the Spark for a couple of minutes it read 100% directly when connected. Now after been of power for more then one hour it’s reading right again (still with the “fix”). I don’t doubt your code is correct, I just meant I read the spec for the sensor and compaired the timings with your code in case the RHT03 was some wierd version or so. As you can hear I’m grasping… Thanks for trying to help out.

@jon, are you getting your 3.3v from the Spark 3.3 or 3.3* pin? Do you have a good solid GND. In my case I power the DHT22 from the 3.3v pin on the Spark Core and the GND pin next to the 3.3* pin. I don’t think current is an issue as the DHT22 does not consume much. Is there anything else connected to the Spark other than the DHT22?

@mtnscott I followed your example from your Github page. It is connected to 3.3v not the 3.3v* as I read it was recommended against that in the lib thread. It’s directly connected to GND next to the 3.3*v pin. There are no other components. I just wired it up on the board that came with Spark and compiled your lib and simple sensor example.

As I directly had problems with the readings being off I have tried with and without pull up but with the same result.