Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jasonacox/tiny_bme280_library
Arduino tiny library for the BME280 temperature, pressure and humidity sensor using I2C. Minimized to save PROGMEM space.
https://github.com/jasonacox/tiny_bme280_library
arduino-library attiny bme280 humidity-sensor i2c pressure-sensor sensor temperature
Last synced: 6 days ago
JSON representation
Arduino tiny library for the BME280 temperature, pressure and humidity sensor using I2C. Minimized to save PROGMEM space.
- Host: GitHub
- URL: https://github.com/jasonacox/tiny_bme280_library
- Owner: jasonacox
- Created: 2020-07-13T05:12:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-19T13:07:31.000Z (over 1 year ago)
- Last Synced: 2024-11-28T07:24:38.501Z (about 1 month ago)
- Topics: arduino-library, attiny, bme280, humidity-sensor, i2c, pressure-sensor, sensor, temperature
- Language: C++
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tiny BME280 Library #
[![Build Status](https://travis-ci.org/jasonacox/Tiny_BME280_Library.svg?branch=master)](https://travis-ci.org/jasonacox/Tiny_BME280_Library)This is a Arduino library for the BME280 Humidity, Barometric Pressure + Temp sensor
## Description
This is a Arduino library for BME280 sensor for gathering temperature, humidity and pressure using I2C communication. This library is a minimized fork of the more robust [Adafruit_BME280_Library](https://github.com/adafruit/Adafruit_BME280_Library) but with SPI and other features removed to reduce PROGMEM space. This library is ideal for smaller controllers like the ATtiny85.This library was designed to work with the Adafruit BME280 sensor in I2C mode.
* http://www.adafruit.com/products/2652## Setup
These sensors use I2C to communicate, using the I2C Logic pins:
* SCK - this is also the I2C clock pin, connect to the microcontrollers I2C clock line. On the ATtiny85 this is PB2 (physical pin 7)
* SDI or SDA - this is also the I2C data pin, connect to the microcontrollers I2C data line. On the ATtiny85 this is PB0 (physical pin 5)Use of this library also requires the [Adafruit_Sensor](https://github.com/adafruit/Adafruit_Sensor) library to be installed on your system.
Download or clone this Tiny_BME280 library repo into your local Arduino libraries fold (e.g. `~/Documents/Arduino/libraries/` for MacOS) and restart the IDE.
```bash
cd ~/Documents/Arduino/libraries
git clone https://github.com/jasonacox/Tiny_BME280_Library.git
```
This has been tested to work with ATtiny85 microcontrollers using the [ATTinyCore](https://github.com/SpenceKonde/ATTinyCore) core.## Example Usage
```cpp
#include // https://github.com/adafruit/Adafruit_Sensor
#include // https://github.com/jasonacox/Tiny_BME280_Library// Initialize BME280 Class
Tiny_BME280 bme;// Setup
void setup() {
Serial.begin(9600);
while(!bme.begin()) {
Serial.println("BME280 not responding... waiting.");
delay(1000);
}
Serial.println("BME280 activated");
}// Loop
void loop() {
int temperature, pressure, humidity;temperature = bme.readTemperature();
pressure = bme.readPressure() / 100.0;
humidity = bme.readHumidity();Serial.print("Temperature = ");
Serial.print(temperature);
Serial.print("'C [");
Serial.print((temperature * 1.8) + 32);
Serial.println("'F]");
Serial.print("Relative Humidity = ");
Serial.print(humidity);
Serial.println("%");Serial.print("Pressure = ");
Serial.print(pressure);
Serial.println(" hPa");
Serial.println();delay(1000);
}
```