The MQ-138 is a versatile gas sensor designed to detect a variety of gases, including benzene, alcohol, and smoke. Manufactured by Arduino, this sensor is widely used in air quality monitoring systems and industrial applications. Its high sensitivity and fast response time make it an ideal choice for detecting harmful gases in the environment.
Parameter | Value |
---|---|
Operating Voltage | 5V |
Load Resistance | 10kΩ |
Heating Resistance | 33Ω ± 5% |
Heating Power | ≤ 800mW |
Sensitivity Range | 10 - 1000 ppm (benzene) |
Preheat Time | ≥ 24 hours |
Response Time | ≤ 10 seconds |
Recovery Time | ≤ 30 seconds |
Operating Temperature | -20°C to 50°C |
Humidity Range | 95% RH |
Pin No. | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (5V) |
2 | GND | Ground |
3 | AOUT | Analog output voltage |
4 | DOUT | Digital output voltage (threshold-based) |
5 | H1 | Heater coil connection 1 |
6 | H2 | Heater coil connection 2 |
// MQ-138 Gas Sensor with Arduino UNO
const int analogPin = A0; // Analog input pin for AOUT
const int digitalPin = 2; // Digital input pin for DOUT
int analogValue = 0; // Variable to store the analog value
int digitalValue = 0; // Variable to store the digital value
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(digitalPin, INPUT); // Set digital pin as input
}
void loop() {
analogValue = analogRead(analogPin); // Read the analog value
digitalValue = digitalRead(digitalPin); // Read the digital value
// Print the values to the Serial Monitor
Serial.print("Analog Value: ");
Serial.print(analogValue);
Serial.print(" | Digital Value: ");
Serial.println(digitalValue);
delay(1000); // Wait for 1 second before the next reading
}
By following this documentation, users can effectively integrate the MQ-138 gas sensor into their projects, ensuring accurate and reliable gas detection.