How to Build a Comfort Monitoring Sensor Station

Originalartikel

Backup

<html> <section id=„step1“ class=„step“ data-stepid=„SHHDK4NJEUKNUD6“ readability=„32“><h2 class=„step-title“>Step 1: Background &#8211; Thermal and Visual Comfort</h2> <noscript> <p><img alt=„Picture of Background &#8211; Thermal and Visual Comfort“ src=„https://cdn.instructables.com/FUP/84VI/JGWJFPKT/FUP84VIJGWJFPKT.LARGE.jpg“ width=„2340“ height=„3761“/><img alt=„Picture of Background &#8211; Thermal and Visual Comfort“ src=„https://cdn.instructables.com/F1P/0JYM/JGWJFPKS/F1P0JYMJGWJFPKS.LARGE.jpg“ width=„4342“ height=„3761“/></p> </noscript> <div class=„step-body“ readability=„98“> <p><strong>Thermal and visual comfort</strong> have become more and more important topics, especially in office and workplace environments, but also in the residential sector. The main challenge in this field is that the thermal perception of individuals often varies in a wide range. One person might feel hot in a certain thermal condition while another person feels cold in the same. That&#8217;s because the <strong>individual thermal perception</strong> is influenced by many factors, including the physical factors of air temperature, relative humidity, air velocity, and radiant temperature of surrounding surfaces. But also, clothing, metabolic activity, and an individual aspect of age, sex, body mass, and more, influence the thermal perception.</p> <p>While the individual factors remain an uncertainty in terms of heating and cooling controls, the physical factors can be determined precisely by sensor devices. Air temperature, relative humidity, air velocity, and globe temperature can be measured and used as a direct input to building controls. Further, in a more detailed approach, they can be used as input to calculate the so called <strong>PMV-index</strong>, where PMV stands for Predicted Mean Vote. It describes how people in average would be likely to rate their thermal sensation under given ambient room conditions. PMV can take on values from -3 (cold) to +3 (hot), with 0 being a neutral state.</p> <p>Why do we mention that PMV-thing here? Well, because in the field of personal comfort it is a commonly used index that can serve as a quality criterion for the thermal situation in a building. And with CoMoS, all ambient parameters required for PMV calculation can be measured.</p> <p>If you're interested, find out more about thermal comfort, the context of globe and mean radiant temperature, the PMV-index, and the implementing ASHRAE-standard at</p> <p><a href=„https://en.wikipedia.org/wiki/Thermal_comfort“ rel=„nofollow“>Wikipedia: Thermal Comfort</a></p> <p><a href=„https://www.iso.org/standard/14562.html“ rel=„nofollow“>ISO 7726 Ergonomics of the thermal environment</a></p> <p><a href=„https://www.ashrae.org/“ rel=„nofollow“>ASHRAE NPO</a></p> <p>By the way: There are long existing, but also plenty of newly developed gadgets in the field of <strong>personalized environment</strong> to provide individual thermal and visual comfort. Small desktop fans are a well-known example. But also, footwarmers, heated and ventilated chairs, or office partitions for IR-radiative heating and cooling are being developed or even already available on market. All these technologies influence the local thermal condition, at a workplace for example, and they can be controlled automatically based on local sensor data, too, as illustrated in this step's pictures.</p> <p>More information about the gadgets of personalized environment and the ongoing research is available at</p> <p><a href=„http://www.livinglab-smartofficespace.com/en/research/heat-and-thermal-comfort/“ rel=„nofollow“>Living Lab smart office space: Personalized Environment</a></p> <p><a href=„https://cbe.berkeley.edu/“ rel=„nofollow“>University of California, Berkeley</a></p> <p><a href=„https://fmezen.no/wp-content/uploads/2018/06/ZEN-Report-no-4.pdf“ rel=„nofollow“>ZEN report on personal heating an cooling devices [PDF]</a></p> <p><a href=„https://sbrc.uow.edu.au/“ rel=„nofollow“>SBRC University of Wollongong</a></p> </div> </section><section id=„step2“ class=„step“ data-stepid=„S95WITBJGWJF8UE“ readability=„15“><h2 class=„step-title“>Step 2: System Scheme</h2> <noscript> <p><img alt=„Picture of System Scheme“ src=„https://cdn.instructables.com/FK3/X1RF/JGWJFO8N/FK3X1RFJGWJFO8N.LARGE.jpg“ width=„3792“ height=„5667“/><img alt=„Picture of System Scheme“ src=„https://cdn.instructables.com/FUO/VR3S/JGWJFO8P/FUOVR3SJGWJFO8P.LARGE.jpg“ width=„8208“ height=„5667“/></p> </noscript> <div class=„step-body“ readability=„64“> <p>One of the main goals in the development process was to create a <strong>wireless</strong>, <strong>compact</strong>, and <strong>inexpensive</strong> sensor device to measure indoor environmental conditions of at least ten individual workplaces in a given open office space. Therefore, the station uses an ESP32-WROOM-32 with on-board WiFi connectivity and with a large variety of connector pins and supported bus types for all kinds of sensors. The sensor stations use a separate IoT-WiFi and send their data readings to a MariaDB database through a PHP script that runs on the database server. Optionally, an easy-to-use Grafana visual output can be installed as well.</p> <p>The scheme above shows the arrangement of all peripheral components as an overview on the system setup, but this instructable focuses on the sensor station itself. Of course, the PHP file and a description of the SQL connection is included later on, too, to provide all necessary information to build, connect, and use CoMoS.</p> <p><strong>Note:</strong> at the end of this instructable you can find instructions on how to build an alternative stand-alone version of CoMoS with SD-card storage, internal WiFi access point, and a web app for mobile devices.</p> </div> </section><section id=„step3“ class=„step“ data-stepid=„SBI3OL1JGWJFPQ0“ readability=„5“><h2 class=„step-title“>Step 3: Supply List</h2> <noscript> <p><img alt=„Picture of Supply List“ src=„https://cdn.instructables.com/F9O/B3SX/JP8Z7BMQ/F9OB3SXJP8Z7BMQ.LARGE.jpg“ width=„4000“ height=„2632“/><img alt=„Picture of Supply List“ src=„https://cdn.instructables.com/FGU/AANN/JP8Z7C01/FGUAANNJP8Z7C01.LARGE.jpg“ width=„4032“ height=„2386“/></p> </noscript> <div class=„step-body“ readability=„31“> <p><strong>Electronics</strong></p> <p>Sensors and controller, as shown in the picture:</p> <ul><li><a href=„https://www.espressif.com/en/products/hardware/esp32-devkitc/overview“ rel=„nofollow“>ESP32-WROOM-32 mikrocontroller (espressif.com)</a> [A]</li> <li><a href=„https://www.adafruit.com/product/3251“ rel=„nofollow“>Si7021 or GY21 temperature and humidity sensor (adafruit.com)</a> [B]</li> <li><a href=„https://www.adafruit.com/product/374“ rel=„nofollow“>DS18B20+ temperature sensor (adafruit.com)</a> [C]</li> <li><a href=„https://moderndevice.com/product/wind-sensor/“ rel=„nofollow“>Rev C. air velocity sensor (moderndevice.com)</a> [D]</li> <li><a href=„https://www.adafruit.com/product/1655“ rel=„nofollow“>WS2812B 5050 status LED (adafruit.com)</a> [E]</li> <li><a href=„https://www.amazon.de/Christians-Technik-Shop-Lichtsensor-Arduino/dp/B0178HMPJG“ rel=„nofollow“>BH1750 illuminance sensor (amazon.de)</a> [F]</li> </ul><p>More electric parts:</p> <ul><li><a href=„https://www.adafruit.com/product/2783“ rel=„nofollow“>4,7k pull-up resistor (adafruit.com)</a></li> <li><a href=„https://www.adafruit.com/product/3111“ rel=„nofollow“>0,14 mm&#178; (or similar) standard wire (adafruit.com)</a></li> <li><a href=„https://www.wago.com/global/c/installation-terminal-blocks-and-connectors“ rel=„nofollow“>2x Wago compact splicing connectors (wago.com)</a></li> <li><a href=„https://www.sparkfun.com/products/10215“ rel=„nofollow“>Micro USB cable (sparkfun.com)</a></li> </ul> <p><strong>Case parts<br/></strong>(Find more detailed information on these parts and sizes in the next Step. If you have a 3D-printer available, you only need a table tennis ball. Skip the next Step and find all info and files for printing in Step 5.)</p> <ul><li>Acrylic plate round 50×4 mm [1]</li> <li>Steel plate round 40×10 mm [2]</li> <li>Acrylic tube 50x5x140 mm [3]</li> <li>Acrylic plate round 40×5 mm [4]</li> <li>Acrylic tube 12x2x50 mm [5]</li> <li>Table tennis ball [6]</li> </ul> <p><strong>Miscellaneous</strong></p> <ul><li>White paint spray</li> <li>Black matte paint spray</li> <li>Some tape</li> <li>A little insulation wool, a cotton pad, or anything similar</li> </ul> <p><strong>Tools</strong></p> <ul><li>Power drill</li> <li>8 mm steal drill</li> <li>6 mm wood/plastic drill</li> <li>12 mm wood/plastic drill</li> <li>Thin hand saw</li> <li>Sandpaper</li> <li>Wire cutting pliers</li> <li>Wire stripper</li> <li>Soldering iron and tin</li> <li>Power-glue or hot glue gun</li> </ul> <p><strong>Software and libraries</strong><br/>(The numbers indicate the library versions we used and tested the hardware with. Newer libraries should work as well, but we faced some issues occasionally while trying different / newer versions.)</p> <ul><li><a href=„https://www.arduino.cc/“ rel=„nofollow“>Arduino IDE (1.8.5)</a></li> <li><a href=„https://github.com/espressif/arduino-esp32“ rel=„nofollow“>ESP32 Core library</a></li> <li><a href=„https://github.com/Genotronex/BH1750FVI_Master“ rel=„nofollow“>BH1750FVI library</a></li> <li><a href=„https://github.com/adafruit/Adafruit_Si7021“ rel=„nofollow“>Adafruit_Si7021 library (1.0.1)</a></li> <li><a href=„https://github.com/adafruit/Adafruit_NeoPixel“ rel=„nofollow“>Adafruit_NeoPixel library (1.1.6)</a></li> <li><a href=„https://github.com/milesburton/Arduino-Temperature-Control-Library“ rel=„nofollow“>DallasTemperature library (3.7.9)</a></li> <li><a href=„https://playground.arduino.cc/Learning/OneWire“ rel=„nofollow“>OneWire library (2.3.3)</a></li> </ul></div> </section><section id=„step4“ class=„step“ data-stepid=„SYRZ8GJJGWJG56B“ readability=„38“><h2 class=„step-title“>Step 4: Case Design and Construction &#8211; Option 1</h2> <noscript> <p><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/F0S/HOIC/JI0JS1H7/F0SHOICJI0JS1H7.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FU1/W4I7/JI0JS1HA/FU1W4I7JI0JS1HA.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/F7M/00MU/JI0JS1QO/F7M00MUJI0JS1QO.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FE7/40DD/JGZMFDF1/FE740DDJGZMFDF1.LARGE.jpg“ width=„692“ height=„894“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/F0K/V4UV/JGZMFCEU/F0KV4UVJGZMFCEU.LARGE.jpg“ width=„774“ height=„714“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FHD/I21H/JI0JS1H4/FHDI21HJI0JS1H4.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FOJ/2YF4/JI0JS1H5/FOJ2YF4JI0JS1H5.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FK7/Z3JX/JI0JS1H8/FK7Z3JXJI0JS1H8.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FY9/0XHD/JI0JS1HH/FY90XHDJI0JS1HH.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FHD/VGGA/JI0JS1HQ/FHDVGGAJI0JS1HQ.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/F6T/E49F/JI0JS1JL/F6TE49FJI0JS1JL.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/F1H/90UO/JI0JS1M5/F1H90UOJI0JS1M5.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/F5A/UZV4/JI0JS1OK/F5AUZV4JI0JS1OK.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/F42/KSIV/JI0JS1OL/F42KSIVJI0JS1OL.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FTE/8T5L/JI0JS1OW/FTE8T5LJI0JS1OW.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/F4D/K5VQ/JI0JS1SH/F4DK5VQJI0JS1SH.LARGE.jpg“ width=„1200“ height=„1600“/><img alt=„Picture of Case Design and Construction &#8211; Option 1“ src=„https://cdn.instructables.com/FZ1/J07C/JGWJGBY5/FZ1J07CJGWJGBY5.LARGE.jpg“ width=„2052“ height=„2052“/></p> </noscript> <div class=„step-body“ readability=„112“> <p>CoMoS' design features a slim, vertical case with most of the sensors mounted in the top area, with only the temperature and humidity sensor mounted near the bottom. The <strong>sensor positions</strong> and arrangements follow specific requirements of the measured variables:</p> <ul><li>The Si7021 <strong>temperature and humidity sensor</strong> is mounted outside the case, near its bottom, to allow free air circulation around the sensor and to minimize the influence of waste heat evolved by the microcontroller inside the case.</li> <li>The BH1750 <strong>illuminance sensor</strong> is mounted on the flat top of the case, to measure the illumination on a horizontal surface as required by common standards on workplace illumination.</li> <li>The Rev. C <strong>wind sensor</strong> is also mounted in the top of the case, with its electronics hidden inside the case, but its tines, which carry the actual thermal anemometer and temperature sensor, exposed to the air around the top.</li> <li>The DS18B20 <strong>temperature sensor</strong> is mounted on the very top of the station, inside a black painted table tennis ball. The position on top is necessary to minimize the view factors and therefore the radiative influence of the sensor station itself to the globe temperature measurement.</li> </ul><p>Additional resources about the mean radiant temperature and the use of black table tennis balls as globe temperature sensors are:</p> <p><a href=„https://www.researchgate.net/publication/273902187_Suitability_of_Acrylic_and_Copper_Globe_Thermometers_for_Diurnal_Outdoor_Settings“ rel=„nofollow“>Wang, Shang &amp; Li, Yuguo. (2015). Suitability of Acrylic and Copper Globe Thermometers for Diurnal Outdoor Settings. Building and Environment. 89. 10.1016/j.buildenv.2015.03.002 .</a></p> <p><a href=„https://www.researchgate.net/publication/284413232_Ping-pong_globe_thermometers_for_mean_radiant_temperature“ rel=„nofollow“>de Dear, Richard. (1987). Ping-pong globe thermometers for mean radiant temperature. H &amp; Eng.,. 60. 10-12.<br/></a></p> <p>The case is designed simple, to keep the manufacturing time and effort as low as possible. It can easily be <strong>built from standard parts</strong> and components with just a few simple tools and skills. <strong>Or</strong>, for those lucky enough to have a 3D-printer at their service, all case parts can be <strong>3D-printed</strong> as well. For printing the case, the rest of this Step can be skipped and all required files and instructions can be found in the next Step.</p> <p>For the <strong>construction from standard parts</strong>, fitting dimensions are chosen for most of them:</p> <ul><li>The <strong>main body</strong> is an acrylic (PMMA) pipe of 50 mm outer diameter, 5 mm wall thickness, and a height of 140 mm.</li> <li>The <strong>bottom plate</strong>, which serves as a light conductor for the status LED, is an acrylic round plate of 50 mm diameter and a thickness of 4 mm.</li> <li>A <strong>steel round</strong> with a diameter of 40 mm and a thickness of 10 mm is installed as a weight on top of the bottom plate and fit inside the lower end of the main body tube to prevent the station from toppling over and to hold the bottom plate in place.</li> <li>The <strong>top plate</strong> fits inside the main body tube as well. It&#8217;s made of PMMA and has a diameter of 40 mm and a thickness of 5 mm.</li> <li>Finally, the <strong>top riser tube</strong> is PMMA, too, with an outer diameter of 10 mm, a wall thickness of 2 mm, and a length of 50 mm.</li> </ul><p>The manufacturing and assembling process is simple, beginning with some <strong>holes to drill</strong>. The steel round needs an 8 mm continuous hole, to fit the LED and cables. The main body tube needs some 6 mm holes, as cable feed-through for the USB and sensor cables, and as ventilation holes. The number and positions of holes can be varied up to your preference. The developers&#8217; choice is six holes on the backside, close to top and bottom, and two on the front side, one top, one bottom again, as a reference.</p> <p>The top plate is the most tricky part. It needs a centered, straight and continuous 12 mm whole to fit the top riser tube, another off centered 6 mm hole to fit the illuminance sensor cable, and a thin slit of approximately 1,5 mm width and 18 mm length to fit the wind sensor. See the pictures for reference. And finally, the table tennis ball needs a 6 mm whole, too, to fit the globe temperature sensor and cable.</p> <p>In the next step, all PMMA parts, except the bottom plate, should be <strong>spray painted</strong>, the reference is white. The table tennis ball must be painted in matte black to establish its estimated thermal and optical attributes.</p> <p>The steel round is <strong>glued</strong> centered and flat to the bottom plate. The top riser tube is glued into the 12 mm hole of the top plate. The table tennis ball is glued on the top end of the riser, with its hole matching the inner opening of the riser tube, so the temperature sensor and cable can be inserted to the ball afterwards through the riser tube.</p> <p>With this step done, all parts of the case are ready to be assembled by putting them together. If some fit too tight, sand them down a bit, if too loose, add a thin layer of tape.</p> </div> </section><section id=„step5“ class=„step“ data-stepid=„S4WVC60JKPWLUHH“ readability=„16“><h2 class=„step-title“>Step 5: Case Design and Construction &#8211; Option 2</h2> <noscript> <p><img alt=„Picture of Case Design and Construction &#8211; Option 2“ src=„https://cdn.instructables.com/FKX/HWGX/JKPWLWA2/FKXHWGXJKPWLWA2.LARGE.jpg“ width=„2000“ height=„1500“/><img alt=„Picture of Case Design and Construction &#8211; Option 2“ src=„https://cdn.instructables.com/F9G/Z4FF/JP8Z7B3G/F9GZ4FFJP8Z7B3G.LARGE.jpg“ width=„3024“ height=„4032“/><img alt=„Picture of Case Design and Construction &#8211; Option 2“ src=„https://cdn.instructables.com/FKG/5JMH/JP8Z7B3F/FKG5JMHJP8Z7B3F.LARGE.jpg“ width=„3024“ height=„4032“/><img alt=„Picture of Case Design and Construction &#8211; Option 2“ src=„https://cdn.instructables.com/FIE/PQIP/JP8Z7B3K/FIEPQIPJP8Z7B3K.LARGE.jpg“ width=„3024“ height=„4032“/><img alt=„Picture of Case Design and Construction &#8211; Option 2“ src=„https://cdn.instructables.com/FTN/G7JQ/JP8Z7B3C/FTNG7JQJP8Z7B3C.LARGE.jpg“ width=„2364“ height=„2364“/><img alt=„Picture of Case Design and Construction &#8211; Option 2“ src=„https://cdn.instructables.com/FV5/A2ZL/JP8Z7B3D/FV5A2ZLJP8Z7B3D.LARGE.jpg“ width=„2364“ height=„2364“/><img alt=„Picture of Case Design and Construction &#8211; Option 2“ src=„https://cdn.instructables.com/FHD/APJK/JP8Z7B3A/FHDAPJKJP8Z7B3A.LARGE.jpg“ width=„3024“ height=„4032“/><img alt=„Picture of Case Design and Construction &#8211; Option 2“ src=„https://cdn.instructables.com/F58/TCVA/JP8Z7B3B/F58TCVAJP8Z7B3B.LARGE.jpg“ width=„3024“ height=„4032“/></p> </noscript> <div class=„step-body“ readability=„65“> <p>While Option 1 of building CoMoS' case is still a fast and simple one, letting a <strong>3D-printer</strong> do the job might be even easier. Also for this option, the case is divided into three parts, top, case body, and bottom part, to allow easy wiring and assembly as described in the next Step.</p> <p>The files and further info on printer settings are provided at Thingiverse:</p> <p><a href=„https://www.thingiverse.com/thing:3045586“ rel=„nofollow“>CoMoS files on Thingiverse</a></p> <p>Following the instructions to use <strong>white filament</strong> for the top and case body parts is highly recommended. This prevents the case from heating up too quickly in sunlight and avoids false measurements. <strong>T</strong><strong>ransparent filament</strong> should be used for the bottom part to allow LED indicator illumination.</p> <p>Another variation from Option 1 is that the metal round is missing. To prevent CoMoS from toppling over, any kind of weight like bearing balls or a bunch of metal washers should be placed in/on the transparent bottom part. It is designed with an edge around to fit and hold some weight. Alternatively, CoMoS can be taped to its place of installation by using double-sided tape.</p> <p><strong>Note:</strong> The Thingiverse folder includes files for a micro SD card reader case which can be mounted to the CoMoS case. This case is optional and part of the stand-alone version described in the last step of this instructable.</p> </div> </section><section id=„step6“ class=„step“ data-stepid=„ST3K2XHJGWJGCP8“ readability=„24“><h2 class=„step-title“>Step 6: Wiring and Assembly</h2> <noscript> <p><img alt=„Picture of Wiring and Assembly“ src=„https://cdn.instructables.com/FQG/WWPF/JP8Z77QK/FQGWWPFJP8Z77QK.LARGE.jpg“ width=„4000“ height=„2662“/><img alt=„Picture of Wiring and Assembly“ src=„https://cdn.instructables.com/FP8/G78I/JP8Z7BGA/FP8G78IJP8Z7BGA.LARGE.jpg“ width=„2786“ height=„1917“/><img alt=„Picture of Wiring and Assembly“ src=„https://cdn.instructables.com/FOJ/52T4/JP8Z7C74/FOJ52T4JP8Z7C74.LARGE.jpg“ width=„2031“ height=„2030“/><img alt=„Picture of Wiring and Assembly“ src=„https://cdn.instructables.com/FEF/4XS0/JP8Z7BBT/FEF4XS0JP8Z7BBT.LARGE.jpg“ width=„1600“ height=„1200“/><img alt=„Picture of Wiring and Assembly“ src=„https://cdn.instructables.com/F1X/IKCN/JP8Z7BBV/F1XIKCNJP8Z7BBV.LARGE.jpg“ width=„3748“ height=„2596“/><img alt=„Picture of Wiring and Assembly“ src=„https://cdn.instructables.com/F5N/XK2K/JP8Z7BBX/F5NXK2KJP8Z7BBX.LARGE.jpg“ width=„8276“ height=„5587“/><img alt=„Picture of Wiring and Assembly“ src=„https://cdn.instructables.com/FB0/OPC2/JP8Z7BBY/FB0OPC2JP8Z7BBY.LARGE.jpg“ width=„3024“ height=„4032“/></p> </noscript> <div class=„step-body“ readability=„84“> <p>The ESP, sensors, LED, and USB cable are <strong>soldered</strong> and connected according to the schematic circuit shown in the pictures of this step. The <strong>PIN-assignment</strong> matching the example code described later is:</p> <ul><li>14 - Reset bridge (EN) - [grey]</li> <li>17 - WS2811 (LED) - [green]</li> <li>18 - pullup resistor for DS18B20+</li> <li>19 - DS18B20+ (One Wire) - [purple]</li> <li>21 - BH1750 &amp; SI7021 (SDA) - [blue]</li> <li>22 - BH1750 &amp; SI7021 (SCL) - [yellow]</li> <li>25 - BH1750 (V-in) - [brown]</li> <li>26 - SI7021 (V-in) - [brown]</li> <li>27 - DS18B20+ (V-in) - [brown]</li> <li>34 - Wind sensor (TMP) - [cyan]</li> <li>35 - Wind sensor (RV) - [orange]</li> <li>VIN - USB cable (+5V) - [red]</li> <li>GND - USB cable (GND) - [black]</li> </ul><p>The Si7021, BH1750, and DS18B20+ sensors are powered through an IO-pin of the ESP32. This is possible because their max current draft is below the ESP's max current supply per pin, and necessary to be able to reset the sensors by cutting off their power supply in case of sensor communication errors. See the ESP code and comments for more information.</p> <p>The Si7021 and BH1750 sensors, same as the <strong>USB cable</strong>, should be soldered with the cables already put through the dedicated case holes to allow assembly in the next step. WAGO compact splicing connectors are used to connect devices to the power supply by the USB cable. All are powered at 5 V DC by USB, which works with the logic level of the ESP32 at 3,3 V. Optionally, the data pins of the micro USB cable can be reconnected to the micro USB plug and connected to the ESP's micro USB socket, as power input and data connection to transfer code to the ESP32 while the case is closed. Else, if connected as shown in the scheme, another intact micro USB cable is needed to initially transfer code to the ESP before assembling the case.</p> <p>The <strong>Si7021 temperature sensor</strong> is glued to the back side of the case, close to the bottom. It's very important to attach this sensor close to the bottom, to avoid false temperature readings caused by heat evolved within the case. See Epilogue step for more Information about this issue. The <strong>BH1750 illuminance sensor</strong> is glued to the top plate, and the <strong>wind sensor</strong> is inserted and fit mounted to the slit on the opposite side. If it fits too lose, a little bit of tape around the center part of the sensor helps to keep it in position. The <strong>DS18B20 temperature sensor</strong> is inserted through the top riser into the table tennis ball, with a final position in the center of the ball. The inside of the top riser is filled with isolation wool and the lower opening is sealed with tape or hot glue, to prevent conductive or convective heat transfer to the globe. The <strong>LED</strong> is attached into the steel round hole facing down to illuminate the bottom plate.</p> <p>All wires, the splicing connectors, and the ESP32 go inside the main case and all case part are put together in final assembly.</p> </div> </section><section id=„step7“ class=„step“ data-stepid=„SILU9CMJGZMFBZ9“ readability=„26“><h2 class=„step-title“>Step 7: Software &#8211; ESP, PHP, and MariaDB Configuration</h2> <noscript> <p><img alt=„Picture of Software &#8211; ESP, PHP, and MariaDB Configuration“ src=„https://cdn.instructables.com/FAW/0QMA/JH0TK65T/FAW0QMAJH0TK65T.LARGE.jpg“ width=„1500“ height=„1125“/><img alt=„Picture of Software &#8211; ESP, PHP, and MariaDB Configuration“ src=„https://cdn.instructables.com/FJ9/1BGH/JH0TK64P/FJ91BGHJH0TK64P.LARGE.jpg“ width=„1920“ height=„1440“/></p> </noscript> <div class=„step-body“ readability=„87“> <p>The ESP32 micro controller can be <strong>programmed</strong> by using the <strong>Arduino IDE</strong> and the <a href=„https://github.com/espressif/arduino-esp32“ rel=„nofollow“>ESP32 Core library</a> provided by Espressif. There are plenty of tutorials available online on how to set up the IDE for ESP32 compatibility, for example <a href=„https://www.instructables.com/id/IOT-Made-Simple-Playing-With-the-ESP32-on-Arduino-/“ rel=„nofollow“>here</a>.</p> <p>Once set up, the attached <strong>code</strong> is transferred to the ESP32. It is commented throughout for easy understanding, but some key features are:</p> <ul><li>It has a „<strong>user configuration</strong>“ section at the beginning, in which individual variables must be set up, such as <strong>WiFi ID and password</strong>, database server IP, and desired data readings and send period. It also includes a „zero wind adjustment“ variable that can be used to adjust zero wind speed readings to 0 in case of a non-stable power supply.</li> <li>The code includes average <strong>calibration factors</strong> determined by the authors from calibration of ten existing sensor stations. See Epilogue step for more information and possible individual adjustment.</li> <li>Various error handling is included at several sections of the code. Especially an effective detection and handling of bus communication errors that occur often on ESP32 controllers. Again, see Epilogue step for more information.</li> <li>It has an <strong>LED color output</strong> to show the current state of the sensor station and any errors. See the Results step for more information.</li> </ul><p>The attached <strong>PHP file</strong> has to be installed and accessible in the root folder of the database server, at serverIP/sensor.php. The PHP file name and content of data handling must match the call function code of the ESP and, on the other side, match the database table setup, to allow storage of data readings. The example codes attached are matched, but in case you change some variables, they have to be changed throughout the system. The PHP file includes an adjusting section at the beginning, in which individual adjustments are made according to the environment of the system, especially <strong>database username and password</strong>, and the database name.</p> <p>A MariaDB or SQL <strong>database</strong> is set up on the same server, according to the table setup used in the sensor station code and the PHP script. In the example code, the MariaDB database name is „sensorstation“ with a table named „data“, which contains 13 columns for UTCDate, ID, UID, Temp, Hum, Globe, Vel, VelMin, VelMax, MRT, Illum, IllumMin, and IllumMax.</p> <p>A <a href=„https://grafana.com/“ rel=„nofollow“>Grafana</a> analytics and monitoring platform can be installed additionally on the server as an option for direct database visualization. This is not a key feature of this development, so it's not further described in this instructable.</p> </div> <aside class=„downloads“><h4 class=„sr-only“>Attachments</h4> </aside> </section><section id=„step8“ class=„step“ data-stepid=„S32KHF5JGZMFC0I“ readability=„9“><h2 class=„step-title“>Step 8: Results &#8211; Data Reading and Verification</h2> <noscript> <p><img alt=„Picture of Results &#8211; Data Reading and Verification“ src=„https://cdn.instructables.com/FYR/KQHZ/JP8Z780R/FYRKQHZJP8Z780R.LARGE.jpg“ width=„976“ height=„637“/></p> </noscript> <div class=„step-body“ readability=„49“> <p>With all wiring, assembly, programming, and environmental setup done, the sensor station sends data readings periodically to the database. While powered, several <strong>operation states</strong> are indicated through the bottom <strong>LED</strong> color:</p> <ul><li>During boot, the LED lights in yellow color to indicate the pending connection to WiFi.</li> <li>When and while connected, the indicator is blue.</li> <li>The sensor station runs sensor readings and sends it to the server periodically. Each successful transfer is indicated by a green light impulse of 600 ms.</li> <li>In case of errors, the indicator will color red, purple, or yellowish, according to the error type. After a certain time or number of errors, the sensor station resets all sensors and reboots automatically, again indicated by a yellow light on boot. See the ESP32 code and comments for more information about the indicator colors.</li> </ul><p>With this final step done, the sensor station runs and operates continuously. To date, a network of 10 sensor stations is installed and running in the beforehand mentioned <a href=„http://www.livinglab-smartofficespace.com/“ rel=„nofollow“>Living Lab smart office space</a>.</p> </div> </section><section id=„step9“ class=„step“ data-stepid=„SOCJE7EJMGL10JT“ readability=„25“><h2 class=„step-title“>Step 9: Alternative: Stand-alone Version</h2> <noscript> <p><img alt=„Picture of Alternative: Stand-alone Version“ src=„https://cdn.instructables.com/FMJ/WDJO/JP8Z90XT/FMJWDJOJP8Z90XT.LARGE.jpg“ width=„2000“ height=„1222“/><img alt=„Picture of Alternative: Stand-alone Version“ src=„https://cdn.instructables.com/FWG/ZHJD/JP8Z79CQ/FWGZHJDJP8Z79CQ.LARGE.jpg“ width=„2400“ height=„2400“/><img alt=„Picture of Alternative: Stand-alone Version“ src=„https://cdn.instructables.com/FRM/G6GL/JP8Z78T4/FRMG6GLJP8Z78T4.LARGE.jpg“ width=„1200“ height=„1920“/><img alt=„Picture of Alternative: Stand-alone Version“ src=„https://cdn.instructables.com/FB1/A5C2/JP8Z7KW7/FB1A5C2JP8Z7KW7.LARGE.jpg“ width=„2169“ height=„987“/><img alt=„Picture of Alternative: Stand-alone Version“ src=„https://cdn.instructables.com/F6R/JZO5/JP8Z78TC/F6RJZO5JP8Z78TC.LARGE.jpg“ width=„1200“ height=„1920“/><img alt=„Picture of Alternative: Stand-alone Version“ src=„https://cdn.instructables.com/FBW/VJ7P/JP8Z78TK/FBWVJ7PJP8Z78TK.LARGE.jpg“ width=„1200“ height=„1920“/><img alt=„Picture of Alternative: Stand-alone Version“ src=„https://cdn.instructables.com/FMK/CKEC/JP8Z78TU/FMKCKECJP8Z78TU.LARGE.jpg“ width=„1200“ height=„1920“/></p> </noscript> <div class=„step-body“ readability=„85“> <p>The development of CoMoS continues and the first result of this ongoing process is a <strong>stand-alone version</strong>. That version of CoMoS doesn't need a database server and WiFi network to monitor and record environmental data.</p> <p>The <strong>new key features</strong> are:</p> <ul><li>Data readings are stored on internal micro SD-card, in Excel-friendly CSV format.</li> <li>Integrated WiFi access point for access to CoMoS by any mobile device.</li> <li>Web-based app (internal web server on ESP32, no internet connection required) for live data, settings, and storage access with direct file download from the SD card, as shown in the picture and screenshots attached to this step.</li> </ul><p>This replaces the WiFi and database connection while all other features including calibration and all design and construction remain untouched from the original version. Still, the stand-alone CoMoS <strong>requires experience and further knowledge</strong> of how to access the internal file management system „SPIFFS“ of the ESP32, and a little awareness of HTML, CSS, and Javascript to understand how the web-app works. It also needs a few more / different libraries to work.</p> <p>Please check the Arduino code in the zip file attached for required libraries and the following references for further information on programming and uploading to SPIFFS file system:</p> <p><a href=„https://github.com/espressif/arduino-esp32/tree/master/libraries/SPIFFS“ rel=„nofollow“>SPIFFS library by espressif</a></p> <p><a href=„https://github.com/me-no-dev/arduino-esp32fs-plugin“ rel=„nofollow“>SPIFFS file uploader by me-no-dev</a></p> <p><a href=„https://github.com/Pedroalbuquerque/ESP32WebServer“ rel=„nofollow“>ESP32WebServer library by Pedroalbuquerque</a></p> <p>This new version would make a whole new instructable which might be published in the future. But for now, especially <strong>for more experienced users</strong>, we don't want to miss the chance to share the basic information and files you need to set it up.</p> <p><strong>Quick steps to build a stand-alone CoMoS:</strong></p> <ul readability=„5“><li>Build a case according to the step before. Optionally, 3D-print an additional case for the micro SC card reader to be attached to the CoMoS case. If you don't have a 3D printer available, the card reader can be placed inside the CoMoS main case as well, no worries.</li> <li>Wire all sensors as described before, but in addition, install and wire a <a href=„https://www.amazon.com/WINGONEER-reader-module-interface-conversion/dp/B06XHJJWNC“ rel=„nofollow“>micro SD card reader (amazon.com)</a> and a <a href=„https://learn.adafruit.com/adafruit-ds3231-precision-rtc-breakout/overview“ rel=„nofollow“>DS3231 real time clock (adafruit.com)</a> as indicated in the wiring scheme attached to this step. Note: The pins for the pull-up resistor and the oneWire differ from the original wiring scheme!</li> <li readability=„5“> <p>Check the Arduino code and adjust the WiFi access point variables „ssid_AP“ and „password_AP“ to your personal preference. If not adjusted, the standard SSID is „CoMoS_AP“ and the password is „12345678“.</p> </li> <li readability=„6“> <p>Insert micro SD card, upload the code, upload the content of the „data“ folder to the ESP32 using the SPIFFS file uploader, and connect any mobile device to the WiFi access point.</p> </li> <li readability=„1“> <p>Navigate to „192.168.4.1“ in your mobile browser and enjoy!</p> </li> </ul><p><strong>The app</strong> is all based on html, css, and javascript. It's local, no internet connection is involved or required. It features an in-app side menu to access a setup page and a memory page. On the <strong>setup page</strong>, you can adjust the most important settings like local date and time, sensor readings interval, etc. All settings will be stored permanently in the ESP32's internal storage and restored on next boot. On the <strong>memory page</strong>, a list of files on the SD card is available. Clicking a filename initiates a direct download of the CSV file to the mobile device.</p> <p>This system setup allows individual and remote monitoring of indoor environmental conditions. All sensor readings are stored on the SD card periodically, with new files being created for every new day. This allows a continuous operation for weeks or months without access or maintenance. As mentioned before, this is still an <strong>ongoing research and development</strong>. If you're interested in further details or assistance, please don't hesitate to contact the corresponding author through the comments or directly via <a href=„https://www.linkedin.com/in/mathias-kimmling/“ rel=„nofollow“>LinkedIn</a>.</p> </div> <aside class=„downloads“><h4 class=„sr-only“>Attachments</h4> </aside> </section><section id=„step10“ class=„step“ data-stepid=„SKE5X57JGZMFC21“ readability=„26“><h2 class=„step-title“>Step 10: Epilogue &#8211; Known Issues and Outlook</h2> <noscript> <p><img alt=„Picture of Epilogue &#8211; Known Issues and Outlook“ src=„https://cdn.instructables.com/FPQ/Z7PT/JP8Z7CJF/FPQZ7PTJP8Z7CJF.LARGE.jpg“ width=„720“ height=„504“/><img alt=„Picture of Epilogue &#8211; Known Issues and Outlook“ src=„https://cdn.instructables.com/FW1/59RP/JP8Z7CKG/FW159RPJP8Z7CKG.LARGE.jpg“ width=„2310“ height=„3618“/></p> </noscript> <div class=„step-body“ readability=„86“> <p>The sensor station described in this instructable is the outcome of a long and ongoing research. The goal is to create a reliable, precise, yet low-cost sensor system for indoor environmental conditions. This held and holds some serious challenges, of which the most certain should be mentioned here:</p> <p><strong>Sensor accuracy and calibration</strong></p> <p>The sensors used in this project all offer relatively high accuracy at low or moderate cost. Most are equipped with internal noise reduction and a digital bus interfaces for communication, reducing the need for calibration or level adjustments. Anyway, because the sensors are installed in or on a case with certain attributes, a calibration of the complete sensor station was performed by the authors, as shown briefly by the pictures attached. A total of ten equally built sensor stations were tested in defined environmental conditions and compared to a <a href=„https://www.testo.com/“ rel=„nofollow“>TESTO 480</a> professional indoor climate sensor device. From these runs, the calibration factors included in the example code were determined. They allow a simple compensation of the case's and electronics' influence on the individual sensors. To reach the highest accuracy, an individual calibration for each sensor station is recommended. The calibration of this system is a second focus of the authors' research, besides the development and construction described in this instructable. It is discussed in an additional, connected publication, which is still in peer-review and will be linked here as soon as it goes online. Please find more information about this topic on the <a href=„http://www.livinglab-smartofficespace.com/“ rel=„nofollow“>authors' website.</a></p> <p><strong>ESP32 operation stability</strong></p> <p>Not all Arduino-based sensor libraries used in this code are fully compatible with the ESP32 board. This issue has been widely discussed at many points online, especially regarding the stability of I2C and OneWire communication. In this development, a new, combined error detection and handling is carried out, based on powering the sensors directly through IO pins of the ESP32 to allow cutting their power supply for reset purpose. From today's perspective, this solution has not been presented or is not widely discussed. It was born of necessity, but to date is running smoothly for operation periods of several months and beyond. Yet it is still a topic of research.</p> <p><strong>Outlook</strong></p> <p>Together with this instructable, further written publications and conference presentations are carried out by the authors to spread the development and allow a wide and open source application. In meanwhile, the research is continued to further improve the sensor station, especially regarding system design and manufacturability, and system calibration and verification. This instructable might be updated on important future developments, but for all up-to-date information, please visit the <a href=„http://www.livinglab-smartofficespace.com/“ rel=„nofollow“>authors' website</a> or contact the authors directly via LinkedIn:</p> <p><a href=„https://www.linkedin.com/in/mathias-kimmling/“ rel=„nofollow“>corresponding author: Mathias Kimmling</a></p> <p><a href=„https://www.linkedin.com/in/konrad-lauenroth/“ rel=„nofollow“>second author: Konrad Lauenroth</a></p> <p><a href=„https://www.linkedin.com/in/sabine-hoffmann-80677a40/“ rel=„nofollow“>research mentor: Prof. Sabine Hoffmann</a></p> </div> </section> <div class=„contest-entries finalized-contests contest-entry“ readability=„23“><img alt=„First Time Author“ src=„https://cdn.instructables.com/FRK/UK7T/JO8XSYCW/FRKUK7TJO8XSYCW.SMALL.jpg“/><p>Second Prize in the<br/><a href=„https://www.instructables.com/contest/firsttimeauthor2018/“>First Time Author</a></p> </div> <section id=„imadeits“ class=„imadeits“ readability=„0“><h2>Share</h2> </section><section class=„recommendations“><h2>Recommendations</h2> <ul class=„list-unstyled projects“><li> <article><a href=„https://www.instructables.com/id/3D-Printer-the-C3Dtbd-Big-Delta/“><img alt=„3D Printer the C3Dt/bd (Big Delta)“ class=„lazy-img-scroll“ src=„https://cdn.instructables.com/FD4/NT4E/JUINJ854/FD4NT4EJUINJ854.RECTANGLE1.jpg?auto=webp“/></a> <div class=„caption“ readability=„1“> <h3><a href=„https://www.instructables.com/id/3D-Printer-the-C3Dtbd-Big-Delta/“>3D Printer the C3Dt/bd (Big Delta)</a></h3> <footer readability=„-1“><p>by <a href=„https://www.instructables.com/member/Core3D/“>Core3D</a> in <a href=„https://www.instructables.com/technology/“>Technology</a></p> </footer></div> </article></li> <li> <article><a href=„https://www.instructables.com/id/3D-Printed-Vacuum-Cleaner-for-a-CNC-Machine/“><img alt=„3D Printed Vacuum Cleaner for a CNC Machine“ class=„lazy-img-scroll“ src=„https://cdn.instructables.com/FYF/84K5/JUMXPFBR/FYF84K5JUMXPFBR.RECTANGLE1.jpg?auto=webp“/></a> <div class=„caption“ readability=„1“> <h3><a href=„https://www.instructables.com/id/3D-Printed-Vacuum-Cleaner-for-a-CNC-Machine/“>3D Printed Vacuum Cleaner for a CNC Machine</a></h3> <footer readability=„-1“><p>by <a href=„https://www.instructables.com/member/Nikus/“>Nikus</a> in <a href=„https://www.instructables.com/technology/3D-Printing/“>3d Printing</a></p> </footer></div> </article></li> <li> <article><a href=„https://www.instructables.com/id/Opensource-Ornithopter-Prototype-Arduino-Powered-a/“><img alt=„Opensource Ornithopter Prototype. Arduino Powered and Remote Controlled.“ class=„lazy-img-scroll“ src=„https://cdn.instructables.com/FLB/JYW0/JUGT8PJK/FLBJYW0JUGT8PJK.RECTANGLE1.jpg?auto=webp“/></a> <div class=„caption“ readability=„0“> <h3><a href=„https://www.instructables.com/id/Opensource-Ornithopter-Prototype-Arduino-Powered-a/“>Opensource Ornithopter Prototype. Arduino Powered and Remote Controlled.</a></h3> <footer readability=„-1“><p>by <a href=„https://www.instructables.com/member/gabbapeople%20/“>gabbapeople</a> in <a href=„https://www.instructables.com/technology/arduino/“>Arduino</a></p> </footer></div> </article></li> <li> <article><a href=„https://www.instructables.com/class/FeatureCAM-Standard/“><img alt=„FeatureCAM Standard Class“ class=„lazy-img-scroll“ src=„https://cdn.instructables.com/FG7/QISV/J1WESI8S/FG7QISVJ1WESI8S.RECTANGLE1.jpg?auto=webp“/></a> <div class=„caption“><img alt=„FeatureCAM Standard Class“ class=„lazy-img-scroll“ src=„https://cdn.instructables.com/FQ4/7YO0/J1CEP24Q/FQ47YO0J1CEP24Q.SQUARE2.jpg?auto=webp“/><h3><a href=„https://www.instructables.com/id/FeatureCAM-Standard/“>FeatureCAM Standard Class</a></h3> <footer><p>1,486 Enrolled</p> </footer></div> </article></li> </ul><ul class=„list-unstyled contests“><li> <h3 class=„sr-only“>Arduino Contest 2019</h3> <a href=„https://www.instructables.com/contest/arduino2019/“><img class=„lazy-img-scroll“ src=„https://cdn.instructables.com/FJZ/9JK6/JTWSVKBG/FJZ9JK6JTWSVKBG.MEDIUM.jpg?auto=webp“ alt=„Arduino Contest 2019“/></a></li> <li> <h3 class=„sr-only“>Tape Contest</h3> <a href=„https://www.instructables.com/contest/tape2019/“><img class=„lazy-img-scroll“ src=„https://cdn.instructables.com/FDN/U6U0/JSSUHJGB/FDNU6U0JSSUHJGB.MEDIUM.jpg?auto=webp“ alt=„Tape Contest“/></a></li> <li> <h3 class=„sr-only“>Trash to Treasure</h3> <a href=„https://www.instructables.com/contest/trashtreasure2019/“><img class=„lazy-img-scroll“ src=„https://cdn.instructables.com/F6M/SEYG/JSPAAWME/F6MSEYGJSPAAWME.MEDIUM.jpg?auto=webp“ alt=„Trash to Treasure“/></a></li> </ul></section> </html>