Yosemitech Y511 Wipered Turbidty Sensor module
Classes for the Yosemitech Y511 wipered turbidity sensor.
Sensor Datasheet
Sensor Constructor
Construct a new Yosemitech Y511 object.
YosemitechY511(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 Y511. 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 Y511 wipered turbidity sensor is used in the menu a la carte example.
#include <sensors/YosemitechY511.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 y511ModbusAddress = 0x1A; // The modbus address of the Y511 const int8_t y511AdapterPower = sensorPowerPin; // RS485 adapter power pin const int8_t y511SensorPower = A3; // Sensor power pin const int8_t y511EnablePin = -1; // Adapter RE/DE pin const uint8_t y511NumberReadings = 5; // The manufacturer recommends averaging 10 readings, but we take 5 to minimize // power consumption // Create a Y511-A Turbidity sensor object YosemitechY511 y511(y511ModbusAddress, modbusSerial, y511AdapterPower, y511SensorPower, y511EnablePin, y511NumberReadings); // Create turbidity and temperature variable pointers for the Y511 Variable* y511Turb = new YosemitechY511_Turbidity(&y511, "12345678-abcd-1234-ef00-1234567890ab"); Variable* y511Temp = new YosemitechY511_Temp(&y511, "12345678-abcd-1234-ef00-1234567890ab");
Classes
- class YosemitechY511
- The Sensor sub-class for the Yosemitech Y511-A optical turbidity sensor with wiper.
- class YosemitechY511_Turbidity
- The Variable sub-class used for the turbidity output from a Yosemitech Y511-A optical turbidity sensor with wiper.
- class YosemitechY511_Temp
- The Variable sub-class used for the temperature output from a Yosemitech Y511-A optical turbidity sensor with wiper.
Defines
- #define Y511_NUM_VARIABLES = 2
- Sensor::
_numReturnedValues; the Y511 can report 2 values. - #define Y511_INC_CALC_VARIABLES = 0
- Sensor::
_incCalcValues; we don't calculate any additional values.
Sensor Timing
The sensor timing for a Yosemitch Y511
- #define Y511_WARM_UP_TIME_MS = 8000
- Sensor::
_warmUpTime_ms; Y511 warms up in 8000ms. 500 ms to receive commands, but if activating brush warmup+stabilization must >20s
- #define Y511_STABILIZATION_TIME_MS = 40000
- Sensor::
_stabilizationTime_ms; Y511 is stable after 40s. warmup+stabilization > 48 s for consecutive readings to give different results
- #define Y511_MEASUREMENT_TIME_MS = 4000
- Sensor::
_measurementTime_ms; Y511 take ~4s (4000ms) to complete a measurement. Could potentially be lower with a longer stabilization time; more testing needed.
Turbidity
The turbidity variable from a Yosemitch Y511
- Range is 0.1 to 1000 NTU
- Accuracy is ± 5 % or 0.3 NTU
Construct a new YosemitechY511_
YosemitechY511_Turbidity(YosemitechY511* parentSense,
const char* uuid = "",
const char* varCode = Y511_
Parameters
parentSense
The parent YosemitechY511 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 "Y511Turbidity".
- #define Y511_TURB_RESOLUTION = 2
- Decimals places in string representation; turbidity should have 2 - resolution is 0.01 NTU.
- #define Y511_TURB_VAR_NUM = 0
- Sensor variable number; turbidity is stored in sensorValues[0].
- #define Y511_TURB_VAR_NAME = "turbidity"
- Variable name in ODM2 controlled vocabulary; "turbidity".
- #define Y511_TURB_UNIT_NAME = "nephelometricTurbidityUnit"
- Variable unit name in ODM2 controlled vocabulary; "nephelometricTurbidityUnit" (NTU)
- #define Y511_TURB_DEFAULT_CODE = "Y511Turbidity"
- Default variable short code; "Y511Turbidity".
Temperature
The temperature variable from a Yosemitch Y511
- Range is 0°C to + 50°C
- Accuracy is ± 0.2°C
Construct a new YosemitechY511_
YosemitechY511_Temp(YosemitechY511* parentSense,
const char* uuid = "",
const char* varCode = Y511_
Parameters
parentSense
The parent YosemitechY511 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 "Y511Temp".
- #define Y511_TEMP_RESOLUTION = 1
- Decimals places in string representation; temperature should have 1 - resolution is 0.1°C.
- #define Y511_TEMP_VAR_NUM = 1
- Sensor variable number; temperature is stored in sensorValues[1].
- #define Y511_TEMP_VAR_NAME = "temperature"
- Variable name in ODM2 controlled vocabulary; "temperature".
- #define Y511_TEMP_UNIT_NAME = "degreeCelsius"
- Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
- #define Y511_TEMP_DEFAULT_CODE = "Y511Temp"
- Default variable short code; "Y511Temp".