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.

MQ4 Class

Module: gas

The MQ4 Gas Sensor module is useful for detecting CH4 (Methane), and natural gas concentrations in the air. It has a detection range of 100-10000 ppm.
For optimum use, it requires calibration after a pre-heat time of at least 24 hours. See the datasheet for details.
mq2-5.jpeg

Item Index

Methods

Methods

MQ4

(
  • gasPin
)
Number

MQ4 constructor

Parameters:

  • gasPin Number

    Analog pin where the sensor is connected

Returns:

Number:

name

() String

Returns the name of the sensor

Returns:

String: