BMP085 Pressure/Temperature Sensor

The BMP085 component allows you get the temperature and pressure from your BMP085 (datasheet BMP085, adafruit BMP085), BMP180 (datasheet BMP180, adafruit BMP180) and BMP280 (datasheet BMP280, adafruit BMP280) sensors with esphomelib. To use these i2c-based devices, first initialize the i2c bus using the pins you have for SDA and SCL and then create the sensors themselves as in below example.

Example Usage

// inside setup()
App.init_i2c(SDA_PIN, SCL_PIN); // change these values for your pins.
// create sensors
App.make_bmp085_sensor("Outside Temperature", "Outside Pressure");

See Application::make_bmp085_sensor().

API Reference

class BMP085Component : public PollingComponent, public I2CDevice

This Component represents a BMP085/BMP180/BMP280 Pressure+Temperature i2c sensor.

It’s built up similar to the DHT component: a central hub that has two sensors.

Public Functions

BMP085Component(I2CComponent *parent, const std::string &temperature_name, const std::string &pressure_name, uint32_t update_interval = 30000)

Construct the BMP085Component using the provided address and update interval.

BMP085TemperatureSensor *get_temperature_sensor() const

Get the internal temperature sensor used to expose the temperature as a sensor object.

BMP085PressureSensor *get_pressure_sensor() const

Get the internal pressure sensor used to expose the pressure as a sensor object.

void update()

Schedule temperature+pressure readings.

void setup()

Setup the sensor and test for a connection.

void dump_config()
float get_setup_priority() const

priority of setup().

higher -> executed earlier

Defaults to 0.

The setup priority of this component

Protected Functions

void read_temperature_()

Internal method to read the temperature from the component after it has been scheduled.

void read_pressure_()

Internal method to read the pressure from the component after it has been scheduled.

bool set_mode_(uint8_t mode)

Protected Attributes

BMP085TemperatureSensor *temperature_ = {nullptr}
BMP085PressureSensor *pressure_ = {nullptr}
CalibrationData calibration_
struct CalibrationData

Public Members

int16_t ac1
int16_t ac2
int16_t ac3
uint16_t ac4
uint16_t ac5
uint16_t ac6
int16_t b1
int16_t b2
int16_t mb
int16_t mc
int16_t md
float temp