cactus.io logo

How to Hookup BMP183 Barometric Pressure Sensor to Arduino

Overview

The BMP183 is the function compatible successor of the BMP085, a new generation of high precision digital pressure sensors for consumer applications.

The sensor is based on piezo-resistive technology for EMC robustness, high accuracy and linearity as well as long term stability. The BMP183 uses a SPI interface to communicate with the micro controller.

In this hookup we are only connecting one device to the Arduino. It reads the barometric pressure and temperature and displays it on the console.

Images

Bosch BMP183 Barometric Pressure Sensor Details
Note: Images shown on this page are not to scale.

Hardware and Software Parts List


Data Sheets


Wiring up Adafruit BMP183 sensor breakout board


We can connect up the BMP183 Sensor board using either the Arduino Hardware SDI pins or we can use software SPI which allows us to use any of the digital pins. The BMP183 requires 4 wires for the SPI bus plus power and ground. The power can be either 5V or 3.3V.


Hookup Diagram for connecting the Adafruit BMP183 breakout board to Arduino using Software SPI

In this hookup we are connecting the SPI bus wires to digital input pins 10 to 13. We are using 5V for the power supply.

Connect Arduino to Bosch BMP183 Barometric Pressure Sensor Hookup

Software

The hookup and Arduino Sketch is for connecting a single Adafruit BMP183 breakout board.

You will need to download the cactus.io BMP183 library to work with this sample sketch. The library supports reading the barometric pressure and temperature from the sensor.

The sensor returns the temperature in degrees celsius by design. We can call the method in the BMP183 library called getTemperature_C to get the celsius value or getTemperature_F for the value in fahrenheit.

The barometric pressure from the sensor is returned in Pascals. 100 Pascals = 1hPa = 1 millibar. The library method getPressure_P will return the value in Pascals. The method getPressure_MB will return the value in millibars.

In the sample sketch we are setting the altitude to 0 based on the current barometric pressure. If you raise the BMP183 the altitude should increase in relation to height that the sketch was activated. We set the base altitude when the sketch starts up.

Limitations
  • The sketch Supports only one sensor connected.
  • Its blocking code.
Bosch BMP183 Sample Sketch
Download as (Arduino Sketch) (Text File)
1
/* This is a demo for the Bosch BMP183 Atmospheric Pressure Sensor. This example uses software based SPI which allows
2
us to use any of the digital I/O pins.
3
4
We used the Adafruit BMP183 breakout board. Click on this link to go to the Adafruit website for more
5
details about this board.
6
http://www.adafruit.com/products/1900
7
8
For information about hooking up this board to the Arduino then click on this link
9
to visit the hookup guide on the cactus.io website.
10
http://http://cactus.io/hookups/sensors/barometric/bmp183/hookup-arduino-to-bmp183-barometric-pressure-sensor
11
*/
12
13
#include <SPI.h>
14
#include "cactus_io_BMP183.h"
15
16
// This sketch uses software based SPI. We need to define the pins for SPI functionality
17
#define BMP183_CS 10 // Slave Select
18
#define BMP183_SDI 11 // Slave In
19
#define BMP183_SDO 12 // Slave Out
20
#define BMP183_CLK 13 // Serial Clock
21
22
#define SEALEVELPRESSURE 1013.75 // Pressure at Sea Level. Used for altitude calculations
23
24
// create bmp183 sensor object with software SPI pins defined
25
cactus_io_BMP183 bmp = cactus_io_BMP183(BMP183_CLK, BMP183_SDO, BMP183_SDI, BMP183_CS);
26
27
void setup(void){
28
Serial.begin(9600);
29
Serial.println("Bosch BMP183 Barometric Pressure - Temperature Sensor | cactus.io");
30
31
// Initialise the sensor
32
if (!bmp.begin()) {
33
// oops we did not find the BMP183
34
Serial.println("Couldn't find BMP183 ... check your wiring!");
35
while (1);
36
}
37
38
bmp.setBaseAltPressure();// set the base level pressure for height calulations
39
// bmp.setSeaLevelPressure(SEALEVELPRESSURE);// set the local pressure at sea level for alt calculations
40
41
Serial.print("Base Level Pressure: ");Serial.println(bmp.getBaseAltPressure());
42
Serial.print("Pressure\tPressure\tAltitude\tTemp\t\tTemp");
43
Serial.print("(pascals)\t(millibars)\t(metres)\t(celsius)\t(fahrenheit)");
44
}
45
46
void loop(void) {
47
bmp.readPressure();
48
bmp.readTemperature();
49
50
Serial.print(bmp.getPressure_P()); Serial.print("\t\t");// Pressure in Pascals
51
Serial.print(bmp.getPressure_MB()); Serial.println("\t\t");// Pressure in millibars
52
Serial.print(bmp.getAltitude()); Serial.println("\t\t");
53
Serial.print(bmp.getTemperature_C()); Serial.println(" *C\t");
54
Serial.print(bmp.getTemperature_F()); Serial.println(" *F\t");
55
56
delay(2000);// delay just to slow down console update
57
}

Sketch Console Output

Arduino Bosch BMP184 Barometric Pressure Sensor Sketch

Other Resources

Adafruit BMP184 Barometric Pressure Tutorial

License