{"id":16322080,"url":"https://github.com/balassy/esp8266_bme280_sensor","last_synced_at":"2025-05-14T09:16:23.044Z","repository":{"id":147827495,"uuid":"189890358","full_name":"balassy/ESP8266_BME280_Sensor","owner":"balassy","description":"Easily reusable code to read the BME280 temperature, pressure and humidity sensor by an ESP8266 microcontroller.","archived":false,"fork":false,"pushed_at":"2019-06-02T20:38:12.000Z","size":262,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T15:48:37.124Z","etag":null,"topics":["arduino-iot","arduino-sketch","bme280","bme280pthsensor","esp8266","iot","vscode","wemos-d1-mini"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/balassy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-02T20:09:56.000Z","updated_at":"2019-06-02T20:38:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"b47b5a72-5b49-4a09-b43c-9afc782e47f7","html_url":"https://github.com/balassy/ESP8266_BME280_Sensor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2FESP8266_BME280_Sensor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2FESP8266_BME280_Sensor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2FESP8266_BME280_Sensor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balassy%2FESP8266_BME280_Sensor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balassy","download_url":"https://codeload.github.com/balassy/ESP8266_BME280_Sensor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110450,"owners_count":22016392,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino-iot","arduino-sketch","bme280","bme280pthsensor","esp8266","iot","vscode","wemos-d1-mini"],"created_at":"2024-10-10T22:49:55.906Z","updated_at":"2025-05-14T09:16:23.016Z","avatar_url":"https://github.com/balassy.png","language":"C++","readme":"# Using the BME280 Sensor with an ESP8266 Microcontroller\n\nThis repository contains easily reusable code to read the [BME280](https://lastminuteengineers.com/bme280-arduino-tutorial/) temperature, pressure and humidity sensor by an ESP8266 microcontroller.\n\n\n## Wiring\n\nThis code was tested on Wemos D1 Mini with the following wiring:\n\n![](./doc/wiring.png)\n\n_(Photo from [esp8266learning.com](http://www.esp8266learning.com/esp8266-and-bme280-temperature-sensor-example.php).)_\n\n\n## Usage\n\n1. Add the `Adafruit BME280 Library` and `Adafruit Unified Sensor` library to your project.\n\n2. Copy the `bme280.cpp` and `bme280.h` files to your project folder.\n\n3. Include the `bme280.h` header file into your project:\n```cpp\n#include \"bme280.h\"\n```\n\n4. Create an instance of the sensor (uses the default `0x76` address):\n```cpp\nBME280 bme;\n```\n\n5. Initialize the sensor when your device boots up:\n```cpp\nvoid setup() {\n  bme.init();\n}\n```\n\n6. Read the sensor values:\n```cpp\nvoid loop() {\n  BME280::Measurement measurement = bme.getMeasuredData();\n}\n```\n\n7. Get the temperature, pressure, altitude and humidity values:\n```cpp\nSerial.printf(\"Temperature: %.1f *C\\n\", measurement.temperature);\nSerial.printf(\"Pressure: %.1f hPa\\n\", measurement.pressure);\nSerial.printf(\"Altitude: %.1f m\\n\", measurement.altitude);\nSerial.printf(\"Humidity: %.1f %\\n\", measurement.humidity);\n```\n\nFor a complete example check the `esp8266-bme280.ino` file.\n\nOptional: you can use the `getTemperature()`, `getPressure()`, `getAltitude()` and `getHumidity()` functions of the `BME280` class individually as well.\n\n\n## How it works\n\nThis `BME280` class acts as a wrapper around the [Adafruit BME280 Library](https://github.com/adafruit/Adafruit_BME280_Library) to provide easier setup, and encapsulate all logic, includes and constants related to this sensor.\n\nCurrently this class provides the most frequently used functionality of the sensor, but the sensor provides additional options to further customize its behavior. Check [this example](https://github.com/adafruit/Adafruit_BME280_Library/blob/master/examples/advancedsettings/advancedsettings.ino) to see various scenarios.\n\n\n## About the author\n\nThis project is maintained by [György Balássy](https://linkedin.com/in/balassy).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalassy%2Fesp8266_bme280_sensor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalassy%2Fesp8266_bme280_sensor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalassy%2Fesp8266_bme280_sensor/lists"}