{"id":745,"date":"2017-11-15T13:00:06","date_gmt":"2017-11-15T13:00:06","guid":{"rendered":"http:\/\/chewett.co.uk\/blog\/?p=745"},"modified":"2018-08-05T17:36:15","modified_gmt":"2018-08-05T16:36:15","slug":"ds18b20-onewire-temperature-sensor","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/745\/ds18b20-onewire-temperature-sensor\/","title":{"rendered":"DS18B20 onewire temperature sensor"},"content":{"rendered":"<p>The DS18B20 temperature sensor is a digital temperature sensor using the 1-Wire protocol. In this post I will review the sensor, show how it can be used and give a final judgement on it.<\/p>\n<p><!--more--><\/p>\n<h2>What can the DS18B20 temperature sensor do?<\/h2>\n<p><a href=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"851\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/745\/ds18b20-onewire-temperature-sensor\/ds18b20_temperature_sensor_post_image\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg?fit=800%2C800&amp;ssl=1\" data-orig-size=\"800,800\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ds18B20_temperature_sensor_post_image\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg?fit=678%2C678&amp;ssl=1\" class=\"alignleft wp-image-851\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg?resize=350%2C350\" alt=\"\" width=\"350\" height=\"350\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg?resize=300%2C300&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg?resize=768%2C768&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_image.jpg?resize=50%2C50&amp;ssl=1 50w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><\/a>The DSB18B20 temperature sensor is a digital temperature sensor that works using the 1-Wire Protocol. The sensor takes care of turning the analogue signal detected into a digital value in Celsius.<\/p>\n<p>Some temperature sensors work by giving you the current resistance and expect you to work out the temperature based on the specific sensor. However this sensor does this for you and means you don&#8217;t\u00a0need to calibrate the sensor to known temperatures and resistance values.<\/p>\n<p>This is a big advantage for basic projects where you want to quickly want to know the temperature. The downside is that you need something that speaks the 1-Wire protocol. However there is an Arduino\u00a0library to do this and means you don&#8217;t\u00a0need to program it yourself.<\/p>\n<h2>Wiring it up to an Arduino<\/h2>\n<p><a href=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"848\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/745\/ds18b20-onewire-temperature-sensor\/ds18b20_temperature_sensor_bb\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg?fit=800%2C456&amp;ssl=1\" data-orig-size=\"800,456\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ds18B20_temperature_sensor_bb\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg?fit=300%2C171&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg?fit=678%2C386&amp;ssl=1\" class=\"wp-image-848 alignleft\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg?resize=450%2C257\" alt=\"\" width=\"450\" height=\"257\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg?resize=300%2C171&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg?resize=768%2C438&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_bb.jpg?resize=50%2C29&amp;ssl=1 50w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a>Using the one wire protocol there are two ways to power the device, parasitic and standard power mode.<\/p>\n<p>In parasitic mode, only the data and GND lines need to be connected which removes the need for the VCC voltage input. To power the device the data line is used to charge an internal capacitor in the sensor. This is stored for periods when the data line is used to send data and no power is being sent. Depending on the sensor there will be delays while the device is &#8220;charged&#8221; during which no communication can take place on the data bus.<\/p>\n<p>In standard power mode both data, GND and VCC lines are connected to the sensor. By having a permanent\u00a0voltage line the need to pause communication is removed since power is always provided. Running in standard power mode means that the device can be polled for data at a much faster rate.<\/p>\n<p>For my experiments I am going to power the sensor in standard power mode. This will mean I can poll the sensor for the temperature at a much faster rate, helpful for logging data rapidly.<\/p>\n<p>To connect the sensor to the Arduino in standard power mode I am connecting GND to the Arduino GND and VCC to the 5 volt line on the Arduino. The data line has a pullup resistor between the 5 volts and the data line. It is recommended to use a 4.7 k resistor between these lines. The data line is also connected to pin 8 on the Arduino. This can be any digital pin on the Arduino so the 1Wire protocol can be used.<\/p>\n<h2>Programming the Arduino with the DS18B20 temperature sensor<\/h2>\n<p>To access the DS18B20 temperature sensor I am going to use the OneWire and DallasTemperature Arduino library. The OneWire library allows me to access the OneWire protocol without having to know the specifics of how it works.<\/p>\n<p>In addition to this I am going to use the DallasTemperature library as a wrapper around the OneWire library. This works with the OneWire library to specifically work with temperature sensors.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">#include &lt;OneWire.h&gt;\r\n#include &lt;DallasTemperature.h&gt;\r\n\r\n#define ONE_WIRE_PIN 8\r\n\r\nOneWire oneWire(ONE_WIRE_PIN);\r\nDallasTemperature sensors(&amp;oneWire);\r\n\r\nvoid setup() {\r\n     Serial.begin(115200);\r\n}\r\n\r\nvoid loop() {\r\n    sensors.requestTemperatures();\r\n    Serial.println(sensors.getTempCByIndex(0));\r\n    delay(1000);\r\n}<\/pre>\n<p>Above I create the OneWire object and pass it by reference (the ampersand,\u00a0<code>&amp;<\/code>)\u00a0in the constructor of the DallasTemperature object. With this I am able to request the temperate of the sensor at any time.<\/p>\n<p>In my loop I\u00a0call <code>requestTemperatures<\/code>\u00a0on the <code>sensors<\/code> object to get the temperatures of all sensors on the 1-Wire bus. This operation will detect the sensors on the bus and request the data from the sensors. Once this function call returns I\u00a0use the <code>sensors<\/code> object again to get the temperature in celsius using <code>getTempCByIndex<\/code>.\u00a0 Here I am asking for the first sensor on the bus (as there is only one) so giving it the parameter <code>0<\/code>\u00a0(programmers count from 0).<\/p>\n<p>Once I have the data I print it out to the serial so that I may see the data change as it continues.<\/p>\n<h2>Practical Measurements<\/h2>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"843\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/745\/ds18b20-onewire-temperature-sensor\/ds18b20_temperature_sensor\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor.jpg?fit=815%2C615&amp;ssl=1\" data-orig-size=\"815,615\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"ds18B20_temperature_sensor\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor.jpg?fit=300%2C226&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor.jpg?fit=678%2C512&amp;ssl=1\" class=\"alignleft wp-image-843\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor.jpg?resize=450%2C340\" alt=\"\" width=\"450\" height=\"340\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor.jpg?w=815&amp;ssl=1 815w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor.jpg?resize=300%2C226&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor.jpg?resize=768%2C580&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor.jpg?resize=50%2C38&amp;ssl=1 50w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/p>\n<p>Using python to collect the data from the Arduino I set the sensor up in an air-conditioned room. In this room the air conditioning was set to 23C.<\/p>\n<p>During the period of the experiment, it was cold outside but was slowly warmed during the day by other people in the room. Here you can see that over the period of the day the temperate was slowly increasing. The DS18B20 temperature sensor has a high resolution and does not fluctuate between temperatures. This ensures that the readings while changing, were stable and slowly increasing.<\/p>\n<p>Previous temperature sensors I have tested, <a href=\"\/blog\/309\/dht11-sensor-review-code-examples\/\">DHT11<\/a>, <a href=\"\/blog\/311\/dht22-sensor-review-code-examples\/\">DHT22<\/a> has problems where the temperature would fluctuate between two values however this does not seem as apparent for this sensor.<\/p>\n<p>The precision of the sensor shows a gradual increase in temperature which is good to see the consistency of the data. In the future, I will look to compare this data against other like for like sensors.<\/p>\n<h2>Final Review<\/h2>\n<p>One of the advantages of this sensor over many other temperature sensors is that it returns data in celsius by default. This removes the need for a sometimes complex calibration step before using it. The precision level is similar to the <a href=\"\/blog\/311\/dht22-sensor-review-code-examples\/\">DHT22 tested previously<\/a>.<\/p>\n<p>One of the features that sets this apart is the 1-Wire protocol this operates on. This can reduce the need for many IO ports on the Arduino and may be helpful when running larger projects.<\/p>\n<p>Overall this sensor is at a similar price point and feature level as the DHT22 temperature sensor.\u00a0 However the unique addition of the 1-Wire bus protocol means this is certainly a useful sensor to have around.<\/p>\n<p><strong>Would buy again!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The DS18B20 temperature sensor is a digital temperature sensor using the 1-Wire protocol. In this post I will review the sensor, show how it can be used and give a final judgement on it.<\/p>\n","protected":false},"author":1,"featured_media":850,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[97],"tags":[187,132,131,290,179],"class_list":["post-745","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics","tag-1-wire","tag-arduino","tag-arduino-sensor","tag-ds18b20","tag-temperature-sensor"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/ds18B20_temperature_sensor_post_icon.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-c1","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1407,"url":"https:\/\/chewett.co.uk\/blog\/1407\/waterproof-ds18b20-onewire-temperature-sensor-review-and-code\/","url_meta":{"origin":745,"position":0},"title":"Waterproof DS18B20 onewire temperature sensor Review and Code","author":"Chewett","date":"August 8, 2018","format":false,"excerpt":"The DS18B20 temperature sensor is a digital temperature sensor using the 1-Wire protocol. In this post I will review the sensor, show how it can be used and give a final judgement on it. What can the Waterproof DS18B20 do? This sensor is identical to the previously reviewed DS18B20 temperature\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_inner_img_main_feature_image.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_inner_img_main_feature_image.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_inner_img_main_feature_image.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_inner_img_main_feature_image.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1412,"url":"https:\/\/chewett.co.uk\/blog\/1412\/using-the-ds18b20-temperature-sensor-with-a-wemos-d1-mini-esp8266\/","url_meta":{"origin":745,"position":1},"title":"Using the DS18B20 Temperature Sensor with a WeMos D1 Mini (ESP8266)","author":"Chewett","date":"November 21, 2018","format":false,"excerpt":"In this blog post I talk about the additional steps needed to use the DS18B20 onewire temperature sensor with a WeMos D1 Mini (ESP8266) using the Arduino IDE. Important differences compared to using the DS18B20 on an Arduino There is one major difference to bear in mind when using the\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/11\/wd18b20_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/11\/wd18b20_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/11\/wd18b20_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/11\/wd18b20_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1380,"url":"https:\/\/chewett.co.uk\/blog\/1380\/displaying-temperature-sensor-data-on-a-liquid-crystal-display-with-arduino\/","url_meta":{"origin":745,"position":2},"title":"Displaying temperature sensor data on a Liquid Crystal Display with Arduino","author":"Chewett","date":"August 4, 2018","format":false,"excerpt":"This blog post expands on displaying Hello World on a Liquid Crystal Display to show temperature sensor values on this display. Combining the LCD display and\u00a0DS18B20 Temperature Sensor This project combines two of my favourite pieces of electrical components the 16x2 LCD display and the DS18B20 temperature sensor. Both have\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_temp_sensor.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_temp_sensor.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_temp_sensor.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/08\/16x2_lcd_screen_temp_sensor.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":309,"url":"https:\/\/chewett.co.uk\/blog\/309\/dht11-sensor-review-code-examples\/","url_meta":{"origin":745,"position":3},"title":"DHT11 Sensor Review and code examples","author":"Chewett","date":"August 12, 2017","format":false,"excerpt":"The DHT11 sensor works as a basic temperature and humidity sensor at a low price. In this post I will review the sensor, show how it can be used and give a final judgement on it. What can the DHT11 do? The DHT11 sensor is a basic sensor that lets\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/dht11_text.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/dht11_text.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/dht11_text.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/08\/dht11_text.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":311,"url":"https:\/\/chewett.co.uk\/blog\/311\/dht22-sensor-review-code-examples\/","url_meta":{"origin":745,"position":4},"title":"DHT22 Sensor review and code examples","author":"Chewett","date":"October 18, 2017","format":false,"excerpt":"The DHT22 sensor works as a duel temperature and humidity sensor. In this post I will review the sensor, show how it can be used and give a final judgement on it. What can the DHT22 do? The DHT22 sensor is actually a slightly more accurate and powerful version of\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/dht22_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/dht22_post_icon.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/dht22_post_icon.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/dht22_post_icon.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1476,"url":"https:\/\/chewett.co.uk\/blog\/1476\/using-the-dht22-temperature-sensor-with-a-wemos-d1-mini-esp8266\/","url_meta":{"origin":745,"position":5},"title":"Using the DHT22 Temperature Sensor with a WeMos D1 Mini (ESP8266)","author":"Chewett","date":"September 22, 2018","format":false,"excerpt":"In this blog post I talk about the additional steps needed to use the DHT22 temperature sensor with a WeMos D1 Mini (ESP8266) with the Arduino IDE. Differences from running a DHT22 on an Arduino There are two major differences to bear in mind when using the DHT22 on a\u2026","rel":"","context":"In &quot;Electronics&quot;","block_context":{"text":"Electronics","link":"https:\/\/chewett.co.uk\/blog\/category\/electronics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/09\/dht22_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/09\/dht22_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/09\/dht22_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/09\/dht22_on_wemos_d1_mini.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/745","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=745"}],"version-history":[{"count":11,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/745\/revisions"}],"predecessor-version":[{"id":1379,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/745\/revisions\/1379"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/850"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}