UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

DFRORP Class

Module: dfrorp

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.

Methods

DFRORP

(
  • apin
  • a_ref
)
Number

DFRORP object constructor

Parameters:

  • apin Number

    Analog pin to use

  • a_ref Number

    The analog reference voltage in use. Default 5.0.

Returns:

Number:

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 Number

    The 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 Number

    The 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:

Number:

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 Number

    The 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:

Number:

The voltage measurement.

getNormalized

() Number

Get the normalized ADC value from the sensor. update() must have been called prior to calling this function.

Returns:

Number:

The normalized ADC value.