Skip to content

barometer plugin

Plugin name barometer
Type read
Callbacks init, config, read, shutdown
Status supported
Since 5.5
Copyright 2014 Tomas Menzl
License GPLv2
Configuration collectd.conf(5)

This plugin reads absolute air pressure using digital barometer sensor on a I2C bus. Supported sensors are:

The sensor type - one of the above - is detected automatically by the plugin and indicated in the plugin_instance (you will see subdirectory barometer-mpl115 or barometer-mpl3115 or barometer-bmp085). The order of detection is BMP085 -> MPL3115 -> MPL115A2, the first one found will be used (only one sensor can be used by the plugin).

The plugin provides absolute barometric pressure, air pressure reduced to sea level (several possible approximations) and as an auxiliary value also internal sensor temperature. It uses (expects/provides) typical metric units - pressure in [hPa], temperature in [C], altitude in [m].

The reduction or normalization to mean sea level pressure requires (depending on selected method/approximation) also altitude and reference to temperature sensor(s). When multiple temperature sensors are configured the minimum of their values is always used (expecting that the warmer ones are affected by e.g. direct sun light at that moment).

Synopsis

  <Plugin "barometer">
     Device            "/dev/i2c-0";
     Oversampling      512
     PressureOffset    0.0
     TemperatureOffset 0.0
     Normalization     2
     Altitude          238.0
     TemperatureSensor "myserver/onewire-F10FCA000800/temperature"
  </Plugin>

Example Graph

None yet. Add one now!

Dependencies

  • Linux
  • Linux i2c-dev interface
  • libi2c-dev

Caveats

The sensor type - one of the above - is detected automatically by the plugin and indicated in the plugin_instance (you will see subdirectory barometer-mpl115 or barometer-mpl3115 or barometer-bmp085). The order of detection is BMP085 -> MPL3115 -> MPL115A2, the first one found will be used (only one sensor can be used by the plugin).

See also

-

Configuration

Configuration options · from collectd.conf(5)

See this section in the full configuration reference

This plugin reads absolute air pressure using digital barometer sensor on a I2C bus. Supported sensors are:

MPL115A2 from Freescale, see http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPL115A.
MPL3115 from Freescale see http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPL3115A2.
BMP085 from Bosch Sensortec

The sensor type - one of the above - is detected automatically by the plugin and indicated in the plugin_instance (you will see subdirectory "barometer-mpl115" or "barometer-mpl3115", or "barometer-bmp085"). The order of detection is BMP085 -> MPL3115 -> MPL115A2, the first one found will be used (only one sensor can be used by the plugin).

The plugin provides absolute barometric pressure, air pressure reduced to sea level (several possible approximations) and as an auxiliary value also internal sensor temperature. It uses (expects/provides) typical metric units - pressure in [hPa], temperature in [C], altitude in [m].

It was developed and tested under Linux only. The only platform dependency is the standard Linux i2c-dev interface (the particular bus driver has to support the SM Bus command subset).

The reduction or normalization to mean sea level pressure requires (depending on selected method/approximation) also altitude and reference to temperature sensor(s). When multiple temperature sensors are configured the minimum of their values is always used (expecting that the warmer ones are affected by e.g. direct sun light at that moment).

Synopsis:

<Plugin "barometer">
   Device            "/dev/i2c-0";
   Oversampling      512
   PressureOffset    0.0
   TemperatureOffset 0.0
   Normalization     2
   Altitude          238.0
   TemperatureSensor "myserver/onewire-F10FCA000800/temperature"
</Plugin>
Device device

The only mandatory configuration parameter.

Device name of the I2C bus to which the sensor is connected. Note that typically you need to have loaded the i2c-dev module. Using i2c-tools you can check/list i2c buses available on your system by:

i2cdetect -l

Then you can scan for devices on given bus. E.g. to scan the whole bus 0 use:

i2cdetect -y -a 0

This way you should be able to verify that the pressure sensor (either type) is connected and detected on address 0x60.

Oversampling value

Optional parameter controlling the oversampling/accuracy. Default value is 1 providing fastest and least accurate reading.

For MPL115 this is the size of the averaging window. To filter out sensor noise a simple averaging using floating window of this configurable size is used. The plugin will use average of the last value measurements (value of 1 means no averaging). Minimal size is 1, maximal 1024.

For MPL3115 this is the oversampling value. The actual oversampling is performed by the sensor and the higher value the higher accuracy and longer conversion time (although nothing to worry about in the collectd context). Supported values are: 1, 2, 4, 8, 16, 32, 64 and 128. Any other value is adjusted by the plugin to the closest supported one.

For BMP085 this is the oversampling value. The actual oversampling is performed by the sensor and the higher value the higher accuracy and longer conversion time (although nothing to worry about in the collectd context). Supported values are: 1, 2, 4, 8. Any other value is adjusted by the plugin to the closest supported one.

PressureOffset offset

Optional parameter for MPL3115 only.

You can further calibrate the sensor by supplying pressure and/or temperature offsets. This is added to the measured/caclulated value (i.e. if the measured value is too high then use negative offset). In hPa, default is 0.0.

TemperatureOffset offset

Optional parameter for MPL3115 only.

You can further calibrate the sensor by supplying pressure and/or temperature offsets. This is added to the measured/caclulated value (i.e. if the measured value is too high then use negative offset). In C, default is 0.0.

Normalization method

Optional parameter, default value is 0.

Normalization method - what approximation/model is used to compute the mean sea level pressure from the air absolute pressure.

Supported values of the method (integer between from 0 to 2) are:

0 - no conversion, absolute pressure is simply copied over. For this method you do not need to configure Altitude or TemperatureSensor.
1 - international formula for conversion , See http://en.wikipedia.org/wiki/Atmospheric_pressure#Altitude_atmospheric_pressure_variation. For this method you have to configure Altitude but do not need TemperatureSensor (uses fixed global temperature average instead).
2 - formula as recommended by the Deutsche Wetterdienst (German Meteorological Service). See http://de.wikipedia.org/wiki/Barometrische_H%C3%B6henformel#Theorie For this method you have to configure both Altitude and TemperatureSensor.
Altitude altitude
The altitude (in meters) of the location where you meassure the pressure.
TemperatureSensor reference
Temperature sensor(s) which should be used as a reference when normalizing the pressure using Normalization method 2. When specified more sensors a minimum is found and used each time. The temperature reading directly from this pressure sensor/plugin is typically not suitable as the pressure sensor will be probably inside while we want outside temperature. The collectd reference name is something like <hostname>/<plugin_name>-<plugin_instance>/<type>-<type_instance> (<type_instance> is usually omitted when there is just single value type). Or you can figure it out from the path of the output data files.