BMP180 is a digital barometric pressure sensor made by Bosch Sensortec (I2C Interface)

Dependents:   LPC1114_data_logger ProjectIOT Wether_Meter LPC1114_barometer_with_data_logging

Embed: (wiki syntax)

« Back to documentation index

BMP180 Class Reference

BMP180 Class Reference

Interface for Bosch Pressure Sensor (I2C Interface) BMP180. More...

#include <BMP180.h>

Public Member Functions

 BMP180 (PinName p_sda, PinName p_scl)
 Configure data pin.
 BMP180 (I2C &p_i2c)
 Configure data pin (with other devices on I2C line)
float read_temperature ()
 Read a float type data from BMP180.
float read_pressure ()
 Read a float type data from BMP180.
uint8_t read_baro_id ()
 Read a BMP180 ID number.
void normalize ()
 Read press and temp data from BMP180 then normalize the data.

Detailed Description

Interface for Bosch Pressure Sensor (I2C Interface) BMP180.

Measurement Air pressure (Barometer) and temperature via I2C interface.

Chip has compensation data in the sensor (inside of EEPROM).

Normalization is specified in the documentation as follows.

Bosch Sensortec BMP180 Datasheet : BST-BMP180-DS000-09 Revision: 2.5 Date: 5 April 2013

 #include "mbed.h"

 // I2C Communication
  BMP180(PinName p_sda, PinName p_scl);   // SDA, SCL
 // If you connected I2C line not only this device but also other devices,
 //     you need to declare following method.
  I2C         i2c(dp5,dp27);              // SDA, SCL
  BMP180(I2C& p_i2c);

 int main() {
 float pressure, temperature;

   bmp180.normalize();    // This is important function Data read from BMP180 then normalization
   pressure = bmp180.read_pressure();         // just read the data
   temperature = bmp180.read_temperature();   // just read the data
 }

Definition at line 51 of file BMP180.h.


Constructor & Destructor Documentation

BMP180 ( PinName  p_sda,
PinName  p_scl 
)

Configure data pin.

Parameters:
dataSDA and SCL pins

Definition at line 57 of file BMP180.cpp.

BMP180 ( I2C &  p_i2c )

Configure data pin (with other devices on I2C line)

Parameters:
I2Cprevious definition

Definition at line 63 of file BMP180.cpp.


Member Function Documentation

void normalize (  )

Read press and temp data from BMP180 then normalize the data.

Parameters:
none
Returns:
none (The result is able to read read_temperature() or read_pressure()).

Definition at line 87 of file BMP180.cpp.

uint8_t read_baro_id (  )

Read a BMP180 ID number.

Parameters:
none
Returns:
if BMP180, it should be 0x55.

Definition at line 77 of file BMP180.cpp.

float read_pressure (  )

Read a float type data from BMP180.

Parameters:
none
Returns:
pressure unit:hPa(hectopascals)

Definition at line 73 of file BMP180.cpp.

float read_temperature (  )

Read a float type data from BMP180.

Parameters:
none
Returns:
temperature unit:degreeC(Celsius)

Definition at line 69 of file BMP180.cpp.