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.

TEAMS Class

Module: teams

The Veris TEAMS temperature sensor provides it's output via a 4-20ma current loop. The supported temperature range is 10C to 35C.
This sensor was developed with a Cooking Hacks (Libelium) 4-channel 4-20ma Arduino interface shield. For this interface, the receiver resistance (rResistor) was specified as 165.0 ohms.
When using a 4-20ma current loop interface which scales the sensors' values to a 0-5vdc range, you can supply 0.0 as the rResistor value in the constructor (default), and it will act just like a normal analog input.

Methods

TEAMS

(
  • tPin
  • rResistor
  • aref
)
Number

TEAMS object constructor

Parameters:

  • tPin Number

    Analog pin to use for temperature.

  • rResistor Number

    The receiver resistance in ohms, when using a 4-20ma current loop interface. When specified, this value will be used in computing the current based on the voltage read when scaling the return values. Default is 0.0, for standard scaling based on voltage output rather than current (4-20ma mode).

  • aref Number

    The analog reference voltage, default 5.0

Returns:

Number:

update

()

Read current values from the sensor and update internal stored values. This method must be called prior to querying any values, such as temperature.

getTemperature

(
  • fahrenheit
)
Number

Get the current temperature. update() must have been called prior to calling this method.

Parameters:

  • fahrenheit Boolean

    true to return the temperature in degrees fahrenheit, false to return the temperature in degrees celsius. The default is false (degrees Celsius).

Returns:

Number:

The last temperature reading in Celsius or Fahrenheit

isConnected

() Boolean

When using a direct 4-20ma interface (rResistor supplied in the constructor is >0.0), this function will return false when the computed milliamps falls below 4ma, indicating that the sensor is not connected. If rResistor was specified as 0.0 in the constructor, this function will always return true.

Returns:

Boolean:

true if the sensor is connected, false otherwise.

getRawMilliamps

() Number

When using a direct 4-20ma interface (rResistor supplied in the constructor is >0.0), this function will return the computed milliamps (after the offset has been applied). If rResistor was specified as 0.0 in the constructor, this function will always return 0.0.

Returns:

Number:

The last measured current in milliamps after any offset has been applied.

setOffsetMilliamps

(
  • offset
)

Specify an offset in milliamps to be applied to the computed current prior to scaling and conversion. This can be used to 'adjust' the computed value. If rResistor was specified as 0.0 in the constructor, this function will have no effect.

Parameters:

  • offset Number

    a positive or negative value that will be applied to the computed current measured.