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.

TP401 Class

Module: gas

The TP401 Gas Sensor module is useful for monitoring air purity indoors. It can detect CO and a wide range of other harmful gases, but, due to a limited detection range, it should be used only when qualitative results are needed. Example applications are air recirculation, ventilation systems, and refreshing sprayers. The sensor is linear and should be roughly sensitive to 0-20 ppm CO from 0-4 V. Note: the sensor requires 2-3 minutes to warm up initially and 48 hours of operation to stabilize completely.
tp401.jpeg

Item Index

Methods

Methods

TP401

(
  • gasPin
)
Number

TP401 constructor

Parameters:

  • gasPin Number

    Analog pin where the sensor is connected

Returns:

Number:

name

() String

Returns the name of the sensor

Returns:

String:

Name of the sensor

getPPM

() Number

Returns one sample in parts per million (ppm) of CO in the air based on the following sensor calibration: 0-4 V is roughly 0-20 ppm CO

Returns:

Number:

New sample converted to ppm CO