BMP180, the temperature and barometric pressure sensor

The BMP180

The BMP180 is an I2C sensor by Bosch Sensortec, measuring the ambient temperature and the barometric pressure and can be used in combination with e.g. the SHT30 to provide weather data. It is described in the data sheet https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMP180.pdf.

bmp180shield.png

Bosch Sensortec provides a driver for this module https://github.com/BoschSensortec/BMP180_driver ,which must be integrated into the embedded system in use by providing the I2C access routines. The driver is supplied in C and must be ported to MicroPython if we want to use it with our ESP32 MicroPython interpreter. I have written such a port and added it to our MicroPython version.

The driver is implemented as a Python class Bmp180 in a file Bmp180Class.py with the following methods:

  • __init__(): Check if a BMP180 is connected to the I2C bus and reads the calibration values.
  • setDebug(onOff): switches debug mode on or off
  • setResolution(res): sets the measurement resolution
  • getResolution(): returns the current measurement resolution
  • chipID(): returns the chip id. This should be 0x55
  • dummyCalib(): uses the default calibration values from the data sheet
  • measure(): makes a measurement and converts it to physical values using the calibration from the BMP180 EPROM.
  • getTemperature(): returns the physical temperature from the last measurement
  • getPressure(): returns the physical pressure value from the last measurement
  • getCalib(): read the calibration values from the BMP180 EPROM

Exercise 1:

Read and print out the chip id

Exercise 2:

Make a measurement and print the current temperature and barometric pressure.

-- Uli Raich - 2021-11-25

Comments

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng bmp180shield.png r1 manage 74.8 K 2021-11-25 - 14:08 UliRaich  
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2021-11-25 - UliRaich
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback