π§ Arduino library for Bosch Sensortec BME280
The library allows using the sensor over I2C or SPI on any board that supports Arduino.
π Features
π Easy to useποΈ Zero dependenciesβοΈ I2C or SPIπ§ͺ 100% code coverageβοΈ Tested on: Arduino Uno, Arduino Nano, NodeMCU, Wemos D1
β¨ Getting Started
π¦ Installation
π PlatformIO
Run pio lib install "malokhvii-eduard/arduino-bme280"
or declare in
platformio.ini
configuration file using lib_deps
option. Enjoy!
π Arduino IDE (Library Manager)
Go to the Arduino IDE and click
Tools > Manage Libraries
. In the library manager dialogue that opens,
enter search query Bme280
. Afterward, find a library
Bme280 by Eduard Malokhvii
and click Install
. Enjoy!
π Arduino IDE (Manual)
Download Bme280.zip
from release assets. Once downloaded, go to the
Arduino IDE and click
Sketch > Include Library > Add .zip Library
. In the file dialogue that opens,
locate your downloaded ZIP file. Afterward, you should receive a
Library Added
message just above the debug window. Enjoy!
π Usage
There are various examples to demonstrate usage of the library. The examples are listed below:
- TwoWire.ino β read temperature, pressure, humidity over I2C
- FourWire.ino β read temperature, pressure, humidity over SPI
- Settings.ino β set different settings
β FAQs
πββοΈ In which units temperature, pressure, humidity are measured?
Β°C
).
The pressure is measured in pascals (symbol: Pa
). The humidity is measured
in percentages (symbol: %
).
πββοΈ What settings are used by default?
- mode β
Bme280Mode::Normal
- temperature oversampling β
Bme280Oversampling::X16
- pressure oversampling β
Bme280Oversampling::X16
- humidity oversampling β
Bme280Oversampling::X16
- filter β
Bme280Filter::Off
- standby time β
Bme280StandbyTime::Ms0_5
πββοΈ Are there any settings presets out-of-the-box?
Bme280Settings
.
The factory methods are listed below:
Bme280Settings::indoor()
Bme280Settings::weatherMonitoring()
Bme280Settings::gaming()
Bme280Settings::humiditySensing()
πββοΈ How to off one of any measurements?
Bme280Oversampling::Off
to an oversampling in settings.
πββοΈ How does it work?
π οΈ Tech Stack
βοΈ Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/awesome-feature
) - Commit your Changes (
git commit -m 'Add awesome feature'
) - Push to the Branch (
git push origin feature/awesome-feature
) - Open a Pull Request
π Like this project?
Leave a
β οΈ License
arduino-bme280
is licenced under the MIT License. See the LICENSE
for more information.