The BMP180 a successor of BMP085 a new generation of high precision, ultra-low power digital pressure sensor. The BMP180 is optimized for use in mobile devices, PDA, GPS navigation and outdoor equipment with a low altitude noise of merely 0.25m at fast conversion time.
BMP180 offers superior performance that driven by i2C interface allows you for easy system integration driven by microcontroller.
The BMP180 is based on piezo-resistive technology for EMC robustness, high accuracy, and linearity as well as long term stability.
Required Component
- Arduino, ATMEGA32U4, Teensy, Microcontroller & ESP826612-NodeMCU (Arduino IDE Integration)
- BMP180 Barometric Sensor
- Solderless Breadboard
- Jumper Wires / DuPont Wires
If you’re using an Arduino, simply connect the VIN pin to the 5V voltage pin, GND to ground, SCL to I2C Clock (Analog 5) and SDA to I2C Data (Analog 4). & download the BMP085/BMP180 Arduino library and example code for pressure calculation. Install the library, and load the example sketch.
Wiring Diagram
Sketch Code
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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
#include <Wire.h> #include <Adafruit_Sensor.h> #include <Adafruit_BMP085_U.h> /* Download the code library below. Connections =========== Uno Mega 2560 Connect SCL to A5 SCL Connect SDA to A4 SDA Connect VDD to 3.3V DC Connect GROUND to common ground */ Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085); void displaySensorDetails(void) { sensor_t sensor; bmp.getSensor(&sensor); Serial.println("------------------------------------"); Serial.print ("Sensor: "); Serial.println(sensor.name); Serial.print ("Driver Ver: "); Serial.println(sensor.version); Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id); Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println(" hPa"); Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println(" hPa"); Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println(" hPa"); Serial.println("------------------------------------"); Serial.println(""); delay(500); } void setup(void) { Serial.begin(9600); Serial.println("Pressure Sensor Test"); Serial.println(""); /* Initialise the sensor */ if(!bmp.begin()) { /* There was a problem detecting the BMP085 ... check your connections */ Serial.print("Ooops, no BMP085 detected ... Check your wiring or I2C ADDR!"); while(1); } /* Display some basic information on this sensor */ displaySensorDetails(); } void loop(void) { /* Get a new sensor event */ sensors_event_t event; bmp.getEvent(&event); /* Display the results (barometric pressure is measure in hPa) */ if (event.pressure) { /* Display atmospheric pressue in hPa */ Serial.print("Pressure: "); Serial.print(event.pressure); Serial.println(" hPa"); float temperature; bmp.getTemperature(&temperature); Serial.print("Temperature: "); Serial.print(temperature); Serial.println(" C"); /* Then convert the atmospheric pressure, SLP and temp to altitude */ /* Update this next line with the current SLP for better results */ float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA; Serial.print("Altitude: "); Serial.print(bmp.pressureToAltitude(seaLevelPressure, event.pressure, temperature)); Serial.println(" m"); Serial.println(""); } else { Serial.println("Sensor error"); } delay(1000); } |
Downloads