ModularSensors > Modules > Supported Sensors > Yosemitech Sensors > Yosemitech Y551 UV245/COD Sensor

Yosemitech Y551 UV245/COD Sensor module

Classes for the Yosemitech Y551 UV245/COD sensor with wiper.

Sensor Datasheet

Sensor Constructor

YosemitechY551(byte modbusAddress, Stream* stream, int8_t powerPin, int8_t powerPin2 = -1, int8_t enablePin = -1, uint8_t measurementsToAverage = 1)

Construct a new Yosemitech Y551 object.

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 Y551. 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 Y551 UV245/COD sensor is used in the menu a la carte example.

#include <sensors/YosemitechY551.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          y551ModbusAddress  = 0x50;  // The modbus address of the Y551
const int8_t  y551AdapterPower   = sensorPowerPin;  // RS485 adapter power pin
const int8_t  y551SensorPower    = A3;              // Sensor power pin
const int8_t  y551EnablePin      = -1;              // Adapter RE/DE pin
const uint8_t y551NumberReadings = 5;
// The manufacturer recommends averaging 10 readings, but we take 5 to minimize
// power consumption

// Create a Y551 chemical oxygen demand sensor object
YosemitechY551 y551(y551ModbusAddress, modbusSerial, y551AdapterPower,
                    y551SensorPower, y551EnablePin, y551NumberReadings);

// Create COD, turbidity, and temperature variable pointers for the Y551
Variable* y551COD =
    new YosemitechY551_COD(&y551, "12345678-abcd-1234-ef00-1234567890ab");
Variable* y551Turbid =
    new YosemitechY551_Turbidity(&y551, "12345678-abcd-1234-ef00-1234567890ab");
Variable* y551Temp =
    new YosemitechY551_Temp(&y551, "12345678-abcd-1234-ef00-1234567890ab");

Classes

class YosemitechY551
The Sensor sub-class for the Yosemitech Y551-B UV254/COD sensor with wiper.
class YosemitechY551_COD
The Variable sub-class used for the carbon oxygen demand (COD) output from a Yosemitech Y551-B UV254/COD sensor with wiper.
class YosemitechY551_Temp
The Variable sub-class used for the temperature output from a Yosemitech Y551-B UV254/COD sensor with wiper.
class YosemitechY551_Turbidity
The Variable sub-class used for the turbidity output from a Yosemitech Y551-B UV254/COD sensor with wiper.

Defines

#define Y551_NUM_VARIABLES = 3
Sensor::_numReturnedValues; the Y551 can report 2 values.
#define Y551_INC_CALC_VARIABLES = 0
Sensor::_incCalcValues; we don't calculate any additional values.

Sensor Timing

The sensor timing for a Yosemitch Y551

#define Y551_WARM_UP_TIME_MS = 1000
Sensor::_warmUpTime_ms; time before sensor responds after power - <500ms for response, but need >1000ms to load capcitors for brush & measure.
#define Y551_STABILIZATION_TIME_MS = 2000
Sensor::_stabilizationTime_ms; time between "StartMeasurement" command and stable reading - 2sec in manual & confirmed by testing.
#define Y551_MEASUREMENT_TIME_MS = 4000
Sensor::_measurementTime_ms; the Y551 takes ~2000ms to complete a measurement according to manual, but testing shows ~1s for a new number but 4-12s to elimniate memory effects, potentially from internal averaging.

Carbon Oxygen Demand

The COD variable from a Yosemitch Y551

  • Range is:
    • 0.75 to 370 mg/L COD (equiv. KHP)
    • 0.2 to 150 mg/L TOC (equiv. KHP)
  • Accuracy is not reported on sensor datasheet

YosemitechY551_COD(YosemitechY551* parentSense, const char* uuid = "", const char* varCode = Y551_COD_DEFAULT_CODE) explicit

Construct a new YosemitechY551_COD object.

Parameters
parentSense The parent YosemitechY551 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 "Y551COD".

#define Y551_COD_RESOLUTION = 2
Decimals places in string representation; cod should have 2 - resolution is 0.01 mg/L COD.
#define Y551_COD_VAR_NUM = 0
Sensor variable number; COD is stored in sensorValues[0].
#define Y551_COD_VAR_NAME = "COD"
Variable name in ODM2 controlled vocabulary; "COD".
#define Y551_COD_UNIT_NAME = "milligramPerLiter"
Variable unit name in ODM2 controlled vocabulary; "milligramPerLiter" (mg/L)
#define Y551_COD_DEFAULT_CODE = "Y551COD"
Default variable short code; "Y551COD".

Temperature

The temperature variable from a Yosemitch Y551

  • Range is 5°C to + 45°C
  • Accuracy is ± 0.2°C

YosemitechY551_Temp(YosemitechY551* parentSense, const char* uuid = "", const char* varCode = Y551_TEMP_DEFAULT_CODE) explicit

Construct a new YosemitechY551_Temp object.

Parameters
parentSense The parent YosemitechY551 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 "Y551Temp".

#define Y551_TEMP_RESOLUTION = 2
Decimals places in string representation; temperature should have 2 - resolution is 0.01°C.
#define Y551_TEMP_VAR_NUM = 1
Sensor variable number; temperature is stored in sensorValues[1].
#define Y551_TEMP_VAR_NAME = "temperature"
Variable name in ODM2 controlled vocabulary; "temperature".
#define Y551_TEMP_UNIT_NAME = "degreeCelsius"
Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
#define Y551_TEMP_DEFAULT_CODE = "Y551Temp"
Default variable short code; "Y551Temp".

Turbidity

The turbidity variable from a Yosemitch Y551

  • Range is 0.1~1000 NTU
  • Accuracy is <5% or 0.3NTU

YosemitechY551_Turbidity(YosemitechY551* parentSense, const char* uuid = "", const char* varCode = Y551_TURB_DEFAULT_CODE) explicit

Construct a new YosemitechY551_Turbidity object.

Parameters
parentSense The parent YosemitechY551 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 "Y551Turbidity".

#define Y551_TURB_RESOLUTION = 2
Decimals places in string representation; turbidity should have 2 - resolution is 0.01 NTU.
#define Y551_TURB_VAR_NUM = 2
Sensor variable number; turbidity is stored in sensorValues[2].
#define Y551_TURB_VAR_NAME = "turbidity"
Variable name in ODM2 controlled vocabulary; "turbidity".
#define Y551_TURB_UNIT_NAME = "nephelometricTurbidityUnit"
Variable unit name in ODM2 controlled vocabulary; "nephelometricTurbidityUnit" (NTU)
#define Y551_TURB_DEFAULT_CODE = "Y551Turbidity"
Default variable short code; "Y551Turbidity".