Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: DHT-22 or DHT-11 sensors  (Read 3249 times)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
DHT-22 or DHT-11 sensors
« on: December 24, 2020, 02:33:08 PM »

I picked up a DHT-22 temperature/humidity sensor last spring to use with my off grid Pi Zero W and am just now getting around to playing with it.
I ordered a DHT-11 sensor for my city residents as temperatures don't get as cold here inside.
bkenobi has updated some files for HG in order for the GPIO pins to work with HG for different Pi Boards (just in time for my HA season of tinkering).
 I was wondering if anyone else is using either of the two sensors on their pi and if so for what?

 I plan to create some inside temperature triggered HG events based on the info spit out from these, maybe even a humidity event too.
The HG DHT-22 widget appears to just display the values but I've just begun to play with this.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: DHT-22 or DHT-11 sensors
« Reply #1 on: December 25, 2020, 11:38:09 AM »

I picked up a DHT-22 temperature/humidity sensor..........
(just in time for my HA season of tinkering).
I was wondering if anyone else is using either of the two sensors on their pi and if so for what?

 I plan to create some inside temperature triggered HG events

Great post Tuicemen! My only temperature centric automation right now is with my Nest thermostat (part of the basic set-up) that uses my phone location to turn-back/up the setting based on my not being at home.

But I am ALWAYS looking for new automation.... and will be following this thread. 
Logged
Home Automation is an always changing technology

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2081
Re: DHT-22 or DHT-11 sensors
« Reply #2 on: December 25, 2020, 06:17:39 PM »

The DHT sensors are relatively cheap but are very unreliable and inaccurate.  The DHT11 is ok for tinkering around with but I would not recommend using it for anything serious.  It can vary by several degrees from sensor to sensor and the rate at which humidity updates to new conditions is really slow.  The DHT22 has slightly better specs but cost several times more purportedly because of the cost/time to calibrate.  I know a lot of projects used these years ago, but anyone using them today is really just reading old hackaday articles and trying to recreate someone else's work when that person would not likely recommend using them today.

I do have some of these and have them installed in a project from years ago.  If/when I get around to rebuilding that project, I intend on using BME280 sensors instead.  These cost ~$1 shipped and are EXCELLENT!  They require more knowledge but if you want to add temperature/humidity/pressure to your automation capabilities, I'd look into these.

IMO, before spending any more time/money on the DHT I'd look at what others are using these days.  Also, there are a lot of test programs for Arduino/RPi/ESP setups that will make testing these and seeing their capabilities a simple task.  The MySensors project would be a great place to start as they have been doing this type of thing for years and offer schematics as well as models if you have a 3D printer to construct an enclosure.  In fact, you can technically just download their code, buy the shopping list, and have a sensor up and running with very little effort!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: DHT-22 or DHT-11 sensors
« Reply #3 on: December 26, 2020, 08:10:00 AM »

I do have some of these and have them installed in a project from years ago.  If/when I get around to rebuilding that project, I intend on using BME280 sensors instead.  These cost ~$1 shipped and are EXCELLENT!  They require more knowledge but if you want to add temperature/humidity/pressure to your automation capabilities, I'd look into these.

IMO, before spending any more time/money on the DHT I'd look at what others are using these days.  Also, there are a lot of test programs for Arduino/RPi/ESP setups that will make testing these and seeing their capabilities a simple task.  The MySensors project would be a great place to start as they have been doing this type of thing for years and offer schematics as well as models if you have a 3D printer to construct an enclosure.  In fact, you can technically just download their code, buy the shopping list, and have a sensor up and running with very little effort!

Thanks I wasn't  aware of these sensors. I only noticed the support in HG for the DHT sensors so thought I'd play with them. I really haven't  though of to much to do with the sensors yet other then just display info. I'll order a BME280 sensor as having presure info would be handy extra info.
  ::)The BME280 sensor would allow for some weather predicting  and the creation of a inexpensive weather station. An on sight weather station provides far more reliable forecasts for weather triggered events.

 Currently I use a wifi camera and turn it with HG to a thermometer to check inside temperature at my off grid place.
This gives me an idea of how much time will be needed to get the place warm when I head up in the cold months.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: DHT-22 or DHT-11 sensors
« Reply #4 on: December 26, 2020, 05:15:31 PM »

I initially thought my DHT22 sensor was toast as I couldn't get it working  in HG or via command line.
I could get it to spit out info via command line terminal window but not displaying correct values.
Playing with some different Python code I found the code I was using was targeting a DHT-11 although the code is essentially the same and the article I got it from stated it worked for both sensors it doesn't without a small change not mentioned in the write up.
Now that I know the sensor is actually working I can start to dig into why the DHT sensor programs are not working (for me) in HG.   >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: DHT-22 or DHT-11 sensors
« Reply #5 on: December 30, 2020, 06:31:38 PM »

.
The DHT sensors are relatively cheap but are very unreliable and inaccurate.  The DHT11 is ok for tinkering around with but I would not recommend using it for anything serious.  It can vary by several degrees from sensor to sensor and the rate at which humidity updates to new conditions is really slow.  The DHT22 has slightly better specs but cost several times more purportedly because of the cost/time to calibrate.
Your right the DHT 11 sensors are very unreliable! when I picked these up I got a couple as I found them for the price of one(suspect the vendor was just trying to unload them). I connected one to a Pi 3B+ and one to a Zero W, the sensors are less then a foot apart but humidity values on the 2 are 10% points or more different. The temperature values are  2.0C° more or less different then each other but I suspect that would depend on the in both cases module.
Still the only thing I wished to use this for was a indoor temperature estimation in the city. The DHT11 will work in my city place but not at my off grid place due to the extreme temperatures experienced in the winter inside when I'm not there.

 The DHT22 sensors are by far much better for Humidity (at least the ones I have) they are less then .5% different from each other.
