BMP180 Barometric Pressure Sensor
The BMP180 is a high-precision, compact, and low-power pressure sensor that can be easily applied in mobile devices. Traditionally, measuring altitude involves measuring atmospheric pressure at a given height and then converting it to altitude data. The BMP180 not only measures atmospheric pressure in real-time but also measures temperature. Additionally, it features an I2C interface, making it convenient for microcontrollers to access. It is also easy to use, requiring minimal operation to read the pressure and temperature data.
Module Source
Purchase Link: https://detail.tmall.com/item.htm?abbucket=0&id=521331189285&ns=1&spm=a21n57.1.0.0.71d8523cm3qMhZ
Baidu Netdisk Download Link:
https://pan.baidu.com/s/1miTIphm
Specifications
Operating Voltage:1.8~3.6V
Operating Current:0.1~1000uA
Temperature Accuracy:±1℃
Temperature Range:0~65℃
Pressure Range: 300~1100 hPa
Pressure Accuracy: 1 hPa
Output Method: IIC
Pin Count: 3 Pins
Hardware Connection
- VCC: Connect to the 3.3V pin on the development board.
- GND: Connect to the GND pin on the development board.
- SCL: Connect to the A5 pin on the development board (SCL).
- SDA: Connect to the A4 pin on the development board (SDA).
Usage Method
Install Library
- Open the Arduino IDE.
- Go to the menu bar and click on “Tools” > “Manage Libraries…”.
- In the search box, type “BMP180” or “Adafruit BMP085” to find the applicable library.
- Install the Adafruit BMP085 Library.
Enter the code:
/******************************************************************************
* Test Hardware: LCSC ColorEasyDuino Development Board
* Version Number: V1.0
* Modified By: www.lckfb.com
* Modification Date: April 10, 2024
* Function Overview:
*****************************************************************************
* Open-source development board hardware and software information and related projects hardware and software information on official website
* Development board official website: www.lckfb.com
* Technical support resident forum, any technical problems are welcome at any time to exchange learning
* LCSC Forum: club.szlcsc.com
* Follow our Bilibili account: [立创开发板], stay toned to our latest news!
* We focus on cultivating Chinese engineers rather than profiting from board sales.
******************************************************************************/
#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 BMP085/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");
// 计算海拔高度,假设“标准”海平面压力是101325 Pa
Serial.print("Altitude = ");
Serial.print(bmp.readAltitude());
Serial.println(" meters");
Serial.println();
delay(1000);
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44