{"id":4357,"date":"2018-09-05T20:00:07","date_gmt":"2018-09-05T18:00:07","guid":{"rendered":"https:\/\/msalamon.pl\/?p=4357"},"modified":"2025-12-27T20:35:57","modified_gmt":"2025-12-27T19:35:57","slug":"bmp180-bmp280-bme280-on-stm32-part-2","status":"publish","type":"post","link":"https:\/\/msalamon.pl\/en\/bmp180-bmp280-bme280-on-stm32-part-2\/","title":{"rendered":"BMP180, BMP280, BME280 on STM32, Part 2"},"content":{"rendered":"\n<p>In the <a href=\"http:\/\/msalamon.pl\/bmp180-bmp280-bme280-na-stm32-cz-1\/\">previous post<\/a> I dealt with the popular pressure and temperature sensor BMP180, which is already going out of production. Today I\u2019ll check its younger brothers \u2013 the BMP280, which measures temperature and pressure as well, and the BME280, which can additionally check how humid the\u2026<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>atmosphere \ud83d\ude09 Let\u2019s get cracking!<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">BMP280<\/h1>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/sklep.msalamon.pl\/produkt\/bmp280-czujnik-cisnienia\/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=bmp280&amp;utm_content=Text\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BMP280_baner-1024x341.jpg\" alt=\"\" class=\"wp-image-956\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BMP280_baner-1024x341.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BMP280_baner-300x100.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BMP280_baner-768x256.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BMP280_baner-24x8.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BMP280_baner-36x12.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BMP280_baner-160x53.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BMP280_baner.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p> <a data-e-disable-page-transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/msalamon.pl\/download\/236\/?tmstv=1766862102\" rel=\"nofollow\" id=\"download-link-236\" data-redirect=\"false\"><br>BMP280 datasheet<\/a><\/p>\n\n\n\n<p>The wiring diagram with the <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/nucleo-f401re\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=bmp280&amp;utm_content=Text\">Nucleo F401RE<\/a> board basically hasn\u2019t changed. The Chinese module with the BMP280 is this time called GY-BMP280 and has 6 pins. The last two have pull-ups on the PCB to their <i>default<\/i> positions, so there\u2019s no need to connect them anywhere.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMPE280_KiCad.png\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"450\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMPE280_KiCad.png\" alt=\"\" class=\"wp-image-200\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMPE280_KiCad.png 960w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMPE280_KiCad-300x141.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMPE280_KiCad-768x360.png 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMPE280_KiCad-24x11.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMPE280_KiCad-36x17.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMPE280_KiCad-160x75.png 160w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>The STM32CubeMX configuration doesn\u2019t change at all compared to the BMP180.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/sklep.msalamon.pl\/kategoria-produktu\/dev-boardy\/stm32-nucleo\/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=bmp280&amp;utm_content=nucleo\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"400\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner.jpg\" alt=\"\" class=\"wp-image-1593\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner.jpg 1200w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-300x100.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-1024x341.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2020\/07\/Nucleo-64-baner-768x256.jpg 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>The BMP280 documentation contains a great comparison table with its older counterpart. Let me just paste it.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP180_vs_BMP280.png\"><img loading=\"lazy\" decoding=\"async\" width=\"465\" height=\"281\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP180_vs_BMP280.png\" alt=\"\" class=\"wp-image-197\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP180_vs_BMP280.png 465w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP180_vs_BMP280-300x181.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP180_vs_BMP280-24x15.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP180_vs_BMP280-36x22.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP180_vs_BMP280-132x80.png 132w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>The differences that matter most to me include its external dimensions. It\u2019s clearly smaller, which makes me happy because I already have an idea for using this sensor. Bosh highlighted a significant difference in current consumption here, which is also a big plus. For a weather station application, the resolutions don\u2019t play a huge role, but it\u2019s nice that they\u2019re higher. The table doesn\u2019t list measurement accuracy. Why? Because it\u2019s the same as the older brother. Communication via SPI. That might be useful for someone. Chinese modules generally don\u2019t support it.<\/p>\n\n\n\n<p>An important difference lies in the operating modes. The newer BMP280 doesn\u2019t allow separate temperature and pressure conversions. In the previous post I checked the conversion time for temperature only and for temperature + pressure. I have to drop the former here.<\/p>\n\n\n\n<p>The new sensors introduced a new operating mode. The mode similar to what I did with the BMP180 is the <i>forced<\/i> mode. To use it, you need to start the sensor in <i>sleep<\/i> mode. Then, when you want to perform a conversion, write data corresponding to the <i>forced<\/i> mode into register 0xF4. This starts the conversion process, which is signaled by a conversion-in-progress flag. In theory, you should wait for this flag to clear. That\u2019s the theory, but the BMP280 played tricks on me. At a 100 kHz clock, the flag would set with a delay lasting roughly as long as checking whether the mode of interest had been invoked. That was tolerable (I was sure it entered <i>forced<\/i> mode), but at 400 kHz I couldn\u2019t tell when the flag would set so I could then wait for it to clear. What did I do? I ignored the flag. Instead, I check whether the sensor has already exited <i>forced<\/i> mode. After the measurement finishes, the BMP280 automatically leaves this mode and lands in <i>sleep<\/i>. And that works great! What do the waveforms look like for <i>forced<\/i> mode?<\/p>\n\n\n\n<p>100 kHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_forcedmode.png\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"273\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_forcedmode.png\" alt=\"\" class=\"wp-image-201\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_forcedmode.png 960w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_forcedmode-300x85.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_forcedmode-768x218.png 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_forcedmode-24x7.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_forcedmode-36x10.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_forcedmode-160x46.png 160w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>400 kHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_forcedmode.png\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"273\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_forcedmode.png\" alt=\"\" class=\"wp-image-202\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_forcedmode.png 960w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_forcedmode-300x85.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_forcedmode-768x218.png 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_forcedmode-24x7.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_forcedmode-36x10.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_forcedmode-160x46.png 160w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>The difference between the functions for reading temperature and pressure is negligible. This is related to combining the conversion of these two quantities, so I\u2019ll skip further discussion of separate conversions. The timing differences visible in the plots relate to the additional readout of the pressure register and conversion of raw data to a proper value. That\u2019s why I added a function to the library that returns two values via the pointers passed as function arguments. Two birds with one stone \ud83d\ude42<\/p>\n\n\n\n<p>It would be good to present the conversion times for different accuracies in a table. Here the BMP280 adds an extra step of measurement accuracy versus power consumption. There are 5 in total. I took measurements with a 16-bit temperature conversion resolution \u2013 as in the BMP180. Increasing the temperature resolution increases the conversion time \u2013 obviously. I\u2019ll skip those tests because 16 bits for this quantity is a very nice result anyway. Oh, and I gave up measuring with a crude <i>delay<\/i>. In the previous post I already concluded it\u2019s not needed at all. Here are the results:<\/p>\n\n\n\n<figure class=\"wp-block-table tablepress tablepress-id-4\"><table class=\"has-fixed-layout\"><tbody><tr><td><\/td><td>100 kHz<\/td><td>400 kHz<\/td><\/tr><tr><td>Ultra Low Power<\/td><td>7,73 ms<\/td><td>6,07 ms<\/td><\/tr><tr><td>Low power<\/td><td>9,7 ms<\/td><td>8,1 ms<\/td><\/tr><tr><td>Standard<\/td><td>13,64 ms<\/td><td>11,96 ms<\/td><\/tr><tr><td>Highres<\/td><td>21,53 ms<\/td><td>19,89 ms<\/td><\/tr><tr><td>Ultrahighres<\/td><td>37,32 ms<\/td><td>35,74 ms<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">BME280<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/sklep.msalamon.pl\/produkt\/bme280-czujnik-cisnienia-srodowiskowy\/?utm_source=blog&amp;utm_medium=banner&amp;utm_campaign=bme280&amp;utm_content=Text\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"341\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_baner-1024x341.jpg\" alt=\"\" class=\"wp-image-954\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_baner-1024x341.jpg 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_baner-300x100.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_baner-768x256.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_baner-24x8.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_baner-36x12.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_baner-160x53.jpg 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_baner.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><a data-e-disable-page-transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/msalamon.pl\/download\/238\/?tmstv=1766862102\" rel=\"nofollow\" id=\"download-link-238\" data-redirect=\"false\"><br>BME280 datasheet<\/a><\/p>\n\n\n\n<p>This guy is a BMP280 extended with humidity measurement. Even Chinese modules can be identical, and the most common difference is a dabbed marker on a different square indicating the version of the mounted sensor (or not dabbed, like mine). Compared to the BMP280, it\u2019s also slightly larger physically, as its dimensions are 2.5 x 2.5 x 0.95 mm. A 0.5 mm difference on one side isn\u2019t a big deal, though. It should fit in a BMP280 footprint without issue. However, the most important change is adding relative humidity measurement, performed with an accuracy of \u00b13 %RH and a resolution of 0.008 %RH. The temperature range for full 0\u00f7100 %RH operation is available for temperatures from 0\u00f765 \u00b0C. In the -40\u00f70 \u00b0C and 65\u00f785 \u00b0C ranges it\u2019s somewhat limited at the top end, as you can find in the documentation. As with the other measured quantities, the humidity conversion draws very little current. With 1-second sampling it\u2019s typically 2.8 \u03bcA. The temperature and pressure measurement parameters are almost identical to the BMP280. The measurement modes and resolutions are similar as well. The temperature and pressure measurements are theoretically completed in the same time as for the BMP280. So how much does adding humidity measurement extend the conversion time? Let\u2019s check!<\/p>\n\n\n\n<p>I trigger the conversion once in <i>forced<\/i> mode, collect the data, and compute the results in a single function. For the lowest sampling, the readout waveform looks as follows:<\/p>\n\n\n\n<p>100 kHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"289\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_-1024x289.png\" alt=\"\" class=\"wp-image-242\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_-1024x289.png 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_-300x85.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_-768x217.png 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_-24x7.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_-36x10.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_-160x45.png 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_100k_forcedmode_.png 1278w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>400kHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"288\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_-1024x288.png\" alt=\"\" class=\"wp-image-243\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_-1024x288.png 1024w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_-300x85.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_-768x216.png 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_-24x7.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_-36x10.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_-160x45.png 160w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_times_400k_forcedmode_.png 1278w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>The additional humidity measurement increases the overall conversion time by about 3 milliseconds compared to the conversion of temperature and pressure alone by the BMP280. However, this is the lowest possible humidity measurement accuracy. Below is a table with results for all <i>oversampling<\/i> levels. Temperature set to 16-bit, pressure to <i>standard<\/i>.<\/p>\n\n\n\n<figure class=\"wp-block-table tablepress tablepress-id-5\"><table class=\"has-fixed-layout\"><tbody><tr><td><\/td><td>100 kHz<\/td><td>400 kHz<\/td><\/tr><tr><td>Ultra Low Power<\/td><td>16,49 ms<\/td><td>14,65 ms<\/td><\/tr><tr><td>Low power<\/td><td>18,46 ms<\/td><td>16,67 ms<\/td><\/tr><tr><td>Standard<\/td><td>22,41 ms<\/td><td>20,64 ms<\/td><\/tr><tr><td>Highres<\/td><td>30,31 ms<\/td><td>28,58 ms<\/td><\/tr><tr><td>Ultrahighres<\/td><td>46,45 ms<\/td><td>44,39 ms<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>As a curiosity, here\u2019s the time to obtain results for all the lowest options and the highest ones on the BME280 sensor.<\/p>\n\n\n\n<figure class=\"wp-block-table tablepress tablepress-id-6\"><table class=\"has-fixed-layout\"><tbody><tr><td><\/td><td>100 kHz<\/td><td>400 kHz<\/td><\/tr><tr><td>All lowest<\/td><td>10,58 ms<\/td><td>8,736 ms<\/td><\/tr><tr><td>All highest<\/td><td>99,72 ms<\/td><td>98,05 ms<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The spread is huge, and you need to answer what really matters in your project. In a battery-powered device you\u2019ll probably want to go toward the lowest <i>oversampling<\/i> and resolution values. For mains power you can go for the highest options. In that case, remember to design the system so everything still runs smoothly. 100 milliseconds may not be much for a human, but that wait time, e.g. between display frames with simple control, may already be uncomfortable for the device user. There\u2019s also another option besides manually forcing conversions.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"640\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit.jpg\" alt=\"\" class=\"wp-image-258\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit.jpg 960w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit-300x200.jpg 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit-768x512.jpg 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit-360x240.jpg 360w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit-24x16.jpg 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit-36x24.jpg 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/08\/BME280_circuit-120x80.jpg 120w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Normal mode<\/h2>\n\n\n\n<p>Undoubtedly a big change compared to the BMP180 is the addition of the <i>periodic (normal)<\/i> mode. What does it give you? Automatic, cyclic conversion of temperature, pressure, and, if present, humidity. The sensor doesn\u2019t need our signal to start conversion \u2013 the measurement is performed cyclically without MCU intervention. Thanks to this, the subsequent readout is much faster. But nothing is free. Cyclic conversion also means a cyclic increase in current consumption. Keep this in mind when designing a battery-powered device. It\u2019s also worth mentioning that the BMP280 and BME280 are set to <i>normal<\/i> mode by <i>default<\/i>. In this mode, you can read just one parameter or all parameters at once. How long does it take? An example for the BMP280:<\/p>\n\n\n\n<p>100 kHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_normalmode.png\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"273\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_normalmode.png\" alt=\"\" class=\"wp-image-198\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_normalmode.png 960w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_normalmode-300x85.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_normalmode-768x218.png 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_normalmode-24x7.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_normalmode-36x10.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_100k_normalmode-160x46.png 160w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>400 kHz<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_normalmode.png\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"271\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_normalmode.png\" alt=\"\" class=\"wp-image-199\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_normalmode.png 960w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_normalmode-300x85.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_normalmode-768x217.png 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_normalmode-24x7.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_normalmode-36x10.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/07\/BMP280_times_400k_normalmode-160x45.png 160w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>Compared to forcing conversion and waiting for it to finish with the BMP180 and in <em>forced<\/em> mode, this is blazingly fast. Sub-1 ms time is impressive. In my opinion, this mode is worth using on mains power. On battery? It depends on requirements. You\u2019d need to do deeper tests over a longer period to see whether cyclic measurement has a big impact on runtime from a cell. The right time for that will come \ud83d\ude42<\/p>\n\n\n\n<p>In the configuration register, the primary setting is the idle time (i.e. interval), which is between successive conversions.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_tstandby.png\"><img loading=\"lazy\" decoding=\"async\" width=\"245\" height=\"250\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_tstandby.png\" alt=\"\" class=\"wp-image-249\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_tstandby.png 245w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_tstandby-24x24.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_tstandby-36x36.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_tstandby-78x80.png 78w\" sizes=\"auto, (max-width: 245px) 100vw, 245px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>I think this is fairly straightforward to understand. If not, the documentation has an appropriate diagram for it. This is the t_standby time.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_timing_diagram.png\"><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"419\" src=\"http:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_timing_diagram.png\" alt=\"\" class=\"wp-image-251\" srcset=\"https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_timing_diagram.png 886w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_timing_diagram-300x142.png 300w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_timing_diagram-768x363.png 768w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_timing_diagram-24x11.png 24w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_timing_diagram-36x17.png 36w, https:\/\/msalamon.pl\/wp-content\/uploads\/2018\/09\/BME280_timing_diagram-160x76.png 160w\" sizes=\"auto, (max-width: 886px) 100vw, 886px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>The second parameter you can set is the IIR filter for pressure measurement. It\u2019s an infinite impulse response filter. Why is it here? Pressure is a parameter that can change very quickly over time (e.g. a puff of air). That\u2019s why the BMP\/BME280 have a built-in filter that mitigates such disturbances. By default it\u2019s disabled and, for example, it isn\u2019t particularly recommended for building a weather station. For a drone, however, it is. You\u2019ll find more information about how it works in the sensor datasheet.<\/p>\n\n\n\n<p>That\u2019s it for this two-post series about the popular pressure sensors from Bosch. Thank you very much if you\u2019ve made it this far. I encourage you to check out my other posts.<\/p>\n\n\n\n<p>If you liked the sensors, you can buy them in my store: <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/bmp280-czujnik-cisnienia\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=bmp280&amp;utm_content=Text\">BMP280<\/a>, <a href=\"https:\/\/sklep.msalamon.pl\/produkt\/bme280-czujnik-cisnienia-srodowiskowy\/?utm_source=blog&amp;utm_medium=article&amp;utm_campaign=bme280&amp;utm_content=Text\">BME280<\/a>.<\/p>\n\n\n\n<p>You\u2019ll find the source code used in this post on GitHub: <a href=\"https:\/\/github.com\/lamik\/BMXX80_STM32_HAL\" target=\"_blank\" rel=\"noopener\">link<\/a><\/p>\n\n\n\n<p>If you noticed an error, disagree with something, or simply feel like discussing the topic, write a comment. Remember that the discussion should be polite and follow the rules of the Polish language.<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;4357&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;0&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;BMP180, BMP280, BME280 on STM32, Part 2&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 0px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\"><\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the previous post I dealt with the popular pressure and temperature sensor BMP180, which is already going out of production. Today I\u2019ll check its younger brothers \u2013 the BMP280, which measures temperature and pressure as well, and the BME280, which can additionally check how humid the\u2026<\/p>\n","protected":false},"author":1,"featured_media":2962,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[160],"tags":[175,176,174,177],"class_list":["post-4357","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stm32","tag-electronics","tag-programming","tag-stm32","tag-stm32cubemx"],"_links":{"self":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/comments?post=4357"}],"version-history":[{"count":3,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4357\/revisions"}],"predecessor-version":[{"id":4470,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/posts\/4357\/revisions\/4470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media\/2962"}],"wp:attachment":[{"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/media?parent=4357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/categories?post=4357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/msalamon.pl\/en\/wp-json\/wp\/v2\/tags?post=4357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}