{"id":1790,"date":"2021-01-11T08:51:00","date_gmt":"2021-01-11T14:51:00","guid":{"rendered":"https:\/\/www.dalemorin.com\/?p=1790"},"modified":"2021-01-11T08:51:00","modified_gmt":"2021-01-11T14:51:00","slug":"raspberry-pi-project-swapping-sensors","status":"publish","type":"post","link":"https:\/\/www.dalemorin.com\/?p=1790","title":{"rendered":"Raspberry Pi project &#8211; swapping sensors"},"content":{"rendered":"<p>I&#8217;m a little suspect of the humidity readings I get from the DHT22 sensors.\u00a0 I suspect that they&#8217;re reporting higher humidity than is actually the case.\u00a0 I did some research and I&#8217;m not alone in this concern.\u00a0 It&#8217;s not a huge concern by any means, my primary interest is with temperature, but since I&#8217;m logging and graphing the data, why not try to make the data as accurate as possible?<\/p>\n<p>That research led me to the BME280 sensor module.\u00a0 It communicates through the i2c bus, using an address on the bus to differentiate between multiple devices on the same bus.\u00a0 The BME280 has two available addresses depending on how a jumper on the module is configured.\u00a0 Since I&#8217;m using two sensors that will work out well.<\/p>\n<p>The difference that you&#8217;ll need to deal with first is that the BME280 sensors use four connections to the Pi, not three as the DHT22 sensor does.\u00a0 So you&#8217;ll need an extra wire between the sensor and the Pi.<\/p>\n<p>Normally you&#8217;d use a breakout board to easily handle the multiple connections needed, but because I don&#8217;t foresee adding other sensors at this point, I&#8217;m just going to solder the wires for data and clock together.\u00a0 I&#8217;ll continue to use separate 3.3v and ground connections for each sensor.\u00a0 If that changes, I can easily add a breakout board later.<\/p>\n<p>The python script that interrogates the sensors and saves the data into the rrdtool database will require some changes.\u00a0 These sensors have calibration data available, and we&#8217;ll use that to be sure the readings are as accurate as possible.\u00a0 We&#8217;ll also need different libraries to use the i2c bus and to communicate with the BME280 sensors.\u00a0 Both of these libraries can easily be installed using pip.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m a little suspect of the humidity readings I get from the DHT22 sensors.\u00a0 I suspect that they&#8217;re reporting higher humidity than is actually the case.\u00a0 I did some research and I&#8217;m not alone in this concern.\u00a0 It&#8217;s not a huge concern by any means, my primary interest is with temperature, but since I&#8217;m logging &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.dalemorin.com\/?p=1790\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Raspberry Pi project &#8211; swapping sensors&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-1790","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=\/wp\/v2\/posts\/1790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1790"}],"version-history":[{"count":1,"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=\/wp\/v2\/posts\/1790\/revisions"}],"predecessor-version":[{"id":1791,"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=\/wp\/v2\/posts\/1790\/revisions\/1791"}],"wp:attachment":[{"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dalemorin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}