The Barometer Sensor can be used to measure temperature and atmospheric pressure accurately. As the atmospheric pressure changes with altitude, it can also measure approximate altitude of a place.

Grove Barometer Sensor BMP280

Hardware

If you are using the Grove Beginner Kit, your Barometer Pressure sensor is already connect to an I2C port on your Arduino. If it has been "broken out" or you are using an external sense, connect it into any of the I2C ports on your Beginner Kit shield:

I2C ports on the Grove shield v2.0

Software

Functions that interact with the barometer are prefixed with pressure_.

Temperature

You can use the barometer to get temperature measurements in Celsius:

"""
Gets temperature reading in Celsius from barometer

@returns	Value representing temperature in Celsius
"""

def pressure_get_temp()

Atmospheric Pressure

As indicated, you can use the barometer to get atmospheric pressure measurements in Pascals:

"""
Gets pressure reading in Pa from barometer

@returns	Value representing pressure in Pa
"""

def pressure_get_pressure()

Altitude

As the atmospheric pressure changes with altitude, the barometer can also measure approximate altitude in meters of a place:

"""
Gets altitude reading in m from barometer

@returns altitutde in meters
"""

def pressure_get_altitude()