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.

T3311 Class

Module: t3311

This module implements support for the Comet System T3311 Temperature and Humidity transmitter. It uses MODBUS over an RS232 serial port. You must have libmodbus v3.1.2 (or greater) installed to compile and use this driver.
This module was developed using libmodbus 3.1.2, and T3311 Firmware revison 2.66 connected via a Prolific RS232 Serial to USB adaptor. You cannot use the built in TTL UART pins for accessing this device b you must use a full serial RS232 interface connected via USB.

Methods

T3311

(
  • device
  • address
  • baud
  • bits
  • parity
  • stopBits
)
Number

T3311 constructor

Parameters:

  • device String

    Path to the serial device

  • address Number

    The MODBUS slave address

  • baud Number

    The baudrate of the device. Default: 9600

  • bits Number

    The number of bits per byte. Default: 8

  • parity String

    The parity of the connection, 'N' for None, 'E' for Even, 'O' for Odd. Default: 'N'

  • stopBits Number

    The number of stop bits. Default: 2

Returns:

Number:

extendedDataAvailable

() Boolean

Indicate whether the attached sensor supports extended Computed Data registers. Firmware versions at, or higher than 2.44 provide this data.

Returns:

Boolean:

true if Extended Data is available, false otherwise

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 or humidity.

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

getHumidity

() Number

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

Returns:

Number:

The last humidity reading

getComputedValue

() Number

Get the current computed value. update() must have been called prior to calling this method. This value is configured via the configuration of the sensor using the sensors configuration utility, and can represent several different computed values. The default value from the factory is the current Dew Point Temperature .
Since the actual value configured is unknown (and unknowable) to this driver, the units represented depend on how you have configured the device. This function simply returns the value without any conversion or interpretation, other than the default scaling.

Returns:

Number:

The last Computed Value

getDewPointTemperature

(
  • fahrenheit
)
Number

Get the current dew point temperature. update() must have been called prior to calling this method. This information is only available if the sensor supports Extended Data (ie: extendedDataAvailable() returns true).

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 dew point temperature reading in Celsius or Fahrenheit

getAbsoluteHumidity

() Number

Get the current absolute humidity. update() must have been called prior to calling this method. This information is only available if the sensor supports Extended Data (ie: extendedDataAvailable() returns true).

Returns:

Number:

The last absolute humidity reading in g/m3 (grams per cubic meter).

getSpecificHumidity

() Number

Get the current specific humidity. update() must have been called prior to calling this method. This information is only available if the sensor supports Extended Data (ie: extendedDataAvailable() returns true).

Returns:

Number:

The last specific humidity reading in g/kg (grams per kilogram).

getMixingRatio

() Number

Get the current mixing ratio. update() must have been called prior to calling this method. This information is only available if the sensor supports Extended Data (ie: extendedDataAvailable() returns true).

Returns:

Number:

The last mixing ratio reading in g/kg (grams per kilogram).

getSpecificEnthalpy

() Number

Get the current specific enthalopy, a measure of energy density. update() must have been called prior to calling this method. This information is only available if the sensor supports Extended Data (ie: extendedDataAvailable() returns true).

Returns:

Number:

The last specific enthalopy reading in kJ/kg (kilojoules per kilogram).

getSerialNumber

() String

Get the serial number of the sensor.

Returns:

String:

The serial number

getFirmwareMajor

() Number

Get the firmware revision major number.

Returns:

Number:

The firmware revsion major number.

getFirmwareMinor

() Number

Get the firmware revision minor number.

Returns:

Number:

The firmware revsion minor number.

setDebug

(
  • enable
)

Enable or disable debugging output. This primarily enables and disables libmodbus debugging output.

Parameters:

  • enable Boolean

    true to enable debugging, false otherwise

Properties

REG_TEMPERATURE

Enum REGS_T

REG_HUMIDITY

Enum REGS_T

REG_COMPUTED

Enum REGS_T

REG_DEW_POINT

Enum REGS_T

REG_ABS_HUMIDITY

Enum REGS_T

REG_SPECIFIC_HUMIDITY

Enum REGS_T

REG_MIXING_RATIO

Enum REGS_T

REG_SPECIFIC_ENTHALPY

Enum REGS_T

REG_SERIAL_HI

Enum REGS_T

REG_SERIAL_LO

Enum REGS_T

REG_UNIT_SETTINGS

Enum REGS_T

REG_FW_HI

Enum REGS_T

REG_FW_LO

Enum REGS_T