{"id":569,"date":"2014-01-30T01:14:16","date_gmt":"2014-01-30T06:14:16","guid":{"rendered":"http:\/\/ebixio.com\/blog\/?p=569"},"modified":"2014-01-30T01:14:16","modified_gmt":"2014-01-30T06:14:16","slug":"temperature-sensor-tmp36-dht22-and-10k-thermistor","status":"publish","type":"post","link":"http:\/\/ebixio.com\/blog\/2014\/01\/30\/temperature-sensor-tmp36-dht22-and-10k-thermistor\/","title":{"rendered":"Temperature sensor: TMP36, DHT22, and 10K Thermistor"},"content":{"rendered":"<p>Here&#8217;s a quick comparison of 3 different &#8220;low cost&#8221; temperature sensors:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.adafruit.com\/products\/165\" title=\"TMP36\" target=\"_blank\">TMP36<\/a> at $2.<\/li>\n<li><a href=\"http:\/\/www.adafruit.com\/products\/372\" title=\"10K Precision Epoxy Thermistor - 3950 NTC\" target=\"_blank\">10K Precision Epoxy Thermistor &#8211; 3950 NTC<\/a> at $4.<\/li>\n<li><a href=\"http:\/\/www.adafruit.com\/products\/385\" title=\"DHT22\" target=\"_blank\">DHT22<\/a> at $12.50. This one also contains a humidity sensor, so that&#8217;s why it&#8217;s more expensive than the other two.<\/li>\n<\/ul>\n<p>This is how accurate they each claim to be:<\/p>\n<table>\n<tr>\n<th>Model<\/th>\n<th>Accuracy in \u00b0C<\/th>\n<th>Accuracy in \u00b0F<\/th>\n<\/tr>\n<tr>\n<td>TMP36<\/td>\n<td>\u00b12.00\u00b0C<\/td>\n<td>\u00b13.6\u00b0F<\/td>\n<\/tr>\n<tr>\n<td>Thermistor<\/td>\n<td>\u00b10.45\u00b0C<\/td>\n<td>\u00b10.8\u00b0F<\/td>\n<\/tr>\n<tr>\n<td>DHT22<\/td>\n<td>\u00b10.50\u00b0C<\/td>\n<td>\u00b10.9\u00b0F<\/td>\n<\/tr>\n<\/table>\n<p>All the data below was collected with a BeagleBone Black which has a 12-bit ADC. The 10K thermistor was hooked up in a voltage divider configuration with a 1% 10K resistor. The DHT22 uses a thermistor inside as well, but has a digital output. Readings were taken every 3s over a 2 hour period.<\/p>\n<p>The sensors are all positioned within 1\/4&#8243; of each other. The slow temperature drifts are from the house cooling and the furnace heating it back up.<br \/>\n<div id=\"attachment_570\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-raw.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-570\" src=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-raw.png\" alt=\"Temperature\" width=\"560\" height=\"433\" class=\"size-full wp-image-570\" srcset=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-raw.png 560w, http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-raw-300x231.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-570\" class=\"wp-caption-text\">Temperature<\/p><\/div><\/p>\n<p>I used a running average filter with a window of 10 samples to clean up the noise a bit and these are the results.<br \/>\n<div id=\"attachment_572\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-filtered.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-572\" src=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-filtered.png\" alt=\"Temperature - 30s running average\" width=\"560\" height=\"433\" class=\"size-full wp-image-572\" srcset=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-filtered.png 560w, http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-filtered-300x231.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-572\" class=\"wp-caption-text\">Temperature &#8211; 30s running average<\/p><\/div><\/p>\n<p>Finally, taking the 10K thermistor as ground truth, these are the differences observed. The TMP36 is consistently about 2\u00b0F lower than the thermistor, and the DHT22 is roughly 1\u00b0F higher even though it&#8217;s also using a thermistor inside. I don&#8217;t know how accurate the ADC inside the DHT22 is, so that might explain some of the difference.<br \/>\n<div id=\"attachment_573\" style=\"width: 570px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-delta.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-573\" src=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-delta.png\" alt=\"Deltas between different temperature sensors.\" width=\"560\" height=\"433\" class=\"size-full wp-image-573\" srcset=\"http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-delta.png 560w, http:\/\/ebixio.com\/blog\/wp-content\/uploads\/2014\/01\/Temperature-delta-300x231.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><\/a><p id=\"caption-attachment-573\" class=\"wp-caption-text\">Deltas between different temperature sensors.<\/p><\/div><\/p>\n<p>In conclusion, when you hear someone say &#8220;I keep my thermostat at 67\u00b0F&#8221; and another guy responds &#8220;My wife would kill me if I did that. I keep mine at 73\u00b0F&#8221; they might both be keeping their temperature at 70\u00b0F. It just depends on what temperature sensor their thermostat is using, and how well it was calibrated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a quick comparison of 3 different &#8220;low cost&#8221; temperature sensors: TMP36 at $2. 10K Precision Epoxy Thermistor &#8211; 3950 NTC at $4. DHT22 at $12.50. This one also contains a humidity sensor, so that&#8217;s why it&#8217;s more expensive than the other two. This is how accurate they each claim to be: Model Accuracy in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-569","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/posts\/569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/comments?post=569"}],"version-history":[{"count":4,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/posts\/569\/revisions"}],"predecessor-version":[{"id":576,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/posts\/569\/revisions\/576"}],"wp:attachment":[{"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/media?parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/categories?post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/tags?post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}