PaleoTerra Redox topic
- Introduction
- Sensor Datasheet
- Build flags
- Sensor Constructor
- Example Code
- Reference
- Detailed Descriptions
Classes for the PaleoTerra Redox digital preassure sensor.
Introduction
Because older versions of these sensors all ship with the same I2C address, and more than one is frequently used at different soil depths in the same profile, this module has an optional dependence on Testato's SoftwareWire library for software I2C.
Sensor Datasheet
Documentation for the sensor can be found at: https:/
Build flags
-D MS_PALEOTERRA_SOFTWAREWIRE
switches from using hardware I2C to software I2C
Sensor Constructor
Construct a new PaleoTerra Redox object using the primary hardware I2C instance. Construct a new PaleoTerra Redox object using a secondary hardware I2C instance. Construct a new PaleoTerra Redox object using a software I2C instance. The constructor - need the power pin, optionally can give an instance of TwoWire for I2C communication, an address, and a number of measurements to average. Construct a new PaleoTerra Redox object, also creating a SoftwareWire I2C instance for communication with that object.
PaleoTerraRedox::
Parameters
powerPin
The pin on the mcu controlling power to the PaleoTerra redox sensor. Use -1 if it is continuously powered.
i2cAddressHex
The I2C address of the redox probe.
measurementsToAverage
The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.
PaleoTerraRedox::
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
The pin on the mcu controlling power to the PaleoTerra redox sensor. Use -1 if it is continuously powered.
i2cAddressHex
The I2C address of the redox probe.
measurementsToAverage
The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.
PaleoTerraRedox::
Parameters
theI2C
A SoftwareWire instance for I2C communication.
powerPin
The pin on the mcu controlling power to the PaleoTerra redox sensor. Use -1 if it is continuously powered.
i2cAddressHex
The I2C address of the redox probe.
measurementsToAverage
The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.
PaleoTerraRedox::
Parameters
powerPin
The pin on the mcu controlling power to the PaleoTerra redox sensor. Use -1 if it is continuously powered.
dataPin
The pin on the mcu that will be used for I2C data (SDA). Must be a valid pin number.
clockPin
The pin on the mcu that will be used for the I2C clock (SCL). Must be a valid pin number.
i2cAddressHex
The I2C address of the redox probe.
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 PaleoTerra Redox is used in the menu a la carte example.
Classes
- class PaleoTerraRedox
- The Sensor sub-class for the PaleoTerra redox sensor.
- class PaleoTerraRedox_Voltage
- The Variable sub-class used for the voltage output from a PaleoTerra redox sensor.
Typedefs
-
using PaleoTerraRedox_Volt = PaleoTerraRedox_
Voltage deprecated in v0.33.0 - typedef for backwards compatibility; use the PaleoTerraRedox_
Voltage class in new code
Sensor Variable Counts
The number of variables that can be returned by PaleoTerra redox sensor
- #define PTR_NUM_VARIABLES = 1
- Sensor::
_numReturnedValues; the PaleoTerra redox sensor can report 1 value. - #define PTR_INC_CALC_VARIABLES = 0
- Sensor::
_incCalcValues; we don't calculate any additional values.
Configuration Defines
Defines to set the address of the PaleoTerra redox sensor.
- #define MCP3421_ADR = 0x68
- The default I2C address of the PaleoTerra redox sensor.
Sensor Timing
The sensor timing for a PaleoTerra redox probe
- #define PTR_WARM_UP_TIME_MS = 1
- Sensor::
_warmUpTime_ms; the PaleoTerra redox sensor is immediately warmed up. - #define PTR_STABILIZATION_TIME_MS = 0
- Sensor::
_stabilizationTime_ms; the PaleoTerra redox sensor is immediately stable. - #define PTR_MEASUREMENT_TIME_MS = 67
- Sensor::
_measurementTime_ms; the PaleoTerra redox sensor takes 67ms to complete a measurement.
Voltage
The voltage variable from a PaleoTerra redox probe
- Accuracy is ±5mV
Construct a new PaleoTerraRedox_
PaleoTerraRedox_
Parameters
parentSense
The parent PaleoTerraRedox 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 "PTRVoltage".
- #define PTR_VOLTAGE_RESOLUTION = 2
- Decimals places in string representation; voltage should have 2.
- #define PTR_VOLTAGE_VAR_NUM = 0
- Sensor variable number; voltage is stored in sensorValues[0].
- #define PTR_VOLTAGE_VAR_NAME = "Voltage"
- Variable name in ODM2 controlled vocabulary; "Voltage".
- #define PTR_VOLTAGE_UNIT_NAME = "millivolt"
- Variable unit name in ODM2 controlled vocabulary; "millivolt" (mV)
- #define PTR_VOLTAGE_DEFAULT_CODE = "PTRVoltage"
- Default variable short code; "PTRVoltage".
Typedef documentation
typedef PaleoTerraRedox_ Voltage PaleoTerraRedox_Volt
#include <src/sensors/PaleoTerraRedox.h>
typedef for backwards compatibility; use the PaleoTerraRedox_
Define documentation
#define PTR_NUM_VARIABLES = 1
#include <src/sensors/PaleoTerraRedox.h>
Sensor::
#define PTR_INC_CALC_VARIABLES = 0
#include <src/sensors/PaleoTerraRedox.h>
Sensor::
#define MCP3421_ADR = 0x68
#include <src/sensors/PaleoTerraRedox.h>
The default I2C address of the PaleoTerra redox sensor.
#define PTR_WARM_UP_TIME_MS = 1
#include <src/sensors/PaleoTerraRedox.h>
Sensor::
#define PTR_STABILIZATION_TIME_MS = 0
#include <src/sensors/PaleoTerraRedox.h>
Sensor::
#define PTR_MEASUREMENT_TIME_MS = 67
#include <src/sensors/PaleoTerraRedox.h>
Sensor::
#define PTR_VOLTAGE_RESOLUTION = 2
#include <src/sensors/PaleoTerraRedox.h>
Decimals places in string representation; voltage should have 2.
Resolution is 1mV and 1 extra digit is added to increase the number of significant figures to allow for averaging of multiple measurements.
#define PTR_VOLTAGE_VAR_NUM = 0
#include <src/sensors/PaleoTerraRedox.h>
Sensor variable number; voltage is stored in sensorValues[0].
#define PTR_VOLTAGE_VAR_NAME = "Voltage"
#include <src/sensors/PaleoTerraRedox.h>
Variable name in ODM2 controlled vocabulary; "Voltage".
#define PTR_VOLTAGE_UNIT_NAME = "millivolt"
#include <src/sensors/PaleoTerraRedox.h>
Variable unit name in ODM2 controlled vocabulary; "millivolt" (mV)
#define PTR_VOLTAGE_DEFAULT_CODE = "PTRVoltage"
#include <src/sensors/PaleoTerraRedox.h>
Default variable short code; "PTRVoltage".