LabWired The easy way to build hardware
board I/O module

MQ-2 Gas Sensor

The MQ-2 Gas Sensor is a board I/O module in the LabWired part catalog. Its catalog type is mq-2. It connects to the MCU over GPIO. The catalog gives a supply range of 4.5–5.5 V. It has 4 pins. This part is its pins. There is no separate device model because the MCU’s own GPIO/PWM/ADC model already is the simulation.

From the catalog: A0 is an ADC level; gas concentration is host-driven via SimInput, not a chemical model.

Key facts

CategoryBoard I/O modules
Catalog typemq-2
InterfaceGPIO
Supply range4.5–5.5 V
Pins4
DatasheetWinsen MQ-2 flammable gas sensor manual

What LabWired simulates

What is simulated

Pins only, by design

How it was validated

Not applicable. No device model to validate — see what is simulated, above.

MQ-2 Gas Sensor pinout

PinElectrical typeFunction
VCC Power input Supply
GND Power input Supply
A0 Passive —
D0 Output GPIO

How to simulate the MQ-2 Gas Sensor in LabWired

  1. Open the Playground at app.labwired.com and place an MCU board.
  2. Add the MQ-2 Gas Sensor (catalog type mq-2).
  3. Connect VCC and GND to the supply and ground of the board. Use a supply inside the catalog range of 4.5–5.5 V.
  4. Connect D0 to a free GPIO pin.
  5. Connect A0 as your circuit needs.
  6. Run the firmware. It reads and drives these pins through the GPIO, PWM and ADC models of the MCU. The part has no separate device model.

Related Board I/O modules

All Board I/O modules · All parts

Modelled from Winsen MQ-2 flammable gas sensor manual.