The Adafruit BMP180 is a compact, high-precision sensor designed for measuring atmospheric pressure, temperature, and altitude. Utilizing a piezoresistive MEMS pressure sensor, the BMP180 provides accurate data with minimal power consumption, making it ideal for mobile applications, weather stations, indoor navigation, and altitude sensing for drones and other flying electronics.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (1.8V to 3.6V) |
2 | GND | Ground connection |
3 | SCL | I2C clock line |
4 | SDA | I2C data line |
5 | XCLR | Not connected (used for factory testing) |
6 | EOC | End of conversion output (optional use) |
#include <Wire.h>
#include <Adafruit_BMP085.h>
Adafruit_BMP085 bmp;
void setup() {
Serial.begin(9600);
if (!bmp.begin()) {
Serial.println("Could not find a valid BMP180 sensor, check wiring!");
while (1) {}
}
}
void loop() {
Serial.print("Temperature = ");
Serial.print(bmp.readTemperature());
Serial.println(" *C");
Serial.print("Pressure = ");
Serial.print(bmp.readPressure());
Serial.println(" Pa");
// Calculate altitude assuming 'standard' barometric
// pressure of 1013.25 hPa = 101325 Pa
Serial.print("Altitude = ");
Serial.print(bmp.readAltitude());
Serial.println(" meters");
Serial.print("Pressure at sea level (calculated) = ");
Serial.print(bmp.readSealevelPressure());
Serial.println(" Pa");
Serial.println();
delay(5000);
}
Q: Can the BMP180 be used with a 5V system? A: While the BMP180 is a 3.3V device, many breakout boards include a voltage regulator and logic level conversion, allowing it to be interfaced with 5V systems. Always check the specifications of the breakout board.
Q: How can I calibrate the BMP180 for altitude measurements?
A: To calibrate the sensor for altitude, you need a reference sea-level pressure value for your location, which can often be obtained from local weather services. Use this value in the readAltitude(seaLevelPressure)
function to get accurate altitude readings.
Q: What is the default I2C address of the BMP180? A: The default I2C address of the BMP180 is 0x77.
Q: How often should I read data from the sensor? A: The BMP180 can be read as often as needed, but for most applications, a few readings per minute are sufficient. Reading too frequently can lead to self-heating and slightly less accurate temperature readings.