气压传感器

../../../../_images/%E6%B0%94%E5%8E%8B%E4%BC%A0%E6%84%9F%E5%99%A8-H.png

概述

用于检测量大气压强的I2C通讯类的传感器。

技术参数

工作电压: VCC 3.3V -5V

模块尺寸:24*48mm

固定安装:2个兼容塑料积木通孔

测量范围:0-300kPa

引脚 定义

引脚

定义

GND

地

VCC

电源

SCL

I2C时钟

SDA

I2C数据

使用教程

1、在程序编程中需要注意拨动开关地址和程序中的地址一致!

2、气压传感器测量对象为与气管导通的气体的气压,当气管不外接任何装置时测量对象为当前大气压。

示例程序

用掌控板OLED屏显示气压传感器的测量值和温度值。

from mpython import *

from bluebit import Barometric

barometric = Barometric()

import time
while True:
    oled.fill(0)
    oled.DispChar(str(str('当前气压值:') + str((barometric.pressure()))), 0, 0, 1)
    oled.DispChar(str(str('当前温度值:') + str((barometric.temperature()))), 0, 16, 1)
    oled.show()
    time.sleep(0.1)
../../../../_images/%E6%B0%94%E5%8E%8B2.png