Wemos MQ5 Gas Sensor example

The MQ5 Gas Sensor module is useful for gas leakage detection. It is suitable for detecting H2, LPG, CH4, CO, Alcohol. Due to its high sensitivity and response time, measurements can be taken as soon as possible.

The sensitivity of the sensor can be adjusted by using the potentiometer.

mq-5

FEATURES

* High sensitivity to LPG, natural gas , town gas
* Small sensitivity to alcohol, smoke.
* Fast response .
* Stable and long life
* Simple drive circuit

Specifications

Item Parameter Min Typical Max Unit
VCC Working Voltage 4.9 5 5.1 V
PH Heating consumption 0.5 800 mW
RL Load resistance adjustable
RH Heater resistance 31±10% Ω
Rs Sensing Resistance 10 60
Scope Detecting Concentration 200 10000 ppm

 

Please note that the best preheat time for the sensor is above 24 hours

Parts List

I recommend you try and get a kit of all the MQ sensors, you can buy these individually but you can also get a kit for about $9

Here are the parts I used

Name Links
Wemos Mini
MQ sensors
Connecting cables

Connection

here are the connections for my sensor

Wemos Gas Sensor
3v3 VCC
GND GND
NC DOUT
Analog A0 AOUT

 

Code

 

void setup() 
{
  Serial.begin(9600);
}
 
void loop() 
{
  float sensorVoltage; 
  float sensorValue;
 
  sensorValue = analogRead(A0);
  sensorVoltage = sensorValue/1024*5.0;
 
  Serial.print("sensor voltage = ");
  Serial.print(sensorVoltage);
  Serial.println(" V");
  delay(1000);
}

 

Results

Again look at the serial monitor

sensor voltage = 0.70 V
sensor voltage = 0.69 V
sensor voltage = 0.68 V
sensor voltage = 0.67 V
sensor voltage = 0.67 V
sensor voltage = 0.66 V

Links

Mq-5 datasheet

LEAVE A REPLY

Please enter your comment!
Please enter your name here