# Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/017/122/medium800/sensors_1900-00.jpg?1401851105)

Fans of the BMP085/BMP180 will want to take a look at the new BMP183 - an **SPI** spin on the old familiar classic. This precision sensor from Bosch is the best low-cost sensing solution for measuring barometric pressure and temperature. Because pressure changes with altitude you can also use it as an altimeter!

![](https://cdn-learn.adafruit.com/assets/assets/000/017/123/medium800/sensors_1900-01.jpg?1401851121)

The BMP183 is the next-generation of sensors from Bosch, and is the fraternal twin of the BMP180 - with a low altitude noise of 0.25m and the same fast conversion time. It has the same specifications, but uses SPI instead of I2C. This is great for users where there is an I2C address collision, they want more than one sensor on a single microcontroller, more flexibility on pin usage, or just prefer the simplicity of SPI.

![](https://cdn-learn.adafruit.com/assets/assets/000/017/124/medium800/sensors_1900-02.jpg?1401851131)

The sensor is soldered onto a PCB and comes with a 3.3V regulator (so you can use it with 3-5V power), SPI level shifter (so you can use it with 3-5V logic).

# Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/017/125/medium800/sensors_pinout.jpg?1401851465)

## Power Pins:

- **Vin** - this is the power pin. Since the chip uses 3 VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V
- **3Vo** - this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like  
- **GND** - common ground for power and logic

# SPI Logic pins:

All pins going into the breakout have level shifting circuitry to make them 3-5V logic level safe. Use whatever logic level is on **Vin!**

- **SCK** - This is the **S** PI **C** loc **k** pin, its an input to the chip
- **SDO** - this is the **S** erial **D** ata **O** ut / **M** icrocontroller&nbsp; **I** n **S** ensor **O** ut pin, for data sent from the BMP183 to your processor
- **SDI** - this is the **S** erial **D** ata **I** n / **M** icrocontroller&nbsp; **O** ut **S** ensor&nbsp; **I** n pin, for data sent from your processor to the BMP183
- **CS** - this is the **C** hip **S** elect pin, drop it low to start an SPI transaction. Its an input to the chip

If you want to connect multiple BMP183's to one microcontroller, have them share the SDI, SDO and SCK pins. Then assign each one a unique CS pin.

# Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/017/142/medium800/sensors_1900-01.jpg?1401900550)

 
## Prepare the header strip:
Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - **long pins down** ![sensors_header.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/136/medium640/sensors_header.jpg?1401900428)

## Add the breakout board:
Place the breakout board over the pins so that the short pins poke through the breakout pads![sensors_place.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/137/medium640/sensors_place.jpg?1401900439)

 
## And Solder!
 Be sure to solder all pins for reliable electrical contact.  
  
_(For tips on soldering, be sure to check out our_ [_Guide to Excellent Soldering_](http://learn.adafruit.com/adafruit-guide-excellent-soldering)_)._![sensors_solder1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/138/medium640/sensors_solder1.jpg?1401900454)

![sensors_solder2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/139/medium640/sensors_solder2.jpg?1401900460)

![sensors_solder3.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/140/medium640/sensors_solder3.jpg?1401900465)

You're done! Check your solder joints visually and continue onto the next steps

![sensors_done.jpg](https://cdn-learn.adafruit.com/assets/assets/000/017/141/medium640/sensors_done.jpg?1401900472)

# Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor

## Wiring and Test

You can easily wire this breakout to any microcontroller, we'll be using an Arduino. For another kind of microcontroller, as long as you have 4 available pins it is possible to 'bit-bang SPI'. Check out the library, then port the code.

![](https://cdn-learn.adafruit.com/assets/assets/000/017/176/medium800/sensors_wiring.jpg?1401911305)

Since this is a SPI sensor, we can use hardware or 'software' SPI. To make wiring identical on all Arduinos, we'll begin with 'software' SPI. The following pins should be used:

- Connect **Vin** to the power supply, 3V or 5V is fine. Use the same voltage that the microcontroller logic is based off of. For most Arduinos, that is 5V  
- Connect **GND** to common power/data ground
- Connect the **SCK** pin to **Digital #13** but any pin can be used later
- Connect the **SDO** pin to **Digital #12** but any pin can be used later
- Connect the **SDI** pin to **Digital #11** but any pin can be used later
- Connect the **CS** pin **Digital #10** but any pin can be used later

Later on, once we get it working, we can adjust the library to use hardware SPI if you desire, or change the pins to other  
# Download Adafruit\_BMP183 library

To begin reading sensor data, you will need to download the&nbsp; **Adafruit BMP183&nbsp;** library from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/404/medium800/temperature___humidity_1library_manager_menu.png?1573956011)

Search for the&nbsp; **Adafruit BMP183** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/405/medium800/temperature___humidity_bmp183.png?1573956025)

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

# Load Demo
Open up **File-\>Examples-\>Adafruit\_BMP183**** -\>BMP183test** and upload to your Arduino wired up to the sensor ![](https://cdn-learn.adafruit.com/assets/assets/000/017/156/medium800/sensors_bmp183test.png?1401905294)

Once uploaded to your Arduino, open up the serial console at 9600 baud speed to see data being printed out

![](https://cdn-learn.adafruit.com/assets/assets/000/017/157/medium800/sensors_bmp183tewst.png?1401905328)

 **Temperature** is calculated in degrees C, you can convert this to F by using the classic F = C \* 9/5 + 32 equation.  
  
**Pressure** is returned in the SI units of **Pascals**. 100 Pascals = 1 hPa = 1 millibar. Often times barometric pressure is reported in millibar or inches-mercury. For future reference 1 pascal =0.000295333727 inches of mercury, or 1 inch Hg = 3386.39 Pascal. So if you take the pascal value of say 100734 and divide by 3389.39 you'll get 29.72 inches-Hg.  
  
You can also calculate Altitude. **However, you can only really do a good accurate job of calculating altitude if you know the hPa pressure at sea level for your location and day!** The sensor is quite precise but if you do not have the data updated for the current day then it can be difficult to get more accurate than 10 meters.

# Library Reference
You can start out by creating a BMP183 object with either software SPI (where all four pins can be any I/O) using

```
Adafruit_BMP183 bmp = Adafruit_BMP183(BMP183_CLK, BMP183_SDO, BMP183_SDI, BMP183_CS);
```

Or you can use hardware SPI. With hardware SPI you _must_ use the hardware SPI pins for your Arduino - and each arduino type has different pins! [Check the SPI reference to see what pins to use.](http://arduino.cc/en/Reference/SPI)  
In this case, you can use any CS pin, but the other three pins are fixed

```
Adafruit_BMP183 bmp = Adafruit_BMP183(BMP183_CS);
```

Once started, you can initialize the sensor with

```
bmp.begin()
```

**begin()** will return True if the sensor was found, and False if not. If you get a False value back, check your wiring!  
Reading temperature and pressure is easy, just call:

```
bmp.getTemperature()
bmp.getPressure()
```

Temperature is always a floating point, in Centigrade. Pressure is a 32 bit integer with the pressure in Pascals. You may need to convert to a different value to match it with your weather report

It's also possible to turn the BMP183 into an altimeter. If you know the pressure at sea level, the library can calculate the current barometric pressure into altitude

```
bmp.getAltitude(seaLevelPressure)
```

 **However, you can only really do a good accurate job of calculating altitude if you know the hPa pressure at sea level for your location and day!** The sensor is quite precise but if you do not have the data updated for the current day then it can be difficult to get more accurate than 10 meters.  
  
Pass in the current sea level pressure in **hPa** - so the value will be somewhere around ~1000. You can also test with the generic 1013.25 value.  
# Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor

## Using BMP183 Unified

The unified sensor library is for slightly more advanced users - it provides a more 'unified' structure for all sensors that Adafruit sells. It mimics the Android sensor platform, and is good for people who are comfortable with data structures.

# Download Adafruit\_BMP183\_Unified library

To begin reading sensor data, you will need to download both the **Adafruit BMP183 Unified** library and the&nbsp; **Adafruit Unified Sensor** library&nbsp;from the Arduino library manager.

Open up the Arduino library manager:

![](https://cdn-learn.adafruit.com/assets/assets/000/084/381/medium800/temperature___humidity_library_manager_menu.png?1573951878)

Search for the&nbsp; **Adafruit BMP183 Unified&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/382/medium800/temperature___humidity_bmp183_un.png?1573952171)

Search for the&nbsp; **Adafruit Sensor&nbsp;** library and install it

![](https://cdn-learn.adafruit.com/assets/assets/000/084/383/medium800/temperature___humidity_sensors_adafruitsensor.png?1573952223)

We also have a great tutorial on Arduino library installation at:  
[http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use "Link: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use")

# Load Demo
Open up **File-\>Examples-\>Adafruit\_BMP180\_Unified**** -\>BMP183test** and upload to your Arduino wired up to the sensor ![](https://cdn-learn.adafruit.com/assets/assets/000/017/153/medium800/sensors_bmp183load.png?1401902695)

Upload & open up the serial console at 9600 to see the data printed out

![](https://cdn-learn.adafruit.com/assets/assets/000/017/175/medium800/sensors_unified_test.png?1401910327)

# Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor

## F.A.Q.s

### 

No, your sensor is likely just fine. The altitude calculation depends on knowing the barometric pressure at sea level

**If you do not set the correct sea level pressure for your location FOR THE CURRENT DAY it will not be able to calculate the altitude accurately**

Barometric pressure at sea level changes daily based on the weather!

# Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor

## Downloads

# Datasheets & Files

- [Datasheet for the BMP183 sensor used in this breakout](http://www.adafruit.com/datasheets/1900_BMP183.pdf)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-BMP183-Breakout-PCB)
- [Fritzing object in Adafruit fritzing library](https://github.com/adafruit/Fritzing-Library)

# Schematic
![](https://cdn-learn.adafruit.com/assets/assets/000/017/178/medium800/sensors_schem.png?1401911482)

# PCB Fabrication Print
Dimensions in Inches  
![](https://cdn-learn.adafruit.com/assets/assets/000/017/177/medium800/sensors_fabprint.png?1401911452)


## Featured Products

### Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor

[Adafruit BMP183 SPI Barometric Pressure & Altitude Sensor](https://www.adafruit.com/product/1900)
Fans of the BMP085/BMP180 will want to take a look at the new BMP183 - an **SPI** spin on the old familiar classic. This precision sensor from Bosch is the best low-cost sensing solution for measuring barometric pressure and temperature. Because pressure changes with altitude you...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1900)
[Related Guides to the Product](https://learn.adafruit.com/products/1900/guides)

## Related Guides

- [Ikea Vindriktning Hack with QT Py ESP32-S3 and Adafruit IO](https://learn.adafruit.com/ikea-vindriktning-hack-with-qt-py-esp32-s3-and-adafruit-io.md)
- [Using LoraWAN and The Things Network with CircuitPython](https://learn.adafruit.com/using-lorawan-and-the-things-network-with-circuitpython.md)
- [PyPortal Weather Station](https://learn.adafruit.com/pyportal-weather-station.md)
- [Adafruit's Raspberry Pi Lesson 11. DS18B20 Temperature Sensing](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing.md)
- [MAX31855 Thermocouple Sensor Python Library](https://learn.adafruit.com/max31855-thermocouple-python-library.md)
- [IoT Air Quality Sensor with Adafruit IO](https://learn.adafruit.com/diy-air-quality-monitor.md)
- [No-Code IoT Humidity and Temperature Sensor with Adafruit IO WipperSnapper](https://learn.adafruit.com/no-code-humidity-and-temp-tracker.md)
- [Temperature and Humidity Sensing in Home Assistant with CircuitPython](https://learn.adafruit.com/temperature-and-humidity-sensing-in-home-assistant-with-circuitpython.md)
- [Adafruit BME680](https://learn.adafruit.com/adafruit-bme680-humidity-temperature-barometic-pressure-voc-gas.md)
- [MCP9808 Temperature Sensor Python Library](https://learn.adafruit.com/mcp9808-temperature-sensor-python-library.md)
- [Bosch BMP085 Breakout Board](https://learn.adafruit.com/bmp085.md)
- [Modern Replacements for DHT11 and DHT22 Sensors](https://learn.adafruit.com/modern-replacements-for-dht11-dht22-sensors.md)
- [Adafruit SHT31-D Temperature & Humidity Sensor Breakout](https://learn.adafruit.com/adafruit-sht31-d-temperature-and-humidity-sensor-breakout.md)
- [Adafruit HTU21D-F Temperature & Humidity Sensor](https://learn.adafruit.com/adafruit-htu21d-f-temperature-humidity-sensor.md)
- [RGB Matrix Portal Room CO2 Monitor](https://learn.adafruit.com/matrix-portal-room-co2-monitor.md)
