{"id":6046,"date":"2020-03-01T23:45:12","date_gmt":"2020-03-02T04:45:12","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=6046"},"modified":"2022-08-24T15:07:54","modified_gmt":"2022-08-24T20:07:54","slug":"esp8826-12e","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=6046","title":{"rendered":"ESP8826 (12e) Multisensor"},"content":{"rendered":"<p>We&#8217;d set up a prototype multi-sensor with an environment sensing kit that Scott picked up at MicroCenter a few years ago. There&#8217;s a little LCD display &#8230; but we wanted to report readings back to our OpenHAB server. Which required a network connection. Checking out prices for network cards to add to the Uno &#8230; well, it wasn&#8217;t a cheap add-on. But we found these ESP8266 modules that support 802.11b\/g\/n <em>and<\/em> provide the memory\/processing for small programs. At about 3$ delivered, that was exactly what we needed.<\/p>\n<p>I ordered a bunch of components to make multi-sensors &#8211; <a href=\"https:\/\/www.aliexpress.com\/item\/32971403358.html\" target=\"_blank\" rel=\"noopener noreferrer\">pressure sensors<\/a>, <a href=\"https:\/\/www.aliexpress.com\/item\/4000086462552.html\" target=\"_blank\" rel=\"noopener noreferrer\">luminescence sensors<\/a>, <a href=\"https:\/\/www.aliexpress.com\/item\/1941380773.html\" target=\"_blank\" rel=\"noopener noreferrer\">temperature\/humidity sensors<\/a>. The sensors connect into a <a href=\"https:\/\/www.aliexpress.com\/item\/32733851178.html\" target=\"_blank\" rel=\"noopener noreferrer\">CP2102 ESP8266<\/a>. The device is powered by a <a href=\"https:\/\/www.aliexpress.com\/item\/32823843782.html\" target=\"_blank\" rel=\"noopener noreferrer\">couple of 18650&#8217;s in a little box<\/a> &#8212; another buck. There&#8217;s some miscellaneous wiring and a little breadboard, too. The total cost for the multi-sensor is about 8.50$. We could add a <a href=\"https:\/\/www.aliexpress.com\/item\/32819758372.html\" target=\"_blank\" rel=\"noopener noreferrer\">vibration sensor<\/a> for another 0.50$, a <a href=\"https:\/\/www.aliexpress.com\/item\/32958984382.html\" target=\"_blank\" rel=\"noopener noreferrer\">PIR sensor<\/a> for 2$, and a <a href=\"https:\/\/www.aliexpress.com\/item\/4000687581828.html\" target=\"_blank\" rel=\"noopener noreferrer\">UV sensor<\/a> for 2.50$. That&#8217;s 13.50$ for 7 different sensors &#8212; and we don&#8217;t <em>need<\/em> seven sensors everywhere.<\/p>\n<p>I kind of want to make a weather station too &#8212; add a <a href=\"https:\/\/www.aliexpress.com\/item\/32850527381.html?spm=a2g0o.productlist.0.0.3fda2dfcBimTEU&amp;algo_pvid=c376c63d-2dbe-4931-9720-2d02a8ee907a&amp;algo_expid=c376c63d-2dbe-4931-9720-2d02a8ee907a-7&amp;btsid=0be3764315831235985754938ec893&amp;ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_\" target=\"_blank\" rel=\"noopener noreferrer\">water level sensor<\/a>, a <a href=\"https:\/\/www.aliexpress.com\/item\/32818351704.html?spm=a2g0o.productlist.0.0.3fda2dfcBimTEU&amp;algo_pvid=c376c63d-2dbe-4931-9720-2d02a8ee907a&amp;algo_expid=c376c63d-2dbe-4931-9720-2d02a8ee907a-0&amp;btsid=0be3764315831235985754938ec893&amp;ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_\" target=\"_blank\" rel=\"noopener noreferrer\">precipitation detector<\/a>, and a <a href=\"https:\/\/www.adafruit.com\/product\/1733?gclid=EAIaIQobChMIjtKDrv365wIVgZOzCh25ZALDEAQYASABEgIgofD_BwE\" target=\"_blank\" rel=\"noopener noreferrer\">wind speed sensor<\/a>. Those are surprisingly expensive! I want to check out the process to <a href=\"https:\/\/create.arduino.cc\/projecthub\/achindra\/diy-anemometer-wind-speed-sensor-device-84a2e3\" target=\"_blank\" rel=\"noopener noreferrer\">build your own anemometer<\/a>. But I&#8217;d probably buy a nice Davis Anemometer \ud83d\ude42<\/p>\n<p>Connecting to a WiFi network with the ESP8266 is really easy:<\/p>\n<ul>\n<li>Add a <a href=\"https:\/\/github.com\/esp8266\/Arduino\" target=\"_blank\" rel=\"noopener noreferrer\">library to the Arduino IDE<\/a> &#8212;\n<ul>\n<li>In the Arduino IDE preferences, select File&gt;Preferences menu.<\/li>\n<li>In the &#8220;Additional Boards Manager URLs&#8221; field, add &#8216;https:\/\/arduino.esp8266.com\/stable\/package_esp8266com_index.json&#8217;<\/li>\n<li>Select the Tools &gt; Board menu and open the Boards Manager. Search for &#8220;esp8266&#8221; and install the platform.<\/li>\n<li>From the Tools &gt; Board menu, select the appropriate board. I ordered the CP2102 ESP8266 module, and we&#8217;re using &#8220;NodeMCU 1.0 (ESP-12E Module)&#8221; as the board.<\/li>\n<\/ul>\n<\/li>\n<li>Configure the WiFi network connection details in your code<\/li>\n<li>Compile<\/li>\n<li>Upload<\/li>\n<li>You&#8217;ve on the network!<\/li>\n<\/ul>\n<p>We&#8217;ve used an <a href=\"https:\/\/github.com\/knolleary\/pubsubclient\" target=\"_blank\" rel=\"noopener noreferrer\">MQTT library<\/a> and send sensor readings to our MQTT server.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;d set up a prototype multi-sensor with an environment sensing kit that Scott picked up at MicroCenter a few years ago. There&#8217;s a little LCD display &#8230; but we wanted to report readings back to our OpenHAB server. Which required a network connection. Checking out prices for network cards to add to the Uno &#8230; &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,63],"tags":[866,43,159],"class_list":["post-6046","post","type-post","status-publish","format-standard","hentry","category-coding","category-home-automation","tag-arduino","tag-home-automation","tag-iot"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6046"}],"version-history":[{"count":6,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6046\/revisions"}],"predecessor-version":[{"id":9285,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/6046\/revisions\/9285"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}