{"id":124,"date":"2019-01-28T00:34:30","date_gmt":"2019-01-28T00:34:30","guid":{"rendered":"https:\/\/ryan.hattie.codes\/?p=124"},"modified":"2021-12-06T05:10:40","modified_gmt":"2021-12-06T05:10:40","slug":"year-round-weather-station","status":"publish","type":"post","link":"https:\/\/raelynn.hattie.codes\/blog\/2019\/01\/28\/year-round-weather-station\/","title":{"rendered":"Year-Round Weather Station"},"content":{"rendered":"\n<p>I&#8217;ve designed and constructed an outdoor IoT weather station that can report humidity, temperature, and pressure every 48 times a day, every day, for months on end. It does not require a base station or hub, is constructed from inexpensive parts, and the data can easily be read from anywhere using the Thingspeak API.<\/p>\n\n\n\n<p>All project files are available on <a href=\"https:\/\/www.thingiverse.com\/thing:3385818\">Thingiverse<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Electronics<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"677\" src=\"https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Top-1024x677.png\" alt=\"\" class=\"wp-image-132\" srcset=\"https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Top-1024x677.png 1024w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Top-300x198.png 300w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Top-768x508.png 768w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Top-830x549.png 830w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Top-230x152.png 230w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>The PCB of the weather station before soldering<\/figcaption><\/figure>\n\n\n\n<p>The circuitry of this weather station primarily consists of the minimum circuit for an ESP8266 (regulator, pullups, pulldowns, flash button, reset button), with pins broken out for UART and I2C. It also has a voltage divider between the ADC and power input to let the ESP8266 read and report the battery voltage.<\/p>\n\n\n\n<p>All of the SMD resistors and capacitors are neatly hidden on the pack face of the PCB.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"945\" src=\"https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Design-1024x945.png\" alt=\"\" class=\"wp-image-133\" srcset=\"https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Design-1024x945.png 1024w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Design-300x277.png 300w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Design-768x709.png 768w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Design-830x766.png 830w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Design-230x212.png 230w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Design.png 1238w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>The original CAD design for the PCB<\/figcaption><\/figure>\n\n\n\n<p>I used the ESP-12F module, as it provides all the IO I need in a compact little 24mmx16mm package. The ESP8266 communicates over I2C with a Bosch SensorTec BMP280 atmospheric sensor mounted on an off-the-shelf breakout board.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Installed-1024x576.jpg\" alt=\"\" class=\"wp-image-135\" srcset=\"https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Installed-1024x576.jpg 1024w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Installed-300x169.jpg 300w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Installed-768x432.jpg 768w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Installed-830x467.jpg 830w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather_PCB_Installed-230x129.jpg 230w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>The final soldered PCB, complete with sensor and a connected battery<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Housing<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather-Station-Mounted-2-1024x576.jpg\" alt=\"\" class=\"wp-image-136\" srcset=\"https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather-Station-Mounted-2-1024x576.jpg 1024w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather-Station-Mounted-2-300x169.jpg 300w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather-Station-Mounted-2-768x432.jpg 768w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather-Station-Mounted-2-830x467.jpg 830w, https:\/\/raelynn.hattie.codes\/blog\/wp-content\/uploads\/2019\/01\/Weather-Station-Mounted-2-230x129.jpg 230w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>The housed and assembled weather station, dutifully collecting weather data<\/figcaption><\/figure>\n\n\n\n<p>The housing is designed to withstand all forms of precipitation, any possible outdoor temperature, and constant UV exposure. To meet these needs, I constructed the entire thing out of PETG, a UV-stable, high strength plastic. At the same time, however, the weather station&#8217;s Stevenson screen sides and open bottom allow for ample airflow, ensuring accurate readings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Firmware<\/h2>\n\n\n\n<p>The firmware on board utilises the ESP8266&#8217;s deep sleep functionality, allowing it to draw current in the microamps when it is not collecting data. Every 30 minutes, it wakes up for a couple seconds to read the sensor data, connect to WiFi, and report its findings via the Thingspeak API.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Data Collection<\/h2>\n\n\n\n<p><a href=\"https:\/\/thingspeak.com\">Thingspeak<\/a> acts as the glue binding the weather station to all its clients. It also provides simple visualizations:<\/p>\n\n\n<style>\n       .errordiv { padding:10px; margin:10px; border: 1px solid #555555;color: #000000;background-color: #f8f8f8; width:500px; }#advanced_iframe {visibility:visible;opacity:1;vertical-align:top;}.ai-info-bottom-iframe { position: fixed; z-index: 10000; bottom:0; left: 0; margin: 0px; text-align: center; width: 100%; background-color: #ff9999; padding-left: 5px;padding-bottom: 5px; border-top: 1px solid #aaa } a.ai-bold {font-weight: bold;}#ai-layer-div-advanced_iframe p {height:100%;margin:0;padding:0}<\/style><script type=\"text\/javascript\">var ai_iframe_width_advanced_iframe = 0;var ai_iframe_height_advanced_iframe = 0;var aiOnloadScrollTop=\"true\";var aiShowDebug=false;\n\t\tif (typeof aiReadyCallbacks === 'undefined') {\n\t\t\tvar aiReadyCallbacks = [];\n\t\t} else if (!(aiReadyCallbacks instanceof Array)) {\n\t\t\tvar aiReadyCallbacks = [];\n\t\t}    function aiShowIframeId(id_iframe) { jQuery(\"#\"+id_iframe).css(\"visibility\", \"visible\");    }    function aiResizeIframeHeight(height) { aiResizeIframeHeight(height,advanced_iframe); }    function aiResizeIframeHeightId(height,width,id) {aiResizeIframeHeightById(id,height);}<\/script><iframe id=\"advanced_iframe\"  name=\"advanced_iframe\"  src=\"https:\/\/thingspeak.com\/channels\/579417\/charts\/3?bgcolor=%23ffffff&#038;color=%23f57c00&#038;days=30&#038;dynamic=true&#038;title=Monthly+Temperature&#038;type=line&#038;xaxis=Time&#038;yaxis=Temperature+%28%C2%B0C%29\"  width=\"450\"  height=\"260\"  frameborder=\"0\"  border=\"0\"  allowtransparency=\"true\"  loading=\"lazy\"  style=\";border-width: 0px;;border: none;border: 1px solid #cccccc;;width:450px;;height:260px;\" ><\/iframe><script type=\"text\/javascript\">var ifrm_advanced_iframe = document.getElementById(\"advanced_iframe\");var hiddenTabsDoneadvanced_iframe = false;\nfunction resizeCallbackadvanced_iframe() {}<\/script><script type=\"text\/javascript\"><\/script><p style=\"display:block !important; visibility:visible !important;margin: -18px 14px 0 0;padding-left: 3px;padding-top:3px;background: white; overflow: hidden; position: relative; line-height:15px;width: fit-content;\"><small style=\"display:block !important;visibility:visible !important\">powered by Advanced iFrame<\/small><\/p>\n\n\n\n<p>I ended up using my own visualizations anyways, but the fact that these plots are available out of the box is nice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Real Time Displays and Visualization <\/h2>\n\n\n\n<p>A few clients have been set up to read data from this weather station&#8217;s Thingspeak channel, including a <a href=\"https:\/\/python.raelynn.hattie.codes\/blog\/weather\/\">live dashboard<\/a> written using Dash and an OLED display in the kitchen.<\/p>\n\n\n\n<p>Update: due to cold weather killing my batteries, the weather station has been experiencing interruptions lately. I plan on eventually getting a better battery solution to prevent some of the low voltage issues I&#8217;ve been having.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve designed and constructed an outdoor IoT weather station that can report humidity, temperature, and pressure every 48 times a day, every day, for months on end. It does not require a base station or hub, is constructed from inexpensive parts, and the data can easily be read from anywhere using the Thingspeak API. All<\/p>\n<div class=\"blog-grid-button\"><a class href=\"https:\/\/raelynn.hattie.codes\/blog\/2019\/01\/28\/year-round-weather-station\/\">Read More <i class=\"fa fa-arrow-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":125,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,10,18,4,3],"tags":[6,7,27,24,26],"class_list":["post-124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-3d-printing","category-code","category-data","category-hardware","category-projects","tag-3d-printing","tag-arduino","tag-eagle","tag-esp8266","tag-iot"],"_links":{"self":[{"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/posts\/124"}],"collection":[{"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":8,"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/posts\/124\/revisions\/227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/media\/125"}],"wp:attachment":[{"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raelynn.hattie.codes\/blog\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}