ESP8266 BMP180 pressure sensor interface

BMP180 is a Digital pressure sensor. In this tutorial we are interfacing BMP180 with ESP8266. Sensor have pressure range of 300 to 1100hPa and operate at 1.8V to 3.6V. It’s common application is Weather forecast.


How BMP180 used for weather forecast?

In order to understand the types of weather conditions generally associated with high and low pressure systems, we must think “vertically.” The motion of air in the atmosphere above our heads plays a large part in the weather we experience here at earth’s surface. Basically, air cools as it rises, which can cause water vapor in the air to condense into liquid water droplets, sometimes forming clouds and precipitation. On the other hand, sinking air is associated with warming and drying conditions. So the first important point to keep in mind is rising air = moistening, sinking air = drying.

So what does this have to do with high and low pressure? Well, high pressure is associated with sinking air, and low pressure is associated with rising air. But why? The answer has to do with the typical air flow around high and low pressure. Physically, it seems to make sense to have air flow from high pressure to low pressure. For reasons I won’t get into in this post, the airflow (due to the Earth’s rotation and friction) is directed slightly inward toward the low pressure center, and slightly outward away from the high pressure center:

The slightly inward moving air in low pressure causes air to converge and since it can’t move downward due to the surface, the air is forced upward, leading to condensation and precipitation as discussed earlier. The opposite occurs with high pressure. Air is moving away from the high pressure center at the surface (or “diverging”) so as a result, air from above must sink to take its place. The surface flow is accompanied by the opposite behavior at upper levels of the atmosphere, as depicted in this schematic diagram:

Components required

  1. BMP180
  2. NodeMCU (ESP8266)

BMP180 Pin out

The BMP180 is designed to be connected directly to a ESP8266 via the I2C bus. The pressure and temperature data has to be compensated by the calibration data of the E2PROM of the BMP180.

ESP8266 (NodeMCU) connections with BMP180

Note: Do not connect Sensor directly to +5V or VIN marked on NodeMCU. it will damage the sensor permanently.

Connect sensor VIN to NodeMCY 3.3V, Connect GND pin to GND,  SCL to D1 and SDA to D2 of NodeMCU as shown in below circuit.

BMP180 NodeMCU
BMP180 Circuits

ESP8266 Code for BMP180 Sensor

Before programming Download Required Library from Here

First we see simple program which will read sensor data on serial monitor.

Results and Testing

After uploading code open serial monitor at 115200 baud rate and You will find all sensor readings are coming. in case of any error check your connections.

BMP180 ESP8266 Readings
BMP180 Reading on Serial Monitor

Complete Weather Station

This is complete weather station project which measures, Temperature, Humidity, Pressure and Rain.

If you are looking for simple weather station using only DHT11, refer this.

Circuit Connections

Now we make complete weather station with BMP180, DHT11 and Rain Sensor. Make connections as shown below.

Complete Weather station using NodeMCU BMP180
Weather Station Circuit

ESP8266 Weather Station Arduino IDE Code

Program is divided in two parts. main arduino code and index.h i.e. HTML file. before uploading code enter your SSID and Password. If you have not installed BMP180 Library, Download it from here.

For more details and working of code refer read more NodeMCU Weather Station.


Results and Testing

Once code is uploaded get ESP8266 IP address from serial monitor. and open it in web browser.

Read More

  1. Interfacing BMP180 with Arduino UNO
  2. DHT11 Humidity and Temperature Data logger using ESP8266
  3. ESP32 DHT11 Interfacing
  4. NodeMCU Pinout
  5. NodeMCU Weather Station

Leave a Reply