Showing posts with label MQ-2. Show all posts
Showing posts with label MQ-2. Show all posts

Gas detector based on MQ-2 without microcontroller

 Posted by:   Posted on:    No comments

Nowadays people are using microcontrollers even for blinking an LED. And that is no problem, since they are cheap enough, have low power consumption and are easy to program. But there was a time when microcontrollers were expensive and hard to find. And even then, engineers were building working devices, just smart enough to do the job they were designed for. Let's try to build a "microcontroller-less" gas detector using one of the MQ sensors.

Gas sensors from MQ family are analog tin dioxide detectors which change their resistance in the presence of volatile compounds like gases or smoke. Except MQ-7 and MQ-9 which are designed for carbon monoxide detection and require alternating heater voltage, with analog output being read at the end of each heater voltage cycle, every other sensor may be used in the following circuit.

Built analog gas detector with 3D printed enclosure
Built analog gas detector with 3D printed enclosure

Influence of temperature and humidity on MQ gas sensors

 Posted by:   Posted on:    1 comment

I dedicated some of my previous posts to MQ gas sensors. These devices are cheap and can be bought on PCB modules, which implement a simple comparator circuit in order to provide a digital output. However, the usability of these modules is rather limited, knowing that some of the sensors from MQ family require variable heater voltage. More than this, at power-up the resistance of the sensor is low until the heater reaches working temperature, therefore the comparator output of a sensor module will trigger a false alarm.

Although this is not an important limitation, the modules do not take into account the variation of sensor resistance based on environment temperature and humidity. To do this, a microcontroller must sample the sensor resistance through an ADC and estimate gas concentration. This post continues a previous one in which I estimated gas ppm after extracting sensitivity data from datasheet graphs. However...

Influence of temperature and humidity on MQ gas sensors

Interface MQ gas sensor modules to 3.3V development boards

 Posted by:   Posted on:    No comments

Sensors from MQ family are tin dioxide smoke and gas detectors with analog output. Tin dioxide changes its resistance when exposed to gases, but it has to be heated. This is why these sensors have a heater resistor made of nichrome wire. MQ sensors are not suitable for battery powered devices since the heater requires a lot of current. In a previous post I took an MQ-2 module, changed some resistors on its PCB and interfaced it to Arduino.

Let's explore the possibilities of interfacing such modules to 3.3 V development boards. There are advantages like possibility of IoT integration, higher ADC resolution and more computing power on 32-bit architecture. There is however an... analog issue. When exposed to high concentrations of gas, the voltage across load resistor (RL) will go higher than 3.3 V. This could damage the ADC. We'll see in this post methods of scaling down the output voltage on load resistor.

MQ-2 readings with Raspberry Pi Pico

Compute ppm of MQ sensors from datasheet graphs

 Posted by:   Posted on:    No comments

I tried to connect some of the gas sensor modules I have bought over time to Arduino. Unfortunately, I discovered these modules were not designed properly and require some modifications in order to power sensors according to datasheet specifications. I am using an MQ-2 type sensor for this test and all of the following estimations will be specific for this type of sensor. You can use the same approach to read and process analog input of any of the other sensors from MQ family.

You won't find in any of the available datasheets a direct, clear formula to approximate ppm of a gas based on the sensor resistance. But there are some sensitivity graphs which we can use to find a correlation. To make things even more complicated, for MQ-2 there are two datasheets available, from different manufacturers, with different sensitivity data.

Compute ppm of MQ sensors from datasheet graphs

Attempts at reading data from MQ-2 gas sensor

 Posted by:   Posted on:    No comments

MQ-2 is a gas leakage detecting sensor with good sensitivity to a wide range of gases. Since you can get most MQ sensor on ready-made modules, people are interfacing those with development boards. However, the modules are far from perfect. Some of the sensors require variable heater voltages. This is not the case for MQ-2. Since I own a module with this sensor and it can probably be used as is, I decided to make some tests while I'm waiting a PCB for MQ-9 to be manufactured and shipped.

In the previous post I explained why modules with MQ-7 and MQ-9 are no good. Now, I'm about to discover the same for MQ-2. I thought I could use the module as is, since I am more interested in finding a method of computing useful data from the analog output of the sensor. With an Arduino compatible board and an MQ-2 module I will attempt to get ppm values. But not before some parts swapping.

MQ-2 test fixture, with sensor exposed to alcohol
MQ-2 test fixture, with sensor exposed to alcohol