{"id":12494,"date":"2016-11-09T17:10:55","date_gmt":"2016-11-09T22:10:55","guid":{"rendered":"http:\/\/embedded-lab.com\/blog\/?p=12494"},"modified":"2016-11-10T20:28:15","modified_gmt":"2016-11-11T01:28:15","slug":"chipkit-project-6-bme280-weather-station","status":"publish","type":"post","link":"https:\/\/embedded-lab.com\/blog\/chipkit-project-6-bme280-weather-station\/","title":{"rendered":"ChipKIT Project 6: BME280 Weather Station"},"content":{"rendered":"<p><a href=\"https:\/\/www.bosch-sensortec.com\/bst\/products\/all_products\/bme280\" target=\"_blank\">BME280<\/a> is a\u00a0fully integrated environmental unit from Bosch that combines sensors for pressure, humidity, and temperature in a tiny 8-pin metal-lid LGA package of size 2.5 x 2.5 x 0.93 mm\u00b3. Because of its compact size, ease of use (BME280 supports standard I2C and SPI interfaces), and availability of supporting open-source Arduino libraries, BME280 is very popular among weather enthusiasts. This project\u00a0describes how to read barometric pressure, relative humidity, and temperature measurements from BME280 using chipKIT Uno32\u00a0to make a standalone weather station. The sensor readings are acquired over an I2C bus and are displayed on a Nokia 5110 LCD display.<\/p>\n<div id=\"attachment_12508\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P_20161109_153854.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-12508\" class=\"size-full wp-image-12508\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P_20161109_153854.jpg\" alt=\"BME280 weather station\" width=\"800\" height=\"471\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P_20161109_153854.jpg 800w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P_20161109_153854-580x341.jpg 580w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><p id=\"caption-attachment-12508\" class=\"wp-caption-text\">BME280 weather station<\/p><\/div>\n<h4>Hardware setup<\/h4>\n<p>Nokia 5110 LCD was used in Nokia\u2019s popular 5110 and 3310 model cell phones. It is a 48\u00d784 pixels matrix LCD driven by the\u00a0low-power <a href=\"https:\/\/www.sparkfun.com\/datasheets\/LCD\/Monochrome\/Nokia5110.pdf\" target=\"_blank\">PCD8544 controller<\/a> chip. It is powered by 3.3V and includes on-chip generation of LCD supply and bias voltages, thus requiring minimum\u00a0external components for its operation.\u00a0The PCD8544 receives display data and commands from a microcontroller through a serial bus interface.<\/p>\n<p>The LCD requires 5 I\/O pins for full control.\u00a0The pins available in almost every Nokia 5110 LCD modules are listed below:<span id=\"more-10968\"><\/span><\/p>\n<ol>\n<li>RST: Display reset input<\/li>\n<li>CE: Chip enable input<\/li>\n<li>DC: Data or Command select signal<\/li>\n<li>DIN: Serial data input<\/li>\n<li>CLK: Clock input<\/li>\n<li>VCC: 3.3V power supply<\/li>\n<li>BL: Backlight LED anode (connect to 3.3V)<\/li>\n<li>GND: Power supply ground<\/li>\n<\/ol>\n<p>The connections between the chipKIT Uno32 and Nokia 5110 LCD are similar to what I used before in <strong><a href=\"http:\/\/embedded-lab.com\/blog\/chipkit-nokia-5110-lcd-example\/\" target=\"_blank\">this article<\/a><\/strong>. The following figure shows the pin connections between the two.<\/p>\n<div id=\"attachment_12505\" style=\"width: 519px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/01\/PinConnections1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-12505\" class=\"size-full wp-image-12505\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/01\/PinConnections1.jpg\" alt=\"Pin connections between Nokia 5110 LCD and chipKIT Uno32\" width=\"509\" height=\"222\" \/><\/a><p id=\"caption-attachment-12505\" class=\"wp-caption-text\">Pin connections between Nokia 5110 LCD and chipKIT Uno32<\/p><\/div>\n<p>There are lots of BME280 breakout modules available in the market. You can use any of them with\u00a0access to the\u00a0I2C pins. The SDA and SCL pins are then connected to A4 and A5 pins of chipKIT Uno32, respectively. Note that in order to use the A4 and A5 pins for I2C operation, the JP6 and JP8 jumpers on board chipKIT Uno32 must be placed in RG3 and RG2 positions, respectively. They are placed in the RG3\/RG2 position to use the pins for I2C operation. The complete hardware setup for this project is shown in the following figure.<\/p>\n<div id=\"attachment_12503\" style=\"width: 1002px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/BMe280chipkit.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-12503\" class=\"size-full wp-image-12503\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/BMe280chipkit.jpg\" alt=\"Connections between chipKIT Uno32, BME280 and Nokia 5110 LCD\" width=\"992\" height=\"595\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/BMe280chipkit.jpg 992w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/BMe280chipkit-580x348.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/BMe280chipkit-600x360.jpg 600w\" sizes=\"auto, (max-width: 992px) 100vw, 992px\" \/><\/a><p id=\"caption-attachment-12503\" class=\"wp-caption-text\">Connections between chipKIT Uno32, BME280 and Nokia 5110 LCD<\/p><\/div>\n<div id=\"attachment_12510\" style=\"width: 870px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/setup1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-12510\" class=\"size-large wp-image-12510\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/setup1-1024x697.jpg\" alt=\"The actual setup of the project. The Nokia5110 LCD and BME280 sensor modules are laid out on a breadboard.\" width=\"860\" height=\"585\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/setup1-1024x697.jpg 1024w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/setup1-580x395.jpg 580w\" sizes=\"auto, (max-width: 860px) 100vw, 860px\" \/><\/a><p id=\"caption-attachment-12510\" class=\"wp-caption-text\">The actual setup of the project. The Nokia5110 LCD and BME280 sensor modules are laid out on a breadboard.<\/p><\/div>\n<h4>Software<\/h4>\n<p>We will need to install the following libraries prior to\u00a0develop the firmware for this project.<\/p>\n<p><strong><a href=\"https:\/\/github.com\/adafruit\/Adafruit_Sensor\" target=\"_blank\">Adafruit unified sensor library<\/a><\/strong><\/p>\n<p><a href=\"https:\/\/github.com\/adafruit\/Adafruit_BME280_Library\" target=\"_blank\"><strong>Adafruit BME280 library<\/strong><\/a><\/p>\n<p><strong><a href=\"http:\/\/www.rinkydinkelectronics.com\/library.php\" target=\"_blank\">Nokia 5110 LCD library<\/a><\/strong> for chipKIT from <a href=\"http:\/\/www.rinkydinkelectronics.com\/\" target=\"_blank\">Rinky-Dink Electronics<\/a>, which contains two versions of the LCD libraries: <strong><a href=\"http:\/\/www.rinkydinkelectronics.com\/download.php?f=LCD5110_Basic.zip\" target=\"_blank\">LCD5110_Basic<\/a><\/strong>, which supports texts, and <strong><a href=\"http:\/\/www.rinkydinkelectronics.com\/download.php?f=LCD5110_Graph.zip\" target=\"_blank\">LCD5110_Graph<\/a><\/strong>, which supports text, graph, and bitmaps. In this project, only the Basic library is used, which can be downloaded from the following link.<\/p>\n<p><strong><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/01\/LCD5110_Basic.zip\">Download LCD5110_Basic<\/a><\/strong><\/p>\n<p>The complete chipKIT program for this project\u00a0can be downloaded from the following link:<\/p>\n<p><strong><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P6_BME280_Weather_Station.zip\">Download_BME280_Weather_Station_Firmware<\/a><\/strong><\/p>\n<p>The program displays ambient temperature in Centigrade, humidity in %, and atmospheric pressure in hectopascal (hPa) units.<\/p>\n<h4>Output<\/h4>\n<p>After uploading the program to Uno32 board, the weather station is ready to rock. The following pictures shows the output displayed on the LCD screen.<\/p>\n<div id=\"attachment_12511\" style=\"width: 870px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/op2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-12511\" class=\"size-large wp-image-12511\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/op2-1024x846.jpg\" alt=\"Weather station displaying temperature, humidity, and pressure.\" width=\"860\" height=\"711\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/op2-1024x846.jpg 1024w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/op2-580x479.jpg 580w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/op2.jpg 1737w\" sizes=\"auto, (max-width: 860px) 100vw, 860px\" \/><\/a><p id=\"caption-attachment-12511\" class=\"wp-caption-text\">Weather station displaying temperature, humidity, and pressure.<\/p><\/div>\n<div id=\"attachment_12512\" style=\"width: 810px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P_20161108_221955.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-12512\" class=\"size-full wp-image-12512\" src=\"http:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P_20161108_221955.jpg\" alt=\"Atmospheric pressure is shown in hPa unit.\" width=\"800\" height=\"583\" srcset=\"https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P_20161108_221955.jpg 800w, https:\/\/embedded-lab.com\/blog\/wp-content\/uploads\/2016\/11\/P_20161108_221955-580x423.jpg 580w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><p id=\"caption-attachment-12512\" class=\"wp-caption-text\">Atmospheric pressure is shown in hPa unit.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>BME280 is a\u00a0fully integrated environmental unit from Bosch that combines sensors for pressure, humidity, and temperature in a tiny 8-pin metal-lid LGA package of size 2.5 x 2.5 x 0.93 mm\u00b3. Because of its compact size, ease of use (BME280 supports standard I2C and SPI interfaces), and availability of supporting open-source Arduino libraries, BME280 is very popular among weather enthusiasts. This project\u00a0describes how to read barometric pressure, relative humidity, and temperature measurements from BME280 using chipKIT Uno32\u00a0to make a standalone weather station. The sensor readings are acquired over an I2C bus and are displayed on a Nokia 5110 LCD display.<\/p>\n","protected":false},"author":1,"featured_media":12508,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[401,1464,1467],"tags":[1549,1553,1550],"class_list":["post-12494","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chipkit","category-featured","category-projects","tag-chipkit-bme280","tag-chipkit-weather-station","tag-nokia-5110-lcd"],"_links":{"self":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/12494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/comments?post=12494"}],"version-history":[{"count":9,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/12494\/revisions"}],"predecessor-version":[{"id":12528,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/posts\/12494\/revisions\/12528"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media\/12508"}],"wp:attachment":[{"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/media?parent=12494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/categories?post=12494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/embedded-lab.com\/blog\/wp-json\/wp\/v2\/tags?post=12494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}