The MQ138 VOC Gas Sensor Module is a semiconductor gas sensor designed to detect volatile organic compounds (VOCs) and various organic vapors, including toluene, acetone, alcohol, methanol, and formaldehyde.
The sensor uses a tin dioxide (SnO₂) sensing element whose electrical conductivity changes when exposed to detectable gases. This change can be converted into an electrical signal for monitoring gas presence and relative concentration changes.
Featuring analog and digital outputs, an adjustable detection threshold, and a compact PCB design, the MQ138 is suitable for Arduino, ESP32, Raspberry Pi, and other microcontroller-based environmental monitoring projects.
Key Features
-
VOC Detection: Sensitive to various volatile organic compounds and organic vapors.
-
Multiple Gas Sensitivity: Responds to gases including toluene, acetone, alcohol, methanol, and formaldehyde.
-
Semiconductor Sensing Technology: Uses a tin dioxide (SnO₂) gas-sensitive element.
-
Analog Output (AO): Provides a variable signal related to changes in gas concentration.
-
Digital Output (DO): Provides a HIGH/LOW signal based on an adjustable threshold.
-
Adjustable Detection Threshold: Onboard potentiometer allows adjustment of the digital switching level.
-
5V DC Operation: Suitable for common microcontroller development platforms.
-
Onboard Indicators: LED indicators for power and digital detection status.
-
Fast Response: Responds to changes in detectable gas concentrations.
-
Compact PCB Design: Suitable for electronics prototypes and embedded applications.
-
Mounting Holes: Allows installation in project enclosures.
-
Microcontroller Compatibility: Can interface with Arduino, ESP32, and Raspberry Pi using appropriate circuitry.
Technical Specifications
| Specification |
Details |
| Model |
MQ138 |
| Sensor Type |
VOC Gas Sensor |
| Sensor Technology |
Metal Oxide Semiconductor (MOS) |
| Sensing Material |
Tin Dioxide (SnO₂) |
| Target Gases |
Toluene, Acetone, Alcohol, Methanol, Formaldehyde and Other VOCs |
| Reported Detection Range |
5–500 ppm VOC (gas-dependent) |
| Operating Voltage |
5V DC |
| Heater Voltage |
5V ± 0.2V |
| Reported Operating Current |
Approximately 180 mA |
| Comparator IC |
LM393 |
| Analog Output |
Variable Voltage |
| Digital Output |
HIGH/LOW Logic |
| Detection Threshold |
Adjustable Potentiometer |
| Load Resistance |
10 kΩ (reported module value) |
| Module Dimensions |
Approximately 32 × 22 mm |
| Interface |
Analog and Digital |
| Connection |
4-Pin Interface |
Pin Configuration
| Pin |
Description |
| VCC |
5V DC Power Supply |
| GND |
Ground |
| AO |
Analog Gas Sensor Output |
| DO |
Digital Threshold Output |
Arduino UNO Connection Example
| MQ138 Pin |
Arduino UNO |
| VCC |
5V |
| GND |
GND |
| AO |
A0 |
| DO |
D2 (Optional) |
The Arduino can read the analog output to monitor relative changes in VOC levels or use the digital output to detect when the adjustable threshold is reached.
Note: Accurate gas concentration measurements require calibration. The MQ138 cannot independently identify individual gases in a mixture.
ESP32 Connection Example
| MQ138 Pin |
ESP32 |
| VCC |
5V |
| GND |
GND |
| AO |
GPIO34 Through Voltage Divider |
| DO |
Digital GPIO Through Level Shifter |
Important: ESP32 GPIO pins operate at 3.3V. The MQ138 module may produce signals up to 5V, so appropriate voltage-level protection is required.
Raspberry Pi Compatibility
The MQ138 can be interfaced with Raspberry Pi boards using additional components.
-
Analog Reading: Requires an external ADC such as ADS1115 or MCP3008.
-
Digital Reading: Requires voltage-level shifting when the module output exceeds 3.3V.
-
Power Supply: Requires a suitable 5V DC supply.
Applications
- Indoor air quality monitoring prototypes
- VOC detection experiments
- Environmental monitoring projects
- Organic solvent vapor sensing
- Laboratory gas sensing experiments
- Arduino gas monitoring systems
- ESP32 IoT air quality projects
- Raspberry Pi sensor applications
- Smart home environmental monitoring prototypes
- Educational electronics experiments
- Industrial environmental monitoring research
- Embedded gas detection projects
Important Notes