Cảm Biến Áp Suất BM180 | Cộng đồng Arduino Việt Nam

1. Giới Thiệu

Hôm nay tất cả chúng ta cùng tìm hiểu và khám phá về loại cảm biến đo áp suất BM180. Chuyên dùng trong những dự án Bất Động Sản về môi trường tự nhiên và nó cũng là một trong những tiếp xúc I2C quen thuộc

vì nó rất là tiny và ngắn nên bài viết của mình cũng như vậylaugh.

2. Kết Nối

BM180 Arduino Uno,Mega,..
Vin 5V
GND GND
SCL A5
SDA A4

3. Thư viện và link tải

Link tải thư viện BM180

Mở example và check kết quả qua serial cheeky

#include 
#include 

/*************************************************** 
  This is an example for the BMP085 Barometric Pressure & Temp Sensor

  Designed specifically to work with the Adafruit BMP085 Breakout 
  ----> https://www.adafruit.com/products/391

  These displays use I2C to communicate, 2 pins are required to  
  interface
  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

// Connect VCC of the BMP085 sensor to 3.3V (NOT 5.0V!)
// Connect GND to Ground
// Connect SCL to i2c clock - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 5
// Connect SDA to i2c data - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 4
// EOC is not used, it signifies an end of conversion
// XCLR is a reset pin, also not used here

Adafruit_BMP085 bmp;
  
void setup() {
  Serial.begin(9600);
  if (!bmp.begin()) {
	Serial.println("Could not find a valid BMP085 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 millibar = 101325 Pascal
    Serial.print("Altitude = ");
    Serial.print(bmp.readAltitude());
    Serial.println(" meters");

  // you can get a more precise measurement of altitude
  // if you know the current sea level pressure which will
  // vary with weather and such. If it is 1015 millibars
  // that is equal to 101500 Pascals.
    Serial.print("Real altitude = ");
    Serial.print(bmp.readAltitude(101500));
    Serial.println(" meters");
    
    Serial.println();
    delay(500);
}

Với Temperature hiển thị nhiệt độ

Xem thêm: Bảng giá

Pressure là P áp suất bên ngoài hay còn gọi là áp suất không khí

Altitude độ cao 

Real Altitude độ cao thực so với mực nước biển

4. Lời Kết

Chúng ta hoàn toàn có thể trang bị cho robot thám hiểm môi trường tự nhiên với BM180 hiển thị qua lcd. Bài sau mình sẽ tích hợp BM180 với DHT11 để làm trạm dự báo thời tiết

Chúc những bạn có những ngày đam mê, mê hoặc, mày mò với Cộng đồng Arduino Nước Ta .


Có thể bạn quan tâm
© Copyright 2008 - 2016 Dịch Vụ Bách khoa Sửa Chữa Chuyên nghiệp.
Alternate Text Gọi ngay