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.

MQ2 Class

Module: gas

The MQ2 Gas Sensor module is useful for gas leakage detection (in home and industry). It can detect LPG, i-butane, methane, alcohol, hydrogen, smoke, and other combustible gases. It's a medium-sensitivity sensor with a detection range of 300-10,000 ppm.
mq2-5.jpeg

Item Index

Methods

Methods

MQ2

(
  • gasPin
)
Number

MQ2 constructor

Parameters:

  • gasPin Number

    Analog pin where the sensor is connected

Returns:

Number:

name

() String

Returns the name of the sensor

Returns:

String: