Freescale Semiconductor MPL115A2 topic
- Introduction
- Sensor Datasheet
- Sensor Constructors
- Example Code
- Reference
- Detailed Descriptions
Classes for the Freescale Semiconductor MPL115A2 digital barometer.
Introduction
The Freescale Semiconductor MPL115A2 is a low-cost, low-power absolute pressure sensor with a digital I2C output. It is optimized for barometric measurements. Because this sensor can have only one I2C address (0x60), it is only possible to connect one of these sensors to a single I2C bus. This sensor should be attached to a 2.375-5.5V power source and the power supply to the sensor can be stopped between measurements. Communication with the MPL115A2 is managed by the Adafruit MPL115A2 library.
Sensor Datasheet
Documentation for the sensor can be found at: https:/
A copy of the datasheet is available here: https:/
Sensor Constructors
Construct a new FreescaleMPL115A2 using the primary hardware I2C instance. The pin on the mcu controlling power to the MPL115A2 Use -1 if it is continuously powered. Construct a new FreescaleMPL115A2 using a secondary hardware I2C instance. The pin on the mcu controlling power to the MPL115A2 Use -1 if it is continuously powered.
FreescaleMPL115A2::
Parameters
powerPin
measurementsToAverage
The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.
FreescaleMPL115A2::
Parameters
theI2C
A TwoWire instance for I2C communication. Due to the limitations of the Arduino core, only a hardware I2C instance can be used. For an AVR board, there is only one I2C instance possible and this form of the constructor should not be used. For a SAMD board, this can be used if a secondary I2C port is created on one of the extra SERCOMs.
powerPin
measurementsToAverage
The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.
Example Code
The Freescale Semiconductor MPL115A2 is used in the menu a la carte example.
Classes
- class FreescaleMPL115A2
- The Sensor sub-class for the Freescale Semiconductor MPL115A2 sensor.
- class FreescaleMPL115A2_Temp
- The Variable sub-class used for the temperature output from a Freescale Semiconductor MPL115A2.
- class FreescaleMPL115A2_Pressure
- The Variable sub-class used for the pressure output from a Freescale Semiconductor MPL115A2.
Typedefs
- using MPL115A2 = FreescaleMPL115A2 deprecated in v0.33.0
- typedef for backwards compatibility; use the FreescaleMPL115A2 class in new code
-
using MPL115A2_Temp = FreescaleMPL115A2_
Temp deprecated in v0.33.0 - typedef for backwards compatibility; use the FreescaleMPL115A2_
Temp class in new code -
using MPL115A2_Pressure = FreescaleMPL115A2_
Pressure deprecated in v0.33.0 - typedef for backwards compatibility; use the FreescaleMPL115A2_
Pressure class in new code
Sensor Variable Counts
The number of variables that can be returned by the MPL115A2
- #define MPL115A2_NUM_VARIABLES = 2
- Sensor::
_numReturnedValues; the MPL115A2 can report 2 values. - #define MPL115A2_INC_CALC_VARIABLES = 0
- Sensor::
_incCalcValues; we don't calculate any additional values.
Sensor Timing
The sensor timing for a Freescale MPL115A2
- #define MPL115A2_WARM_UP_TIME_MS = 6
- Sensor::
_warmUpTime_ms; the MPL115A2 takes about 6 ms to respond. - #define MPL115A2_STABILIZATION_TIME_MS = 0
- Sensor::
_stabilizationTime_ms; the MPL115A2 is stable as soon as it warms up (0ms stabilization). - #define MPL115A2_MEASUREMENT_TIME_MS = 3
- Sensor::
_measurementTime_ms; the MPL115A2 takes 3ms to complete a measurement.
Temperature
The temperature variable from a Freescale MPL115A2
- Range is -20°C to 85°C
- Accuracy is not specified on the sensor datasheet
Construct a new FreescaleMPL115A2_
FreescaleMPL115A2_
Parameters
parentSense
The parent FreescaleMPL115A2 providing the result values.
uuid
A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode
A short code to help identify the variable in files; optional with a default value of "FreescaleMPL115A2_Temp".
- #define MPL115A2_TEMP_RESOLUTION = 2
- Decimals places in string representation; temperature should have 2 - resolution is 0.01°C.
- #define MPL115A2_TEMP_VAR_NUM = 0
- Sensor variable number; temperature is stored in sensorValues[0].
- #define MPL115A2_TEMP_VAR_NAME = "temperature"
- Variable name in ODM2 controlled vocabulary; "temperature".
- #define MPL115A2_TEMP_UNIT_NAME = "degreeCelsius"
- Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
- #define MPL115A2_TEMP_DEFAULT_CODE = "FreescaleMPL115A2_Temp"
- Default variable short code; "FreescaleMPL115A2_Temp".
Pressure
The pressure variable from a Freescale MPL115A2
- Range is 500-1150 hPa
- Accuracy ±10 hPa
Construct a new FreescaleMPL115A2_
FreescaleMPL115A2_
Parameters
parentSense
The parent FreescaleMPL115A2 providing the result values.
uuid
A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode
A short code to help identify the variable in files; optional with a default value of "FreescaleMPL115A2_Pressure".
- #define MPL115A2_PRESSURE_RESOLUTION = 2
- Decimals places in string representation; pressure should have 2 - resolution is 1.5 hPa.
- #define MPL115A2_PRESSURE_VAR_NUM = 1
- Sensor variable number; pressure is stored in sensorValues[1].
- #define MPL115A2_PRESSURE_VAR_NAME = "atmosphericPressure"
- Variable name in ODM2 controlled vocabulary; "atmosphericPressure".
- #define MPL115A2_PRESSURE_UNIT_NAME = "kilopascal"
- Variable unit name in ODM2 controlled vocabulary; "kilopascal" (kPa)
- #define MPL115A2_PRESSURE_DEFAULT_CODE = "FreescaleMPL115A2_Pressure"
- Default variable short code; "FreescaleMPL115A2_Pressure".
Typedef documentation
typedef FreescaleMPL115A2 MPL115A2
#include <src/sensors/FreescaleMPL115A2.h>
typedef for backwards compatibility; use the FreescaleMPL115A2 class in new code
typedef FreescaleMPL115A2_ Temp MPL115A2_Temp
#include <src/sensors/FreescaleMPL115A2.h>
typedef for backwards compatibility; use the FreescaleMPL115A2_
typedef FreescaleMPL115A2_ Pressure MPL115A2_Pressure
#include <src/sensors/FreescaleMPL115A2.h>
typedef for backwards compatibility; use the FreescaleMPL115A2_
Define documentation
#define MPL115A2_NUM_VARIABLES = 2
#include <src/sensors/FreescaleMPL115A2.h>
Sensor::
#define MPL115A2_INC_CALC_VARIABLES = 0
#include <src/sensors/FreescaleMPL115A2.h>
Sensor::
#define MPL115A2_WARM_UP_TIME_MS = 6
#include <src/sensors/FreescaleMPL115A2.h>
Sensor::
#define MPL115A2_STABILIZATION_TIME_MS = 0
#include <src/sensors/FreescaleMPL115A2.h>
Sensor::
#define MPL115A2_MEASUREMENT_TIME_MS = 3
#include <src/sensors/FreescaleMPL115A2.h>
Sensor::
#define MPL115A2_TEMP_RESOLUTION = 2
#include <src/sensors/FreescaleMPL115A2.h>
Decimals places in string representation; temperature should have 2 - resolution is 0.01°C.
#define MPL115A2_TEMP_VAR_NUM = 0
#include <src/sensors/FreescaleMPL115A2.h>
Sensor variable number; temperature is stored in sensorValues[0].
#define MPL115A2_TEMP_VAR_NAME = "temperature"
#include <src/sensors/FreescaleMPL115A2.h>
Variable name in ODM2 controlled vocabulary; "temperature".
#define MPL115A2_TEMP_UNIT_NAME = "degreeCelsius"
#include <src/sensors/FreescaleMPL115A2.h>
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define MPL115A2_TEMP_DEFAULT_CODE = "FreescaleMPL115A2_Temp"
#include <src/sensors/FreescaleMPL115A2.h>
Default variable short code; "FreescaleMPL115A2_Temp".
#define MPL115A2_PRESSURE_RESOLUTION = 2
#include <src/sensors/FreescaleMPL115A2.h>
Decimals places in string representation; pressure should have 2 - resolution is 1.5 hPa.
#define MPL115A2_PRESSURE_VAR_NUM = 1
#include <src/sensors/FreescaleMPL115A2.h>
Sensor variable number; pressure is stored in sensorValues[1].
#define MPL115A2_PRESSURE_VAR_NAME = "atmosphericPressure"
#include <src/sensors/FreescaleMPL115A2.h>
Variable name in ODM2 controlled vocabulary; "atmosphericPressure".
#define MPL115A2_PRESSURE_UNIT_NAME = "kilopascal"
#include <src/sensors/FreescaleMPL115A2.h>
Variable unit name in ODM2 controlled vocabulary; "kilopascal" (kPa)
#define MPL115A2_PRESSURE_DEFAULT_CODE = "FreescaleMPL115A2_Pressure"
#include <src/sensors/FreescaleMPL115A2.h>
Default variable short code; "FreescaleMPL115A2_Pressure".