Yosemitech Y700 Pressure Sensor module
Classes for the Yosemitech Y700 pressure sensor.
Sensor Datasheet
Sensor Constructor
Construct a new Yosemitech Y700 object.
YosemitechY700(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 Y700. 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 Y700 pressure sensor is used in the menu a la carte example.
#include <sensors/YosemitechY700.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 y700ModbusAddress = 0x70; // The modbus address of the Y700 const int8_t y700AdapterPower = sensorPowerPin; // RS485 adapter power pin const int8_t y700SensorPower = A3; // Sensor power pin const int8_t y700EnablePin = -1; // Adapter RE/DE pin const uint8_t y700NumberReadings = 5; // The manufacturer recommends averaging 10 readings, but we take 5 to minimize // power consumption // Create a Y700 pressure sensor object YosemitechY700 y700(y700ModbusAddress, modbusSerial, y700AdapterPower, y700SensorPower, y700EnablePin, y700NumberReadings); // Create pressure and temperature variable pointers for the Y700 Variable* y700Pres = new YosemitechY700_Pressure(&y700, "12345678-abcd-1234-ef00-1234567890ab"); Variable* y700Temp = new YosemitechY700_Temp(&y700, "12345678-abcd-1234-ef00-1234567890ab");
Classes
- class YosemitechY700
- The Sensor sub-class for the Yosemitech Y700 pressure sensor.
- class YosemitechY700_Pressure
- The Variable sub-class used for the pressure output from a Yosemitech Y700 pressure sensor.
- class YosemitechY700_Temp
- The Variable sub-class used for the temperature output from a Yosemitech Y700 pressure sensor.
Defines
- #define Y700_NUM_VARIABLES = 2
- Sensor::
_numReturnedValues; the Y700 can report 2 values. - #define Y700_INC_CALC_VARIABLES = 0
- Sensor::
_incCalcValues; we don't calculate any additional values.
Sensor Timing
The sensor timing for a Yosemitch Y700
- #define Y700_WARM_UP_TIME_MS = 1000
- Sensor::
_warmUpTime_ms; time before sensor responds after power - 1000 ms. - #define Y700_STABILIZATION_TIME_MS = 4000
- Sensor::
_stabilizationTime_ms; time between "StartMeasurement" command and stable reading - Y700 takes 4 s to get stability <1 mm, but 12 s for <0.1 mm. If highest precision is required, increase to 12000. - #define Y700_MEASUREMENT_TIME_MS = 1000
- Sensor::
_measurementTime_ms; the Y700 takes <1 s for new values. but >1 s for values that don't seem autocorrelated.
Pressure
The Pressure variable from a Yosemitch Y700
- Range is 0mH2O, ~2mH2O, or 100mH2O, depending on model
- Accuracy is ± 0.1 % Full Scale
Construct a new YosemitechY700_
YosemitechY700_Pressure(YosemitechY700* parentSense,
const char* uuid = "",
const char* varCode = Y700_
Parameters
parentSense
The parent YosemitechY700 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 "Y700Pres".
- #define Y700_PRES_RESOLUTION = 2
- Decimals places in string representation; Pressure should have 1.
- resolution is 0.01 mm.
- #define Y700_PRES_VAR_NUM = 0
- Sensor variable number; pressure is stored in sensorValues[0].
- #define Y700_PRES_VAR_NAME = "pressureGauge"
- Variable name in ODM2 controlled vocabulary; "pressureGauge".
- #define Y700_PRES_UNIT_NAME = "millimeterOfWater"
- Variable unit name in ODM2 controlled vocabulary; "millimeterOfWater" (mmH2O)
- #define Y700_PRES_DEFAULT_CODE = "Y700Pres"
- Default variable short code; "Y700Pres".
Temperature
The temperature variable from a Yosemitch Y700
- Range is 0°C to + 50°C
- Accuracy is ± 0.2°C
Construct a new YosemitechY700_
YosemitechY700_Temp(YosemitechY700* parentSense,
const char* uuid = "",
const char* varCode = Y700_
Parameters
parentSense
The parent YosemitechY700 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 "Y700Temp".
- #define Y700_TEMP_RESOLUTION = 1
- Decimals places in string representation; temperature should have 1 - resolution is 0.1°C.
- #define Y700_TEMP_VAR_NUM = 1
- Sensor variable number; temperature is stored in sensorValues[1].
- #define Y700_TEMP_VAR_NAME = "temperature"
- Variable name in ODM2 controlled vocabulary; "temperature".
- #define Y700_TEMP_UNIT_NAME = "degreeCelsius"
- Variable unit name in ODM2 controlled vocabulary; "degreeCelsius" (°C)
- #define Y700_TEMP_DEFAULT_CODE = "Y700Temp"
- Default variable short code; "Y700Temp".