DFRORP Class
- ID: dfrorp
- Name: Analog Oxidation Reduction Potential (ORP) Sensor
- Category: liquid
- Manufacturer: dfrobot
- Connection: ainput
- Link: http://www.dfrobot.com/index.php?route=product/product&path=36&product_id=1071#.V8Wywt9ytNJ
This library was tested with the DFRobot ORP (Oxidation/Reduction Potential) Sensor.
To calibrate:
Disconnect the sensor probe (but leave the sensor interface board connected). Then run one of the examples while holding down the 'calibrate' button on the device. Read the ORP value reported (it should be fairly small).
This value is what you should supply to setCalibrationOffset() . Then reconnect the probe to the interface board and you should be ready to go.
DO NOT press the calibrate button on the interface board while the probe is attached or you can permanently damage the probe.
Item Index
Methods
DFRORP
-
apin
-
a_ref
DFRORP object constructor
Parameters:
-
apin
NumberAnalog pin to use
-
a_ref
NumberThe analog reference voltage in use. Default 5.0.
Returns:
update
()
Read the sensor status an update internal state. update() must have been called before calling getORP() , getNormalized() , or getVolts() .
setOffset
-
offset
Set sensor offset. This offset is applied to the return ORP value before scaling. Default is 0.0.
Parameters:
-
offset
NumberThe offset to apply.
setScale
-
scale
Set sensor scale. The return ORP value is scaled by this value before the offset is applied. Default is 1.0.
Parameters:
-
scale
NumberThe scale to apply.
getORP
()
Number
Get computed ORP (in millivolts) value from the sensor. update() must have been called prior to calling this function.
Returns:
ORP value in millivolts
setCalibrationOffset
-
offset
Set the calibration offset for the device. This is determined by disconnecting the sensor probe (but leaving the sensor interface board connected). Then run one of the examples while holding down the 'calibrate' button on the device. Read the ORP value reported.
This (low) ORP value is what you should supply to this function. Then reconnect the probe to the interface board and you should be ready to go.
DO NOT press the calibrate button on the interface board while the probe is attached or you can permanently damage the probe.
Parameters:
-
offset
NumberThe ORP offset obtained during calibration.
getVolts
()
Number
Get the measured volts from the sensor. update() must have been called prior to calling this function.
Returns:
The voltage measurement.
getNormalized
()
Number
Get the normalized ADC value from the sensor. update() must have been called prior to calling this function.
Returns:
The normalized ADC value.