top of page

MQ4 Methane Gas

The MQ4 module allows the JackBord to detect methane gas at concentrations from 300 ppm to 10,000 ppm. The reading output from the sensor is an analog voltage from 0.1V to 4.5V. There is a digital output as well, pin DO, which is normally high and goes low when gas is detected.

MQ4 Methane Gas

The MQ4 module allows the JackBord to detect methane gas at concentrations from 300 ppm to 10,000 ppm. The reading output from the sensor is an analog voltage from 0.1V to 4.5V. There is a digital output as well, pin DO, which is normally high and goes low when gas is detected.


Quick Commands


To setup the sensor and get some raw readings from it run the command below: (this assumes the sensor is on port A1)

gvr a1 0 100


This gets the voltage reading from the sensor and scales it between 0 and 100, with 100 being the maximum gas reading.


Some Useful Resources


Understanding a Gas Sensor


MQ4 Sensor Datasheet


NOTES AND CAUTIONS

  • The sensor gets hot during use so make sure it has plenty of air flow

  • Do not get the sensor wet

  • The sensor is powered from 5V

  • The JackBord is NOT waterproof, so don't allow it to become wet

  • The sensor needs some time to warm up, the manual states about 24hours but you can start using it after about 10 minutes.


Parts of the Sensor


Power LED - Turns on when the power is applied.

Trigger LED - Turns on when gas is detected. The selection threshold is set via the variable resistor.

Variable Resistor - Used to adjust the sensitivity of the digital output.

Gas Sensor - This is the sensor that detects the gas.


How it Works


The sensor composed by micro AL2O3 ceramic tube, Tin Dioxide (SnO2) sensitive layer, measuring electrode and heater are fixed into a crust made by plastic and stainless steel net. An internal heater provides the heat required for the sensor to work. The sensor module has two outputs: DO which is a digital logic output and AO which is the analog output.


Input and Output Pins


The pins of the sensor are listed below:


Connecting the Sensor to the JackBord


1. Bolt the sensor to the side of the JackBord on Port A as shown below



2. Connect the 5V power, ground, and analogue jumpers to Port A as shown below in the diagram




Connections to the JackBord. The white jumper goes from the sensor's analogue output into the JackBord's port A1 pin.


Using the Sensor


Once the sensor is connected to the JackBord, we can get the readings from it by using port pin a1 as an analogue input. To set a1 as an analogue input type this command at the command prompt:

gvr a1 1 100 This command takes the analogue output from the sensor and scales it between 0 and 100.







bottom of page