MQ-138 Formaldehyde Gas Sensor Module COM52, R37

Fr49,000

In stock

SKU: SEN21122 Category:

Description

Sensitive material of MQ138 gas sensor is SnO2, which with lower conductivity in clean air. When VOC gas exists, the sensor’s conductivity gets higher along with the gas concentration rising. Users can convert the change of conductivity to correspond output signal of gas concentration through a simple circuit.
MQ138 gas sensor has high sensitivity to toluene, acetone,alcohol,methanol,also can monitor hydrogen and other organic vapour well. It can detect kinds of organic gases and is a kind of low-cost sensor for kinds of applications.

 

Features

1: Wide range of applications

2: Small appearance

3: Long service life

4: Fast response time

5: With mounting holes for easy permanent installation

 

Specifications

  • Detection Gas: toluene, acetone, alcohol, hydrogen
  • Detection Range: 5~500ppm VOC
  • Size:32mm X22mm X27mm   L x W x G
  • Main chip:LM393.
  • Operating voltage: DC 5V
  • Heating voltage: 5 ±0.2V (AC·DC)
  • Working current: 180mA.
  • Circuit voltage: DC5V (Max DC 24V)
  • Load resistance: 10K (adjustable)
  • Test concentration range :1-100ppm.
  • Clean air voltage: < 1.5V.
  • Sensitivity: > 3%
  • Response time: < 1S (3-5 minute warm-up, theory preheating time 48 hours)

 

Connecting the MQ-138 into circuit

Connecting the MQ-138 sensor into a circuit is jut straigt forward because it is easy as dictating it; take a look down below

 

 

After the connections, you have to bring your sensor close in the atmosphere where its target gas is present.

Note: MQ series sensors do not literally detect which type of gas is around, just when they detect the type of their interest the give a signal and show the level of its concentration in the atmosphere.

Now below is a simple code to start with the sensor, which can be improved to meet one’s certain interests.

 

const int sensorPin = A0; // Analog pin connected to the sensor
const int heaterPin = 2; // Digital pin connected to the heater

const int warmUpTime = 10000; // Warm-up time in milliseconds (10 seconds)
const int samplingTime = 5000; // Sampling time in milliseconds (5 seconds)
const int delayTime = 5000; // Delay time between readings in milliseconds (5 seconds)

float Ro = 10; // Resistance of the sensor at clean air (calibration value)
float Rs; // Resistance of the sensor in target gas
float ratio; // Rs/Ro ratio to calculate gas concentration

void setup() {
Serial.begin(9600);
pinMode(heaterPin, OUTPUT);

// Perform sensor calibration
Serial.println(“Calibrating…”);
delay(warmUpTime);
Ro = calibrate();
Serial.println(“Calibration complete!”);
delay(1000);
}

void loop() {
// Turn on the heater to warm up the sensor
digitalWrite(heaterPin, HIGH);
delay(warmUpTime);

// Read the sensor value after warming up
Rs = readSensor();

// Turn off the heater to cool down the sensor
digitalWrite(heaterPin, LOW);

// Calculate the Rs/Ro ratio
ratio = Rs / Ro;

// Use the ratio to estimate gas concentrations
float benzenePPM = getBenzenePPM(ratio);
float toluenePPM = getToluenePPM(ratio);
float alcoholPPM = getAlcoholPPM(ratio);

// Print the results to the serial monitor
Serial.print(“Benzene (PPM): “);
Serial.println(benzenePPM);
Serial.print(“Toluene (PPM): “);
Serial.println(toluenePPM);
Serial.print(“Alcohol (PPM): “);
Serial.println(alcoholPPM);

// Delay before the next reading
delay(delayTime);
}

// Function to calibrate the sensor in clean air
float calibrate() {
int value = analogRead(sensorPin);
float sensorVoltage = (value / 1023.0) * 5.0;
float sensorResistance = (5.0 – sensorVoltage) / sensorVoltage;
float Ro = sensorResistance / 9.8; // Use a typical Ro value for MQ-138
return Ro;
}

// Function to read the sensor resistance in the presence of gas
float readSensor() {
int value = analogRead(sensorPin);
float sensorVoltage = (value / 1023.0) * 5.0;
float sensorResistance = (5.0 – sensorVoltage) / sensorVoltage;
return sensorResistance;
}

// Functions to convert Rs/Ro ratio to gas concentration (PPM)
float getBenzenePPM(float ratio) {
float ppm = pow(10, ((log10(ratio) – 1.0811) / -0.2276));
return ppm;
}

float getToluenePPM(float ratio) {
float ppm = pow(10, ((log10(ratio) – 0.9394) / -0.2253));
return ppm;
}

float getAlcoholPPM(float ratio) {
float ppm = pow(10, ((log10(ratio) – 1.3612) / -0.3442));
return ppm;
}