Components: Using BMP 180 Sensor
by 4drobotics in Circuits > Arduino
183 Views, 1 Favorites, 0 Comments
Components: Using BMP 180 Sensor
In here, you'll learn hw to use a BMP180 sensor to outlay accurate altitude, pressure and temperature data.
Supplies
You will need:
- Arduino Uno or Arduino Nano
- Small Breadboard
- Jumper wires
- BMP 180 sensor module
You will need:
- a computer running Mac OS or Windows 10 or higher.
- Arduino IDE software
Construct the Circuit
Firstly, wire the circuit in correlation to the circuit diagram above.
Make sure:
- VCC - 5V
- GND - GND (any of the ground connections)
- SCL - A4
- SDA - A5
Upload Program Code
You will need to upload a code file to IDE via an Arduino cable.
In order for the code to work you will need to download a library.
you need the Adafruit BMP085 unified by Adafruit.
The code is below:
#include <Wire.h>
#include <Adafruit_BMP085.h>
#define seaLevelPressure_hPa 1013.25
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");
Serial.print("Altitude = ");
Serial.print(bmp.readAltitude());
Serial.println(" meters");
Serial.print("Pressure at sealevel (calculated) = ");
Serial.print(bmp.readSealevelPressure());
Serial.println(" Pa");
Serial.print("Real altitude = ");
Serial.print(bmp.readAltitude(seaLevelPressure_hPa * 100));
Serial.println(" meters");
Serial.println();
delay(500);
}
or you can open the Arduino file below.