{"id":2114,"date":"2022-08-18T07:31:52","date_gmt":"2022-08-18T07:31:52","guid":{"rendered":"http:\/\/lora.vsb.cz\/?page_id=2114"},"modified":"2023-10-07T07:15:06","modified_gmt":"2023-10-07T07:15:06","slug":"temperature-humidity-and-pressure-sensor-bme280","status":"publish","type":"page","link":"https:\/\/lora.vsb.cz\/index.php\/temperature-humidity-and-pressure-sensor-bme280\/","title":{"rendered":"Temperature, Humidity and Pressure sensor BME280"},"content":{"rendered":"<table style=\"height: 66px;\" width=\"356\">\n<tbody>\n<tr>\n<td style=\"text-align: left; min-width: 100px;\" width=\"10%\"><strong>TTN version:<\/strong><\/td>\n<td><strong><span style=\"color: #008000;\">TTNv3<\/span><\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left; min-width: 100px;\" width=\"10%\"><strong>Board:<\/strong><\/td>\n<td>Adafruit Feather M0<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left; min-width: 100px;\" width=\"10%\"><strong>Activation:<\/strong><\/td>\n<td>OTAA<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left; min-width: 100px;\" width=\"10%\"><strong>Device Class:<\/strong><\/td>\n<td>Class A<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left; min-width: 100px;\" width=\"10%\"><strong>Last updated:<\/strong><\/td>\n<td>October 7, 2023<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This article provides instructions for making a temperature, humidity and pressure sensor using <strong>Adafruit Feather M0 RFM95 LoRa Radio<\/strong> and <strong>BME280<\/strong>. If you haven&#8217;t set up Adafruit Feather M0 yet, check out our<strong> <a href=\"http:\/\/lora.vsb.cz\/index.php\/adafruit-feather-m0\/\" target=\"_blank\" rel=\"noopener\">Adafruit Feather M0 tutorial<\/a> (Activation &#8211; OTAA)<\/strong>.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2410 \" src=\"http:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_AFM0.JPG.jpg\" alt=\"BME280\" width=\"400\" height=\"400\" srcset=\"https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_AFM0.JPG.jpg 600w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_AFM0.JPG-300x300.jpg 300w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_AFM0.JPG-150x150.jpg 150w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #189bd6;\"><strong>Prepare<\/strong><\/span><\/h2>\n<ul>\n<li>Adafruit Feather M0 RFM95 LoRa Radio<\/li>\n<li>BME280<\/li>\n<li>5x wire<\/li>\n<li>breadboard (optional)<\/li>\n<li>PC + micro USB cable<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><strong><span style=\"color: #800000;\">BME280<\/span><\/strong><\/h2>\n<p>To measure temperature, humidity and pressure, we will use the BME280 sensor. The sensor measures temperatures in the range of -40 \u00b0C to 85 \u00b0C, humidity in the range of 0 % to 100 % and pressure in the range of 300 hPa to 1100 hPa. The accuracy of temperature measurement is \u00b1 1.0 \u00baC, humidity \u00b1 3 % and pressure \u00b11 hPa.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2121 \" src=\"http:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/06\/BME280.jpg\" alt=\"BME280\" width=\"251\" height=\"153\" srcset=\"https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/06\/BME280.jpg 600w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/06\/BME280-300x183.jpg 300w\" sizes=\"auto, (max-width: 251px) 100vw, 251px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><strong><span style=\"color: #800000;\">Sensor assembly<\/span><\/strong><\/h2>\n<p>Connect everything according to the schematics bellow.<\/p>\n<p>Wire up the <strong>Adafruit Feather M0&#8217;s IO1 pin<\/strong> with <strong>pin 6<\/strong>. The sensor is connected using four pins. The <strong>BME280 pin VIN<\/strong> is connected to the supply voltage (<strong>3V pin on Adafruit Feather M0<\/strong>), the <strong>BME280 pin GND<\/strong> is connected to the ground (<strong>GND pin on Feather<\/strong>), the <strong>BME280 pin SCK <\/strong>is connected to <strong>Feather\u2019s pin SCL<\/strong> and the <strong>BME280 pin SDI<\/strong> is connected to <strong>Feather\u2019s pin SDA<\/strong>. The sensor requires a stabilized supply voltage in the range of 3.3 V to 5 V for its function.<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2334 \" src=\"http:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_Schematics.png\" alt=\"BME280_Schematics\" width=\"499\" height=\"407\" srcset=\"https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_Schematics.png 600w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_Schematics-300x245.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2><strong><span style=\"color: #800000;\">Arduino IDE setup<\/span><\/strong><\/h2>\n<ol>\n<li>Run Arduino IDE.<\/li>\n<li>In the Arduino IDE <strong>Library Manager<\/strong>\u00a0search <strong>Adafruit BME280 Library<\/strong> by Adafruit and <strong>install it with all dependencies<\/strong> (library <strong>Adafruit Unified Sensor <\/strong>and <strong>Adafruit BusIO<\/strong>).<\/li>\n<li>In the Arduino IDE <strong>Library Manager<\/strong>\u00a0search <strong>CayenneLPP<\/strong> by Electronic Cats and install it.<\/li>\n<li>In the Arduino IDE <strong>Library Manager<\/strong>\u00a0search <strong>RTCZero<\/strong> by Arduino and install it.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #800000;\"><strong>Printing measured values to Serial Monitor<\/strong><\/span><\/h2>\n<ol>\n<li>In the Arduino IDE<strong> File -&gt; Examples -&gt; Adafruit BME280 Library <\/strong><strong>-&gt; <\/strong>open<strong> bme280test<\/strong><\/li>\n<li>Connect Adafruit Feather M0 using micro USB cable to your computer.<\/li>\n<li>In Arduino IDE click on <strong>Upload<\/strong> button to upload program to your Adafruit Feather M0.<\/li>\n<li><span style=\"color: #000000;\">In Arduino IDE click on <strong>Serial Monitor <\/strong>button and you should <strong>every second<\/strong>\u00a0see this:<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3682 \" src=\"http:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/BME280-SerialMonitor.png\" alt=\"BME280 Arduino IDE Serial Monitor\" width=\"601\" height=\"274\" srcset=\"https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/BME280-SerialMonitor.png 892w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/BME280-SerialMonitor-300x137.png 300w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2023\/01\/BME280-SerialMonitor-768x350.png 768w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2><span style=\"color: #800000;\"><strong>Sending <\/strong><\/span><strong><span style=\"color: #800000;\">measured values <\/span><\/strong><span style=\"color: #800000;\"><strong>to TTS<\/strong><\/span><\/h2>\n<p>We have prepared four programs for measuring temperature, humidity and pressure. The first program sends the current measured values. The second program sends averages of measured values over a certain period of time. The other two programs extend the first two with a low power mode, which is great when you run this sensor on battery power.<\/p>\n<h4><strong>Programs<\/strong><\/h4>\n<ul>\n<li><strong><a href=\"https:\/\/github.com\/OndrejKnebl\/TTNv3-LoRaVSB\/blob\/main\/BME280\/BME280_current_measured_values\/BME280_current_measured_values.ino\" target=\"_blank\" rel=\"noopener\">Current measured values<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/github.com\/OndrejKnebl\/TTNv3-LoRaVSB\/blob\/main\/BME280\/BME280_average_measured_values\/BME280_average_measured_values.ino\" target=\"_blank\" rel=\"noopener\">Averages of measured values<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/github.com\/OndrejKnebl\/TTNv3-LoRaVSB\/blob\/main\/BME280\/BME280_current_measured_values_low_power_mode\/BME280_current_measured_values_low_power_mode.ino\" target=\"_blank\" rel=\"noopener\">Current measured values with low power mode<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/github.com\/OndrejKnebl\/TTNv3-LoRaVSB\/blob\/main\/BME280\/BME280_average_measured_values_low_power_mode\/BME280_average_measured_values_low_power_mode.ino\" target=\"_blank\" rel=\"noopener\">Averages of measured values with low power mode<\/a><\/strong><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h4><strong>Instructions<\/strong><\/h4>\n<ol>\n<li>Copy and paste one of this programs to your Arduino IDE.<\/li>\n<li>In program replace\u00a0<strong>APPEUI<\/strong>,\u00a0<strong>DEVEUI<\/strong>\u00a0and\u00a0<strong>APPKEY<\/strong>\u00a0with keys in TTS. Keys are in\u00a0<strong>TTS -&gt; Applications -&gt; YourAppName -&gt; YourEndDeviceName -&gt; Overview -&gt; Activation information<\/strong>.<\/li>\n<li>In\u00a0<strong>TTS -&gt; Applications -&gt; YourAppName -&gt; YourEndDeviceName -&gt; Payload formatters -&gt; Uplink<\/strong>\u00a0change\u00a0<strong>Formatter type<\/strong>\u00a0to\u00a0<strong>CayenneLPP<\/strong>. For more information, check out our\u00a0<a href=\"http:\/\/lora.vsb.cz\/index.php\/cayenne-lpp\/\" target=\"_blank\" rel=\"noopener\"><strong>Cayenne LPP tutorial<\/strong><\/a>.<\/li>\n<li><strong>Save changes<\/strong>.<\/li>\n<li>Connect Adafruit Feather M0 using micro USB cable to your computer.<\/li>\n<li>In Arduino IDE click on\u00a0<strong>Upload<\/strong> button to upload program to your Adafruit Feather M0.<\/li>\n<li>In\u00a0<strong>TTS -&gt; Applications -&gt; YourAppName -&gt; YourEndDeviceName -&gt; Live data<\/strong> you should <strong>every 5 minutes (Low Power Mode &#8211; 10 minutes)<\/strong> see this:<span style=\"color: #ff9900;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2417 \" src=\"http:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_TTN.png\" alt=\"BME280_TTN\" width=\"830\" height=\"377\" srcset=\"https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_TTN.png 1556w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_TTN-300x136.png 300w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_TTN-1024x465.png 1024w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_TTN-768x349.png 768w, https:\/\/lora.vsb.cz\/wp-content\/uploads\/2022\/07\/BME280_TTN-1536x698.png 1536w\" sizes=\"auto, (max-width: 830px) 100vw, 830px\" \/><\/span><br \/>\n<h2><span style=\"color: #800000;\"><strong>Data visualization<\/strong><\/span><\/h2>\n<p>If you want to visualize your measured data, continue with the following tutorial:<\/p>\n<ul>\n<li><strong><a href=\"https:\/\/lora.vsb.cz\/index.php\/telegraf-influxdb-grafana\/\" target=\"_blank\" rel=\"noopener\">Telegraf &amp; InfluxDB &amp; Grafana<\/a><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>TTN version: TTNv3 Board: Adafruit Feather M0 Activation: OTAA Device Class: Class A Last updated: October 7, 2023 This article provides instructions for making a temperature, humidity and pressure sensor using Adafruit Feather M0 RFM95 LoRa Radio and BME280. If you haven&#8217;t set up Adafruit Feather M0 yet, check out our Adafruit Feather M0 tutorial [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2114","page","type-page","status-publish","hentry","post"],"_links":{"self":[{"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/pages\/2114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/comments?post=2114"}],"version-history":[{"count":61,"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/pages\/2114\/revisions"}],"predecessor-version":[{"id":6152,"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/pages\/2114\/revisions\/6152"}],"wp:attachment":[{"href":"https:\/\/lora.vsb.cz\/index.php\/wp-json\/wp\/v2\/media?parent=2114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}