The temperature values are about .5C°  or less different from each other. Still that can be a large discrepancy depending on the actual temperature. However for what I'm planning, it should be OK and work fine ::) :'

 Both sensors  I would not recommended for any serious monitoring.
 I'm still waiting on my BME280 sensor so I'll post my finding when I get it. I most likely will use it to create a weather station at my off grid place.

 The HG downloadable DHT sensor programs seem to have a couple of issues. One is the C# library which from my research say it is very unreliable and is looking to be out dated with the latest HG code.  The other seems to be the sensor widget as I attempted to use this when creating a new HG DHT program. In both cases program code sees there is info but widget reports (displays) NANA for humidity and NANA C for temperature. ::) :' I haven't dug into the HG Sensor widget code as yet to see what, if anything may going on with it.  >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: DHT-22 or DHT-11 sensors
« Reply #6 on: December 31, 2020, 03:36:58 PM »

I got the HG sensor widget to work! :)% I believe the problem was it needs only number values feed into it (no letters).
Unfortunately the HG DHT sensor programs written in C# have an error pointing to adding a reference missing which digging deep seems to be there  ::) :' :( probably just needs updating.
in any case my code is working :D ;D :)%
« Last Edit: February 01, 2021, 03:50:13 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: DHT-22 or DHT-11 sensors
« Reply #7 on: February 01, 2021, 04:07:33 PM »

Having been away from the Off grid place for4 or 5 days I've been checking in and slowly watching the temperature drop.
This morning the inside temperature was 0.9 C.
I do get a bit of solar heat gain threw the day to bring the temperature up a few degrees.
The CM15A with PI and sensor is located on an outside wall so temperature reported there is a few degrees cooler, and the sensor is not located where it will get any direct sun.
I did experiment a bit using the Basic thermostat widget to trigger my outside boiler while there but didn't have much time to play. >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2081
Re: DHT-22 or DHT-11 sensors
« Reply #8 on: February 01, 2021, 07:17:55 PM »

If you wanted more accurate/location configurable temperatures, you may find using an SDR with a RF temperature sensor more to your liking. I've found that the Acurite sensors are far better than DHT sensors in my testing. My 3 sensor setup has been watching my camper, outside temp, and shadow outside temp (because I was curious) for the last couple weeks and it's one of my favorite updates to my setup. Probably wont work for anyone here since it doesnt work directly with alexa though.

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: DHT-22 or DHT-11 sensors
« Reply #9 on: February 01, 2021, 07:34:22 PM »

My sensor is mainly just for an aproximate indoor temperature and humidity. I have other plans for exterior readings.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2081
Re: DHT-22 or DHT-11 sensors
« Reply #10 on: February 01, 2021, 09:06:53 PM »

Sure, but the DHT isnt all that accurate and as you have said doesnt work. So why not try a different sensor that does work, has an outdoor enclosure, has the communication worked out, and is quite affordable. These are also expandable by simply sourcing a new one.

I tried DHT and they kinda work. I tried BME280 and they work better, but dont have all the the other stuff figured out. The up side for BME is accuracy. The up side for SDR sensors is everything is modular and worked out.

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: DHT-22 or DHT-11 sensors
« Reply #11 on: February 02, 2021, 06:24:35 AM »

Your confusing things the DHT sensor works for what I wanted and is indoors. I have an acurite 5 in1 weather station for outside.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2081
Re: DHT-22 or DHT-11 sensors
« Reply #12 on: February 02, 2021, 09:01:01 AM »

I dont think I'm confused. You said your DHT sensor was attached to your franken-CM15 located on an outside wall. You said it might not read the same temperature as the rest of the building. Assuming the CM15 can't be moved and you can't extend the DHT further away, you would need to consider alternatives.  Wireless sensors are at least as accurate as the DHT. They can be used indoors and outdoors. They can be located anywhere you want. If they break or you want more locations, just buy another one and put the batteries in and HG will be ready to go with no extra work. Simple!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: DHT-22 or DHT-11 sensors
« Reply #13 on: February 02, 2021, 10:25:21 AM »

The cm15 is located on a outside wall but on the interior side.
I do have other interior sensors like that located on my Automatic Generator Start module located in the basement.
This supplies basement temperatures which displays in HG along with other temperature & solar related readings.

I am also playing with a 3 volt ESP-01S and a temperature sensor. This info could easily pulled into HG as well but I doubt I'll use it there unless I have a total failure with the DHT on the PI.  -:) maybe a loft temperature reading as this could be placed anywhere if running on batteries.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2081
Re: DHT-22 or DHT-11 sensors
« Reply #14 on: February 02, 2021, 02:27:57 PM »

If you are using a ESP device with a temperature sensor, why would you use a DHT? Since you will need a  enclosure anyway, you could easily use a BME instead and have a ready to go solution with less power requirements and much more flexibility. The DHT may work with enough effort, but will not provide the end results your expecting. With a basic ESP based demos mini and a BME280 + lithium battery, you can install everything in a film container sized enclosure for a really nice solution. If you have a 3D printer, you can find premade printable enclosures that you just snap everything into if you cant find something appropriate in a junk drawer.

That said, I have gone both the DHT and BME routes and still recommend the premade temp/humidity sensors.
Pages: [1] 2
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.