public class Hygrometer extends SensorTask
DataEvent.DATA_SOURCE_HUMIDITY
DataEvent.DATA_SOURCE_TEMPERATURE
DataEvent.DATA_SOURCE_DEWPOINT
DataEvent.DATA_SOURCE_SOLAR_INTENSITY
Vout = (Slope * SensorRH) + VzeroWhere
SensorRH = (Vout - Vzero) / SlopeThe HIH-4000 voltage output is proportional to the supply voltage. Supply voltage correction uses the formula:
SensorRH = ((Vout / Vsupply) - (Vzero / Vcal)) / (Slope / Vcal)Where
TrueRH = SensorRH * (C0 + (C1 * temp) + (C2 * temp^2))(derived from research by EME Systems, Berkeley CA U.S.A.), where
Refer to this internal default resource file for property keys and default values used to configure this task.
# Hygrometer task HIH-4000 sensor calibration offset and slope. hygrometer.task.calibration.humidity=800e-3;31.0e-3;You can check your humidity sensor with a sling psychrometer, or against other nearby weather stations, and chart your own calibration constants. If you use your own calibration constants, enter them, along with the supply voltage, Vdd in effect at the time you calibrated your sensor. The solar sensor is calibrated using the polynomial coefficients to provide the desired output characteristic, units and range.
# Hygrometer task solar intensity calibration offset and slope. hygrometer.task.calibration.solar=0.0;1.0;
Modifier and Type | Class and Description |
---|---|
private class |
Hygrometer.ReadTask
Samples the DS2438 on the configured schedule.
|
Modifier and Type | Field and Description |
---|---|
private com.dalsemi.onewire.container.OneWireContainer26 |
container
DS2438 Humidity/Temperature/Clock/A-D sensor.
|
private static byte[] |
FAMILY
DS2438 Humidity/Temperature/Clock/A-D sensor family code.
|
private double[] |
hCoeffs
Hygrometer calibration coefficients.
|
private double |
hVdd
HIH-4000 calibration voltage.
|
private double[] |
sCoeffs
Solar calibration coefficients.
|
private static int |
SLOPE
Calibration coefficients slope index.
|
private double[] |
tCoeffs
Thermometer calibration coefficients.
|
private static int |
ZERO
Calibration coefficients zero index.
|
adapter, address, cancel, CFG_DEVICE_ADDRESS_KEY, CFG_DEVICE_CHANNEL_KEY, CFG_DEVICE_OFFSET_KEY, CFG_DEVICE_SCALE_KEY, CFG_SAMPLING_INTERVAL_KEY, config, dataExchange, LOGGER, name, ONE_WIRE_TIMEOUT, population, SENSOR_TIMEOUT
Constructor and Description |
---|
Hygrometer(java.lang.String name,
com.dalsemi.onewire.adapter.DSPortAdapter adapter,
java.util.Properties config,
IDataExchange dataExchange,
IServiceControl serviceControl)
Creates a new instance of Hygrometer.
|
beginExclusive, curveFit, doADConvertEFT, doADConvertEFT, doTemperatureConvertEFT, endExclusive, findContainerEFT, findContainerEFT, findContainerEFT, getADVoltageEFT, getADVoltageEFT, getTemperatureEFT, readBytesEFT, readCounterEFT, readDeviceEFT, readFileEFT, setMaxTemperatureResolutionEFT, stdDev, toHexString, toString, writeByteEFT, writeDeviceEFT
private static final byte[] FAMILY
private static final int ZERO
private static final int SLOPE
private com.dalsemi.onewire.container.OneWireContainer26 container
private double hVdd
private double[] sCoeffs
private double[] hCoeffs
private double[] tCoeffs
public Hygrometer(java.lang.String name, com.dalsemi.onewire.adapter.DSPortAdapter adapter, java.util.Properties config, IDataExchange dataExchange, IServiceControl serviceControl)
name
- of this sensor task.adapter
- 1-Wire adapter.config
- configuration properties.dataExchange
- to notify with new data.serviceControl
- to schedule the task.