In this video lesson we explain how to use the BMP180 to measure barometric pressure and temperature. We explain basic concepts of what pressure is, and we show how the BMP180 measures pressure. The circuit schematic we use is shown here:
For your convenience, this is the code we developed in the video for measuring Temperature and Barometric Pressure.
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 |
#include <Adafruit_BMP085.h> Adafruit_BMP085 BP; float Pressure; float tempC; bool BMPconnected; void setup() { Serial.begin(9600); BMPconnected = BP.begin(); if (BMPconnected == true) { Serial.println("BMP180 Found and Connected."); } if (BMPconnected == false) { Serial.println("BMP180 Not Found. Check Connections"); } } void loop() { tempC = BP.readTemperature(); Pressure = BP.readPressure(); Serial.println("READINGS ------------"); Serial.print("Temperature = "); Serial.print(BP.readTemperature()); Serial.println(" *C"); Serial.print("Pressure = "); Serial.print(Pressure); Serial.println(" Pascals"); Serial.println(""); delay(1000); } |