Yosemitech Y560 Ammonium Sensor module
Classes for the Yosemitech Y560 Ammonium sensor.
Sensor Datasheet
Sensor Constructor
Construct a new Yosemitech Y560 object.
YosemitechY560(byte modbusAddress,
Stream* stream,
int8_t powerPin,
int8_t powerPin2 = -1,
int8_t enablePin = -1,
uint8_t measurementsToAverage = 1)
Parameters
modbusAddress
The modbus address of the sensor.
stream
An Arduino data stream for modbus communication. See notes for more information on what streams can be used.
powerPin
The pin on the mcu controlling power to the Y560. Use -1 if it is continuously powered.
powerPin2
The pin on the mcu controlling power to the RS485 adapter, if it is different from that used to power the sensor. Use -1 or omit if not applicable.
enablePin
The pin on the mcu controlling the direction enable on the RS485 adapter, if necessary; use -1 or omit if not applicable.
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 Yosemitech Y560 Ammonium sensor is used in the menu a la carte example.
#include <sensors/YosemitechY560.h> // NOTE: Extra hardware and software serial ports are created in the "Settings // for Additional Serial Ports" section // NOTE: Use -1 for any pins that don't apply or aren't being used. byte y560ModbusAddress = 0x60; // The modbus address of the Y560. // NOTE: Hexidecimal 0x60 = 96 decimal used by Yosemitech SmartPC const int8_t y560AdapterPower = sensorPowerPin; // RS485 adapter power pin const int8_t y560SensorPower = A3; // Sensor power pin const int8_t y560EnablePin = -1; // Adapter RE/DE pin const uint8_t y560NumberReadings = 3; // The manufacturer recommends averaging 10 readings, but we take 5 to minimize // power consumption // Create a Y560 Ammonium Probe object YosemitechY560 y560(y560ModbusAddress, modbusSerial, y560AdapterPower, y560SensorPower, y560EnablePin, y560NumberReadings); // Create COD, turbidity, and temperature variable pointers for the Y560 Variable* y560NH4_N = new YosemitechY560_NH4_N(&y560, "12345678-abcd-1234-ef00-1234567890ab"); Variable* y560pH = new YosemitechY560_pH(&y560, "12345678-abcd-1234-ef00-1234567890ab"); Variable* y560Temp = new YosemitechY560_Temp(&y560, "12345678-abcd-1234-ef00-1234567890ab");
Classes
- class YosemitechY560
- The Sensor sub-class for the Yosemitech Y560-A digital pH sensor.
- class YosemitechY560_NH4_N
- The Variable sub-class used for the NH4_
N output from a Yosemitech Y560-Ammonium sensor. - class YosemitechY560_Temp
- The Variable sub-class used for the temperature output from a Yosemitech Y560-Ammonium sensor.
- class YosemitechY560_pH
- The Variable sub-class used for the pH output from a Yosemitech Y560-Ammonium sensor.
Defines
- #define Y560_NUM_VARIABLES = 3
- Sensor::
_numReturnedValues; the Y560 can report 3 values. - #define Y560_INC_CALC_VARIABLES = 0
- Sensor::
_incCalcValues; we don't calculate any additional values.
Sensor Timing
The sensor timing for a Yosemitch Y560
- #define Y560_WARM_UP_TIME_MS = 7000
- Sensor::
_warmUpTime_ms; time before sensor responds after power - <200ms for response, but need 2-10s to load capcitors for brush & measure. - #define Y560_STABILIZATION_TIME_MS = 18000
- Sensor::
_stabilizationTime_ms; time between "StartMeasurement" command and stable reading 20s in manual but this includes 15s for brushing. Setting to 20s to allow for 5s after brushing completes, based on testing. - #define Y560_MEASUREMENT_TIME_MS = 1500
- Sensor::
_measurementTime_ms; the Y560 takes 2s to complete a measurement according to manual, but testing shows ~1.5s for a new number.
NH4_N
The NH4_N variable from a Yosemitch Y560
- Range is 0-10 or 0-100 mg/L NH4-N
- Accuracy is ±(5% + 0.2 mg/L)
Construct a new YosemitechY560_
YosemitechY560_NH4_N(YosemitechY560* parentSense,
const char* uuid = "",
const char* varCode = Y560_
Parameters
parentSense
The parent YosemitechY560 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 "Y560NH4_N".
- #define Y560_NH4_N_RESOLUTION = 1
- Decimals places in string representation; NH4_N should have 1 - resolution is 0.1 mg/L.
- #define Y560_NH4_N_VAR_NUM = 0
- Sensor variable number; NH4_N is stored in sensorValues[0].
- #define Y560_NH4_N_VAR_NAME = "nitrogen_NH4"
- Variable name in ODM2 controlled vocabulary; "nitrogen_NH4".
- #define Y560_NH4_N_UNIT_NAME = "milligramPerLiter"
- Variable unit name in ODM2 controlled vocabulary; "milligramPerLiter".
- #define Y560_NH4_N_DEFAULT_CODE = "Y560NH4_N"
- Default variable short code; "Y560NH4_N".
Temperature
The temperature variable from a Yosemitch Y560
- Range is 0°C to + 50°C
- Accuracy is ± 0.2°C
Construct a new YosemitechY560_
YosemitechY560_Temp(YosemitechY560* parentSense,
const char* uuid = "",
const char* varCode = Y560_
Parameters
parentSense
The parent YosemitechY560 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 "Y560Temp".
- #define Y560_TEMP_RESOLUTION = 1
- Decimals places in string representation; temperature should have 1 - resolution is 0.1°C.
- #define Y560_TEMP_VAR_NUM = 1
- Sensor variable number; temperature is stored in sensorValues[1].
- #define Y560_TEMP_VAR_NAME = "temperature"
- Variable name in ODM2 controlled vocabulary; "temperature".
- #define Y560_TEMP_UNIT_NAME = "degreeCelsius"
- Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
- #define Y560_TEMP_DEFAULT_CODE = "Y560Temp"
- Default variable short code; "Y560Temp".
pH
The pH variable from a Yosemitch Y560
- Range is 2 to 12 pH units
- Accuracy is ± 0.1 pH units
Construct a new YosemitechY560_
YosemitechY560_pH(YosemitechY560* parentSense,
const char* uuid = "",
const char* varCode = Y560_
Parameters
parentSense
The parent YosemitechY560 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 "Y560pH".
- #define Y560_PH_RESOLUTION = 2
- Decimals places in string representation; pH should have 2 - resolution is 0.01 pH units.
- #define Y560_PH_VAR_NUM = 2
- Sensor variable number; pH is stored in sensorValues[2].
- #define Y560_PH_VAR_NAME = "pH"
- Variable name in ODM2 controlled vocabulary; "pH".
- #define Y560_PH_UNIT_NAME = "pH"
- Variable unit name in ODM2 controlled vocabulary; "pH" (dimensionless pH units)
- #define Y560_PH_DEFAULT_CODE = "Y560pH"
- Default variable short code; "Y560pH".