MQ8 Hydrogen Gas Sensor : Working & Its Applications

A hydrogen sensor is used to detect the presence of hydrogen gas in the air. These types of sensors include micro- fabricated point-contact hydrogen gas sensors which help in detecting hydrogen leaks. As compared to conventional gas sensor-based instruments, these sensors have many benefits like compact, less cost, simple to maintain, and strong. This article discusses an overview of the MQ8 hydrogen gas sensor and its working with applications.

What is MQ8 Hydrogen Gas Sensor?

MQ8 hydrogen gas sensor is a Metal oxide semiconductor type sensor. This sensor is used to detect Hydrogen gas within the air, detect gas leakage, and Hydrogen gas presence within the air. This sensor is very simple to use and detects hydrogen gas concentration in the range of 100-10000ppm anywhere.

MQ8 Hydrogen Gas Sensor
MQ8 Hydrogen Gas Sensor

This sensor has a high fast response time and sensitivity and the output of this sensor is an analog resistance. The package of this sensor is similar to the MQ3 alcohol sensor. Generally, a gas sensor plays a key role in detecting a specific gas concentration within the air. So based on the gas concentration, this sensor generates a potential difference by changing the resistance of the detecting element, so this can be measured like the output voltage.

MQ-8 hydrogen gas sensor includes a detecting element like aluminum-oxide (Al₂O₃) based ceramic material that is covered with SnO2 (tin dioxide) and arranged in a stainless-steel mesh.

Pin Configuration:

The pin Configuration of the MQ8 hydrogen gas sensor includes 4- pins where each pin and its functionality are given below.

MQ8 Gas sSensor Pin Configuration
MQ8 Gas sSensor Pin Configuration
  • Pin1 (VCC): This pin provides the input voltage for the sensor
  • Pin2 (GND): This is a Ground pin
  • Pin3 (DOUT): This is a digital signal output pin
  • Pin4 (AOUT): This is an analog signal output pin

Features & Specifications:

The features & specifications of the MQ8 hydrogen gas sensor include the following.

  • This sensor operates with 5V DC.
  • It detects hydrogen concentration within the air.
  • Resistant to smoke, LPG, and alcohol.
  • Power consumption of heater is below 800mW
  • The range of gas detection ranges from 100 – 1000ppm
  • Analog output is continuous
  • Compact size
  • Less cost
  • Dual signal output
  • Quick response
  • Reliable and long service life
  • Very sensitive to Hydrogen gas

Alternative MQ-8 Hydrogen Gas Sensors are MQ-2, MICS 5524, and SGAS701. The equivalent Hydrogen Gas Sensor is MQ-136.

How to use an MQ8 Hydrogen Gas Sensor / Circuit Diagram:

The hydrogen gas sensor circuit with an Arduino is shown below. In this circuit, an MQ8 hydrogen sensor is used which is very responsive to hydrogen gas effects. Hydrogen gas is colorless, tasteless, and odorless at room temperature & below typical pressure conditions.

At present, hydrogen gas is being used as an alternative source of energy to control some automobiles in the auto industry. Here, the hydrogen sensor’s chemical energy can be changed through a combustion technique which is the same as present engines. Manufacturers and engineers are investigating on this sensor whether H2 gas is used as possible car fuel or not.

Hydrogen gas is very dangerous to human beings and when it is mixed with air then it generates sparks. So due to this reason hydrogen gas need to monitor & measure frequently to avoid these issues. So the hydrogen gas sensor circuit using an Arduino is shown below.

Hydrogen Gas Sensor Circuit using an Arduino
Hydrogen Gas Sensor Circuit using an Arduino

The required components to build this circuit mainly include an Arduino, MQ-8 Hydrogen Gas Sensor & LED (light-emitting diode). This sensor includes four terminals which are already discussed above. The two terminals like Vcc & GND leads to provide power to hydrogen sensor whereas the remaining two terminals are analog output (AOUT) & digital output (DOUT).

Here, the Vcc terminal of this sensor is connected directly to the 5Volts terminal of the Arduino. The GND terminal of the H2 sensor is connected to the Arduino board’s GND terminal so that power can be established for the sensor. The remaining two terminals like analog output & digital outputs are given to A0 & D8 pins of the Arduino respectively.

This sensor working mainly depends on the AOUT pin because the output provided by this terminal is analog voltage output which is proportional to the methane gas detected by the sensor. When the sensor detects more methane gas then it generates high analog output. Similarly, if it detects less gas then it generates less analog output.

Once the analog output voltage reaches a fixed level then DOUT pin goes high. Once the digital pin goes high then Arduino starts detecting and activates the LED. If the methane threshold value crosses its limit, a potentiometer is used to adjust the threshold level by increasing or decreasing.

The required code for the arduino is shown below that need to upload into Arduino board for measuring the levels of hydrogen gas.

const int AOUTpin=0;
const int DOUTpin=8;
const int ledPin=13;
int limit;
int value;
void setup() {
pinMode(DOUTpin, INPUT);
pinMode(ledPin, OUTPUT);
void loop()
value= analogRead(AOUTpin);
limit= digitalRead(DOUTpin);
Serial.print(“Hydrogen value: “);
if (limit == HIGH){
digitalWrite(ledPin, HIGH);
digitalWrite(ledPin, LOW);
In the above code, the primary block code defines the connections of all the pins of the hydrogen sensor and the LED.

The secondary block of code declares the input is DOUTpin & output is ledPin because this hydrogen sensor is used as an input to the Arduino to read & process the value of the H2 sensor. Once the sensor detects hydrogen gas, the LED gives an indication. If the H2 sensor value is HIGH (1), the LED will be turned ON and if the value is low then the LED will be turned OFF.

Where to use MQ8 Hydrogen Gas Sensor / Applications:

The applications of MQ8 hydrogen gas sensors include the following.

  • This sensor is used to measure the hydrogen concentration within the air.
  • It detects gas leakages within the industry
  • The gas sensor is used in mines
  • Used in AC & refrigerators

Please refer to this link to know more about MQ8 Hydrogen Gas Sensor Datasheet

Thus, the MQ8 Gas Sensor is very helpful in detecting gas leakage by using detecting equipment in homes, industries, public places, etc. For this sensor, measurements need to take as soon as possible because of quick response time and high sensitivity. This sensor has a high sensitivity for the substances like alcohol, cooking fumes, LPG, so this may change results. So the hydrogen sensor sensitivity can be simply adjusted through the potentiometer. Here is a question for you, what are the different gas sensors available in the market?