Turner Turbidity Plus topic
- Sensor Datasheet
- Build flags
- Sensor Constructor
- Example Code
- Reference
- Detailed Descriptions
Classes for the Turner Turbidity Plus sensor.
Sensor Datasheet
Build flags
-D MS_USE_ADS1015
- switches from the 16-bit ADS1115 to the 12 bit ADS1015
Sensor Constructor
Construct a new Turner Turbidity Plus object - need the power pin, the ADS1X15 data channel, and the calibration info. The pin on the mcu controlling power to the Turbidity Plus Use -1 if it is continuously powered.
TurnerTurbidityPlus::
Parameters
powerPin
wiperTriggerPin
The pin on the mcu that triggers the sensor's wiper.
adsDiffMux
Which two pins on the TI ADS1115 that will measure differential voltage. See ttp_
conc_std
The concentration of the standard used for a 1-point sensor calibration. The concentration units should be the same as the final measuring units.
volt_std
The voltage (in volts) measured for the conc_std. This voltage should be the final voltage after accounting for any voltage dividers or gain settings.
volt_blank
The voltage (in volts) measured for a blank. This voltage should be the final voltage after accounting for any voltage
i2cAddress
The I2C address of the ADS 1x15, default is 0x48 (ADDR = GND)
PGA_gain
The programmable gain amplification to set on the ADS 1x15, default is GAIN_ONE (0-4.096V).
measurementsToAverage
The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.
voltageDividerFactor
For 3.3V processors like the Mayfly, The Turner's 0-5V output signal must be shifted down to a maximum of 3.3V. This can be done either either with a level-shifting chip (e.g. Adafruit BSS38), OR by connecting the Turner's output signal via a voltage divider. This voltageDividerFactor is used for the latter case: e.g., a divider that uses 2 matched resistors will halve the voltage reading and requires a voltageDividerFactor of 2. The default value is 1.
Example Code
The Alphasense CO2 sensor is used in the menu a la carte example.
Classes
- class TurnerTurbidityPlus
- The Sensor sub-class for the Turner Turbidity Plus turbiditysensor".
- class TurnerTurbidityPlus_Voltage
- The Variable sub-class used for the [raw voltage output](sensor_
turbidity_ plus_ voltage) from a [Turner Turbidity Plus](Turner Turbidity Plus). - class TurnerTurbidityPlus_Turbidity
- The Variable sub-class used for the turbidity output from a Turner Turbidity Plus.
Configuration Defines
Defines to set the address of the ADD.
- enum ttp_adsDiffMux_t: uint16_t { DIFF_MUX_0_1, DIFF_MUX_0_3, DIFF_MUX_1_3, DIFF_MUX_2_3 }
- Enum for the pins used for differential voltages.
- #define ADS1115_ADDRESS = 0x48
- The assumed address of the ADS1115, 1001 000 (ADDR = GND)
Sensor Variable Counts
The number of variables that can be returned by Turbidity Plus
- #define TURBIDITY_PLUS_NUM_VARIABLES = 2
- Sensor::
_numReturnedValues; the Turbidity Plus can report 2 values. - #define TURBIDITY_PLUS_INC_CALC_VARIABLES = 1
- Sensor::
_incCalcValues; turbidity is calculated from raw voltage using the input calibration equation.
Sensor Timing
The sensor timing for an Turbidity Plus
- #define TURBIDITY_PLUS_WARM_UP_TIME_MS = 2
- Sensor::
_warmUpTime_ms; the ADS1115 warms up in 2ms. - #define TURBIDITY_PLUS_STABILIZATION_TIME_MS = 3000
- Sensor::
_stabilizationTime_ms; Turner states that it takes 3 sec settling time from power-on. - #define TURBIDITY_PLUS_MEASUREMENT_TIME_MS = 0
- Sensor::
_measurementTime_ms; the ADS1115 completes 860 conversions per second, but the wait for the conversion to complete is built into the underlying library, so we do not need to wait further here.
Calibrated Turbidity Output
The primary turbidity output from an Turbidity Plus
- #define TURBIDITY_PLUS_VAR_NUM = 0
- Variable number; the primary variable is stored in sensorValues[0].
- #define TURBIDITY_PLUS_VAR_NAME = "turbidity"
- Variable name in ODM2 controlled vocabulary; "turbidity".
- #define TURBIDITY_PLUS_UNIT_NAME = "nephelometricTurbidityUnit"
- Variable unit name in ODM2 controlled vocabulary; "nephelometricTurbidityUnit" (NTU)
- #define TURBIDITY_PLUS_DEFAULT_CODE = "TurnerTurbidity"
- Default variable short code; "TurnerTurbidity".
- #define TURBIDITY_PLUS_RESOLUTION = 5
- Decimals places in string representation; 5.
Voltage
The voltage variable from an Turbidity Plus
- Range is 0 to 3.6V when using an ADS1x15 powered at 3.3V
- Full sensor range is 0-5V
- Accuracy:
- 16-bit ADC (ADS1115): < 0.25% (gain error), <0.25 LSB (offset errror)
- 12-bit ADC (ADS1015, using build flag
MS_USE_ADS1015
): < 0.15% (gain error), <3 LSB (offset errror)
Construct a new TurnerTurbidityPlus_
TurnerTurbidityPlus_
Parameters
parentSense
The parent TurnerTurbidityPlus 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 "TurnerVoltage".
- #define TURBIDITY_PLUS_VOLTAGE_VAR_NUM = 1
- Variable number; voltage is stored in sensorValues[1].
- #define TURBIDITY_PLUS_VOLTAGE_VAR_NAME = "voltage"
- Variable name in ODM2 controlled vocabulary; "voltage".
- #define TURBIDITY_PLUS_VOLTAGE_UNIT_NAME = "volt"
- Variable unit name in ODM2 controlled vocabulary; "volt" (V)
- #define TURBIDITY_PLUS_VOLTAGE_DEFAULT_CODE = "TurbidityPlusVoltage"
- Default variable short code; "TurbidityPlusVoltage".
- #define TURBIDITY_PLUS_VOLTAGE_RESOLUTION = 4
- Decimals places in string representation; voltage should have 4.
Enum documentation
enum ttp_adsDiffMux_t: uint16_t
#include <src/sensors/TurnerTurbidityPlus.h>
Enum for the pins used for differential voltages.
Enumerators | |
---|---|
DIFF_MUX_0_1 |
differential across pins 0 and 1 |
DIFF_MUX_0_3 |
differential across pins 0 and 3 |
DIFF_MUX_1_3 |
differential across pins 1 and 3 |
DIFF_MUX_2_3 |
differential across pins 2 and 3 |
Define documentation
#define ADS1115_ADDRESS = 0x48
#include <src/sensors/TurnerTurbidityPlus.h>
The assumed address of the ADS1115, 1001 000 (ADDR = GND)
#define TURBIDITY_PLUS_NUM_VARIABLES = 2
#include <src/sensors/TurnerTurbidityPlus.h>
Sensor::
#define TURBIDITY_PLUS_INC_CALC_VARIABLES = 1
#include <src/sensors/TurnerTurbidityPlus.h>
Sensor::
#define TURBIDITY_PLUS_WARM_UP_TIME_MS = 2
#include <src/sensors/TurnerTurbidityPlus.h>
Sensor::
#define TURBIDITY_PLUS_STABILIZATION_TIME_MS = 3000
#include <src/sensors/TurnerTurbidityPlus.h>
Sensor::
#define TURBIDITY_PLUS_MEASUREMENT_TIME_MS = 0
#include <src/sensors/TurnerTurbidityPlus.h>
Sensor::
#define TURBIDITY_PLUS_VAR_NUM = 0
#include <src/sensors/TurnerTurbidityPlus.h>
Variable number; the primary variable is stored in sensorValues[0].
#define TURBIDITY_PLUS_VAR_NAME = "turbidity"
#include <src/sensors/TurnerTurbidityPlus.h>
Variable name in ODM2 controlled vocabulary; "turbidity".
#define TURBIDITY_PLUS_UNIT_NAME = "nephelometricTurbidityUnit"
#include <src/sensors/TurnerTurbidityPlus.h>
Variable unit name in ODM2 controlled vocabulary; "nephelometricTurbidityUnit" (NTU)
#define TURBIDITY_PLUS_DEFAULT_CODE = "TurnerTurbidity"
#include <src/sensors/TurnerTurbidityPlus.h>
Default variable short code; "TurnerTurbidity".
#define TURBIDITY_PLUS_RESOLUTION = 5
#include <src/sensors/TurnerTurbidityPlus.h>
Decimals places in string representation; 5.
#define TURBIDITY_PLUS_VOLTAGE_VAR_NUM = 1
#include <src/sensors/TurnerTurbidityPlus.h>
Variable number; voltage is stored in sensorValues[1].
#define TURBIDITY_PLUS_VOLTAGE_VAR_NAME = "voltage"
#include <src/sensors/TurnerTurbidityPlus.h>
Variable name in ODM2 controlled vocabulary; "voltage".
#define TURBIDITY_PLUS_VOLTAGE_UNIT_NAME = "volt"
#include <src/sensors/TurnerTurbidityPlus.h>
Variable unit name in ODM2 controlled vocabulary; "volt" (V)
#define TURBIDITY_PLUS_VOLTAGE_DEFAULT_CODE = "TurbidityPlusVoltage"
#include <src/sensors/TurnerTurbidityPlus.h>
Default variable short code; "TurbidityPlusVoltage".
#define TURBIDITY_PLUS_VOLTAGE_RESOLUTION = 4
#include <src/sensors/TurnerTurbidityPlus.h>
Decimals places in string representation; voltage should have 4.
- Resolution:
- 12-bit ADC (ADS1015, using build flag
MS_USE_ADS1015
): 2 mV
- 12-bit ADC (ADS1015, using build flag