MQ gas sensor readings are high or unstable: warm-up time, heater power and calibration

Let the sensor warm up for a long time and calibrate in clean air.

What the message means

The element is heated and its resistance changes slowly. Right after power-up the readings are high and drift.

Fix it in this order

  1. Power the heater from 5 V with enough current.
  2. Wait for the warm-up time in the datasheet before you trust readings.
  3. Measure the baseline in clean air and store it.
  4. Compare later readings with the baseline.
  5. Keep the sensor away from drafts, heat and humidity changes.
  6. Do not use an MQ module as a safety alarm.

Why it happens

An MQ gas sensor has a heated element. It needs time to warm up, and a new sensor is usually run for a long period before first use; many guides suggest around a day. Readings also depend on the load resistor, the supply voltage and the temperature and humidity.

Let it warm up before reading, calibrate in clean air to find its baseline, and treat the numbers as rough. These modules are not suitable as a safety alarm.

If you see this, do this

You seeDo this
Reads high after power-upStill warming up.
Reading changes with humidityCross sensitivity.

5 V current, ADC noise.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

Why this happens

An MQ sensor is a small heater with a metal-oxide layer. In clean air the layer has a high resistance. When target gases are present, the resistance falls. The module only converts that resistance to a voltage through a divider with a load resistor, RL. It takes a long time to reach a stable state because the layer needs to be at working temperature, and a new or stored sensor needs a long first run.

The reading depends on the heater voltage, humidity, temperature and which gas is there. The sensor responds to many gases, so the number is not a clean ppm value without calibration against known concentrations. The module is a rough indicator and not a safety device.

How to confirm the cause

  • Measure the voltage at the module’s VCC and GND pins while the heater is on; it should be close to 5 V. A low voltage means a weak supply.
  • Log the reading every ten seconds from power-up. It should settle; one that keeps drifting is still warming up.
  • Move the sensor to another room or into fresh air and compare. A reading that is different but stable shows normal sensitivity.
  • Check whether the module output goes to a 3.3 V ADC. Output near 5 V can exceed the input range.

Worked example

The resistance follows from the divider: Rs = (Vc – Vout) / Vout x RL. With illustrative numbers, 5 V, RL = 10 kilohm and Vout = 1.0 V, Rs is 40 kilohm. If Vout rises to 2.0 V, Rs is 15 kilohm, so the ratio to the clean-air value is 0.375.

const float VC = 5.0;     // supply to the module
const float RL = 10.0;    // load resistor in kilohm, check your board

float sensorRs(int raw) {
  float v = raw * VC / 1023.0;       // 10-bit ADC (Uno)
  return (VC - v) / v * RL;           // Rs in kilohm
}
// Vout 1.0 V -> Rs = 4.0 / 1.0 * 10 = 40 kilohm
// Vout 2.0 V -> Rs = 3.0 / 2.0 * 10 = 15 kilohm

Common mistakes

  • Powering the heater from 3.3 V.
  • Calibrating after a minute of warm-up and calling the number R0.
  • Calibrating in a kitchen or workshop where gas and fumes are present.
  • Using the reading as a safety alarm.

If this did not fix it

  • Check the supply for dips when the heater turns on.
  • Check the sensor type: an MQ-2 and an MQ-135 respond to different gases.
  • Check temperature and humidity changes during the test.
  • Check the ADC for noise by averaging samples.