MS5611 Barometric Pressure Sensor
Module Source
Purchase Link:
GY-63 MS5611-01BA03 气压传感器 高度传感器模块
Baidu Netdisk Download Link:
https://pan.baidu.com/s/1QOrpiggCE6mBpqabJXUufg
Password: c2pp
Specifications
Operating Voltage:1.8~3.6V
Operating Current: 0.25~23uA
Temperature Accuracy:0.8℃
Temperature Range: -40~85℃
Pressure Range: 10~1200 mbar
Pressure Accuracy: 1.5 mbar
Output Mode: 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.
- SDA: Connect to the A4 pin on the development board (SDA).
- SCL: Connect to the A5 pin on the development board (SCL).
Usage Method
Install Library
- Open the Arduino IDE.
- Go to the menu bar and click on “Tools” > “Manage Libraries…”.
- In the search box, enter "MS5611".
- Find the "MS5611" library and click “Install”.
Enter the code:
c
/******************************************************************************
* 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 <MS5611.h>
MS5611 ms5611;
void setup() {
Serial.begin(9600);
Wire.begin();
if (!ms5611.begin()) {
Serial.println("MS5611 sensor not found");
while (1); // 如果传感器未找到,则停止程序
}
}
void loop() {
ms5611.read(); // 读取气压和温度
Serial.print("Pressure: ");
Serial.print(ms5611.getPressure());
Serial.println(" Pa");
Serial.print("Temperature: ");
Serial.print(ms5611.getTemperature());
Serial.println(" C");
delay(1000); // 每1秒读取一次数据
}
1
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
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
Usage Testing
It will show the temperature and the pressure.