選擇合適的部件
BMP系列氣壓傳感器包含2個產品:BMP280和BMP388。下表展示了這些產品的特性概覽。
關鍵特性
- 帶有金屬蓋的LGA封裝
- SPI或I2C接口
- 內置IIR濾波器
產品間的差異
BMP產品家族之間的主要差異在於封裝的厚度以及MEMS元件的整體性能。與BMP280相比,BMP388在更小的封裝中提供了更高的性能。完整的差異列表見下表:
參考設計
下圖展示了一個典型用例的完整原理圖。
材料清單
布局建議
因為BMP傳感器家族在封裝內包含微小的機械結構,在布局階段必須小心以確保最佳性能。完整的處理和焊接指南可以在Bosch Sensortec的網站上找到。下面提供了BMP388氣壓傳感器的典型PCB Layout。
製造注意事項
首次上電
首次為傳感器供電後,將測試初始規格以與設備通信。這可以通過簡單地讀取寄存器0xD0(BMP280)或0x00(BMP388)中的晶片識別碼來完成。以下是預期值:
以下是使用COINES軟體作為主機,基於BMP388執行此測試的一些示例代碼。
/*!
* @brief This internal API is used to check the bmp388 sensor chip ID
*
* @param[in] void
*
* @return void
*
*/
static void init_bmp3(void)
{
int8_t rslt;
rslt = bmp3_init(&bmp3Dev);
if (rslt == BMP3_OK)
{
printf("BMP3 Initialization Success!\n");
printf("Chip ID 0x%X\n", bmp3Dev.chip_id);
}
else
{
printf("Chip Initialization failure !\n");
exit(COINES_E_FAILURE);
}
}
How to read sensor data
Here is some sample code on how to read sensor data, based on the BMP388, using the COINES software as the host
/*!
* @brief This internal API is used to read the streaming data in a while loop and
* print in console.
*
* @param[in] void
*
* @return void
*/
static void read_sensor_data(void)
{
int times_to_read = 0;
while (times_to_read < 200)
{
bmp3_get_sensor_data(BMP3_ALL, &bmp3_comp_data, &bmp3Dev);
printf("T: %.2f, P: %.2f \n", (bmp3_comp_data.temperature / 100.), (bmp3_comp_data.pressure / 100.));
fflush(stdout);
coines_delay_msec(10);
times_to_read = times_to_read + 1;
}
}
評論