Tag Archives: bmp 180

Connect Arduino and BMP 180 to Cloud

BMP 180 connect to Cloud

 

BMP-180

  1. SCL – Grey wire
  2. SDA – Orange Wire

 

Notes:

  • Here the hardware TX and RX has been used for performance.

 

The code:

See Arduino – Communicate with Server – Part 1

Updated code will be posted here some time soon.

For more details on ESP 8266 please see the article “https://www.kolkataonweb.com/code-bank/arduino/esp8266-esp-01/

BMP-180 Digital Barometric Pressure Sensor

BMP-180 is a compact and cheap Digital Barometric Pressure Sensor. Below is an image of the breakout board commonly available on ebay

BMP 180 Digital Barometric Pressure Sensor

There is some confusing information about the required voltage, so safest would be to go with 3.3v. As per datasheet (download here) from Bosch, the chip manufacturer, the max voltage is 3.6v

It has a temperature sensor also inbuilt.

The library from Sparkfun is very good. It can be found here on Github (another is under development). It also has a very good example sketch.  The library has been uploaded here to ensure availability.

Below is a code snippet for reading the temperature and pressure

#include <SFE_BMP180.h>
.............
.............
SFE_BMP180 pressure;
double T,P,temp,paH,paM;
...........
...........
pressure.begin();
...........
...........

// You must first get a temperature measurement to perform a pressure reading.
// Start a temperature measurement:
// If request is successful, the number of ms to wait is returned.
// If request is unsuccessful, 0 is returned.
status = pressure.startTemperature();
if (status != 0)
{
  // Wait for the measurement to complete:
  delay(status);

  // Retrieve the completed temperature measurement:
  // Note that the measurement is stored in the variable T.
  // Function returns 1 if successful, 0 if failure.

  status = pressure.getTemperature(T);
  if (status != 0)
  {
    // Print out the measurement:
    temp = T;

    // Start a pressure measurement:
    // The parameter is the oversampling setting, from 0 to 3 (highest res, longest wait).
    // If request is successful, the number of ms to wait is returned.
    // If request is unsuccessful, 0 is returned.

    status = pressure.startPressure(3);
    if (status != 0)
    {
      // Wait for the measurement to complete:
      delay(status);

      // Retrieve the completed pressure measurement:
      // Note that the measurement is stored in the variable P.
      // Note also that the function requires the previous temperature measurement (T).
      // (If temperature is stable, you can do one temperature measurement for a number of pressure measurements.)
      // Function returns 1 if successful, 0 if failure.

      status = pressure.getPressure(P,T);
      if (status != 0)
      {
        // Print out the measurement:
        paM = P;
        paH = P*0.0295333727;
      }
      else
      {
        paM = -1;
        paH = -1;
      }
    }
    else
    {
        paM = -1;
        paH = -1;
    }
  }
  else
  {
    temp = -1;
  }
}
else
{
  temp = -1;
}
...........
...........