TEP DOWNLOAD CENTER

Project Files of MQ Gas Sensor Library for Proteus V1.0: MQ-3, MQ-7, MQ-135 and More

Libraries Code Projects Simulation
tep://download-terminal mq-gas-tep-v1-0-6828f35009ae418e903f2575ce430eb1.zip ZIP archiveV1.0Verified62 downloadsFree
MQ Gas Sensor Library for Proteus V1.0: an MQ-135 with its STATUS panel and the pop-up of an MQ-7
Proteus library · File 1 of 1

MQ Gas Sensor Library for Proteus V1.0

MQ Gas Sensor Library for Proteus V1.0 comes as a ZIP archive of 10 files (1.2 MB, 3.2 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, an Arduino sketch and compiled HEX firmware.

  • LIBProteus library
  • DLLProteus model
  • DSNProteus simulation
  • INOArduino sketch
  • HEXHEX firmware

Description

This is the download page of MQ Gas Sensor Library for Proteus V1.0, the file package of the tutorial MQ Gas Sensor Library for Proteus V1.0: MQ-3, MQ-7, MQ-135 and More, published on The Engineering Projects in October 2026. Here you get the ZIP file (1.2 MB) with the Proteus library files (LIB and IDX), the simulation model (DLL), a ready Proteus simulation, an Arduino sketch and the compiled HEX firmware, the list of files it contains, the README when there is one, and the installation steps in order.

What this library is

MQ-Gas-Sensor-Library-for-Proteus-v1.0.zip with the MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9 and MQ-135 gas sensor modules, Simple and Advance (TEPMQGAS.LIB and TEPMQGAS.DLL), our Arduino UNO V4.0 library with its built-in serial monitor (ArduinoV4TEP.LIB and TEPARDUINO.DLL), the two-UNO simulation with its HEX file, the demo sketch and a README.

This is version 1.0; older or newer releases, when they exist, are listed in the Development tab.

What is inside the ZIP file

  • ArduinoV4TEP.LIB – Proteus library, 201.9 KB
  • TEPMQGAS.LIB – Proteus library, 553 KB
  • TEPARDUINO.DLL – Simulation model, 883.5 KB
  • TEPMQGAS.DLL – Simulation model, 328.5 KB
  • MQ-Gas-Sensors-ArduinoUnoV4.pdsprj – Proteus simulation, 24.8 KB
  • MQ_Gas_Demo.ino – Arduino sketch, 7.6 KB
  • and 4 more, all listed in the File Structure tab

The archive unpacks to 3.2 MB and carries its own README (README.txt), shown in the README tab above.

How to download

Use the download panel at the top of this page: after the counter (30 seconds for guests, 10 for members) the black button unlocks and the ZIP file comes straight from our content network. If the browser opens it instead of saving, use Save as; extract the whole archive before using anything inside it.

How to install

  • Step 1: Extract the ZIP file with Windows (Extract All), 7-Zip or WinRAR, keeping its folders.
  • Step 2: Close Proteus and copy ArduinoV4TEP.LIB and TEPMQGAS.LIB into its LIBRARY folder (Proteus 8: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY).
  • Step 3: Copy TEPARDUINO.DLL and TEPMQGAS.DLL into the MODELS folder next to it, so the part simulates.
  • Step 4: Start Proteus, press P and search for "ArduinoV4TEP"; place and wire it as in the tutorial.
  • Step 5: Open MQ_Gas_Demo.ino in the Arduino IDE, pick board and port and Verify (Export Compiled Binary gives the HEX).
  • Step 6: In Proteus set the controller's Program File to MQ_Gas_Demo.hex; on hardware, flash the same file.
  • Step 7: Open MQ-Gas-Sensors-ArduinoUnoV4.pdsprj in Proteus and press Play.

Read the detailed guide

This page is for the files. The full tutorial, MQ Gas Sensor Library for Proteus V1.0: MQ-3, MQ-7, MQ-135 and More, explains the circuit and the code step by step and shows the working results and the simulation; read it before you build. Questions about the download or the installation go in the comments below; more Proteus downloads are listed further down this page.

Read MQ Gas Sensor Library for Proteus V1.0: MQ-3, MQ-7, MQ-135 and More

File Structure

mq-gas-tep-v1-0-6828f35009ae418e903f2575ce430eb1.zip10 files · 5 folders · 3.2 MB unpacked
MQ-Gas-TEP-v1.0/10 files · 3.2 MB
Arduino Code/1 file · 7.6 KB
MQ_Gas_Demo/1 file · 7.6 KB
INO MQ_Gas_Demo.inoArduino sketch 7.6 KB
Proteus Library Files/2 files · 754.9 KB
LIB ArduinoV4TEP.LIBProteus library 201.9 KB
LIB TEPMQGAS.LIBProteus library 553 KB
Proteus Model Files/2 files · 1.2 MB
DLL TEPARDUINO.DLLSimulation model 883.5 KB
DLL TEPMQGAS.DLLSimulation model 328.5 KB
Proteus Simulation/4 files · 1.2 MB
DSN MQ-Gas-Sensors-ArduinoUnoV4.pdsprjProteus simulation 24.8 KB
HEX MQ_Gas_Demo.hexCompiled HEX file 38 KB
DLL TEPARDUINO.DLLSimulation model 883.5 KB
DLL TEPMQGAS.DLLSimulation model 328.5 KB
TXT README.txtText file 22.8 KB

README

README.txt 388 lines
MQ GAS SENSOR LIBRARY FOR PROTEUS - V1.0 (MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, MQ-9, MQ-135)
Designed by The Engineering Projects
www.TheEngineeringProjects.com

IMPORTANT LINKS
Article (read it first - pictures, step by step, every feature explained):
  https://www.theengineeringprojects.com/2026/10/mq-gas-sensor-library-for-proteus-v1-0.html
Report a bug or suggest a feature (our forum):
  https://www.theengineeringprojects.com/forum/category/mq-gas-sensors-proteus-library
The demo runs on our Arduino UNO V4.0 (included) - working LEDs, RESET and a
built-in serial monitor, no Virtual Terminal to wire - its own article:
  https://www.theengineeringprojects.com/2026/10/arduino-uno-library-for-proteus-v40.html
The built-in monitor is our TEP Serial Monitor Advance - its own article:
  https://www.theengineeringprojects.com/2026/10/serial-monitor-advance-proteus-library.html
The MQ-2 has its own library (Gas Sensor Library for Proteus V2.0):
  https://www.theengineeringprojects.com/2026/10/gas-sensor-library-for-proteus-v2-0.html
Support us (the libraries are free):
  https://www.theengineeringprojects.com/donate

FILE STRUCTURE
MQ-Gas-TEP-v1.0/
|-- Proteus Library Files/
|   |-- ArduinoV4TEP.LIB                              201.9 KB   TEP Arduino boards V4.0 (UNO), to LIBRARY
|   |-- TEPMQGAS.LIB                                  553.0 KB   the 16 MQ parts, to LIBRARY
|-- Proteus Model Files/
|   |-- TEPARDUINO.DLL                                883.5 KB   the Arduino board model, to MODELS
|   |-- TEPMQGAS.DLL                                  328.5 KB   the MQ model, to MODELS
|-- Proteus Simulation/
|   |-- MQ_Gas_Demo.hex                                38.0 KB   both UNOs (demo sketch V1.0)
|   |-- MQ-Gas-Sensors-ArduinoUnoV4.pdsprj             24.8 KB   demo: 2 UNOs, an MQ-135 and an MQ-7
|   |-- TEPARDUINO.DLL                                883.5 KB   copy of the board model
|   |-- TEPMQGAS.DLL                                  328.5 KB   copy of the model
|-- Arduino Code/
|   |-- MQ_Gas_Demo/MQ_Gas_Demo.ino                     7.6 KB   the demo sketch (source of the .hex)
|-- README.txt                                        ~23.8 KB   this file
Total: 3.20 MB (unzipped). The C++ source code of the model is not included.

WHAT IS IT?
A simulation model of eight MQ gas sensors on the common blue module (an LM393
comparator board with a trimmer, the PWR and DO LEDs and a 4-pin header):
  MQ-3    alcohol - a breathalyser       MQ-7    carbon monoxide (CO)
  MQ-4    methane - natural gas          MQ-8    hydrogen (H2)
  MQ-5    LPG and natural gas            MQ-9    CO and flammable gases
  MQ-6    LPG - butane and propane       MQ-135  air quality - CO2, NH3,
                                                 alcohol
Our own model, not a switch:
  * The sensing resistance Rs follows MQUnifiedsensor's curves (the gas =
    a x (Rs/R0)^b, the a and b of its examples, and its clean-air ratios
    Rs/R0), so a sketch that uses the library reads back the gas you set.
    Each sensor has its own gases (up to six, e.g. the MQ-135: CO2, NH3,
    ALCOHOL, TOLUENE, ACETONE, CO) - an MQ sensor reacts to more than its
    main gas, and the model shows how much. A mixture adds the gases'
    conductances. The MQ-3's curves are in mg/L (its datasheet's unit), the
    others in ppm; the MQ-135's CO2 curve gives the CO2 above the outdoor
    400 ppm (MQUnifiedsensor's example adds 400, and so does the demo).
  * AO = VCC x RL / (Rs + RL): the voltage across the board's load resistor
    RL, 1 kOhm (the 102 on the board) - higher with more gas. In clean air
    every sensor's Rs is 6 kOhm (the model's value): AO 0.71 V, analogRead
    146. R0 = 6 kOhm / the clean-air ratio.
  * The gas reaches the sensor with a delay: 3 s up, 10 s down (a first
    order lag - about 7 s and 23 s to 90 %, inside the datasheets' 10 s /
    30 s); LEAK spreads the gas in (6 s), VENTILATE clears it (4 s).
  * The heater (33 ohm, about 150 mA at 5 V) warms up: at power-on Rs is far
    too low (x 0.06), so AO starts high and DO may go LOW - a false alarm -
    and Rs recovers over WARMUP s (20 by default; a real sensor takes
    minutes, and a new one a burn-in of 24 h or more).
  * DO: the LM393 compares AO with the trimmer's voltage (VCC x POT); DO
    (open collector, 10 kOhm pull-up) goes LOW while AO is above it, and the
    DO LED lights. No hysteresis, like the real board: right at the
    threshold DO can chatter.
  * A small noise on Rs (property NOISE, 1 %).
  * The air on the panel: the gas (one of the sensor's gases), its
    concentration (- / + in steps of 1.25 x, and a log ruler), five presets
    (CLEAN AIR and four levels of the gas), and four actions: LEAK (the gas
    spreads in, up to the third preset), VENTILATE (fresh air), POT - and
    POT + (the trimmer, 5 % a click).
The module is drawn at about three times its real size (32 x 22 mm): the blue
board, the header (VCC, GND, DO, AO), the blue trimmer, the LM393, RL (102)
and the sensor's steel mesh cap; the type is printed on the board. ON the
board, as TEP additions: the SIMPLE / ADVANCE badge and the panel button; the
PWR and DO LEDs are on the real board too. The badge, the button and the
panels are TEP additions.

SIXTEEN DEVICES IN ONE LIBRARY (search "MQ" in Pick Devices):
  Simple    MQ3TEP  MQ4TEP  MQ5TEP  MQ6TEP  MQ7TEP  MQ8TEP  MQ9TEP  MQ135TEP
            "MQ-135 Gas Sensor Module V1.0 - Simple" (and so on)
  Advance   MQ3ADVTEP  MQ4ADVTEP  MQ5ADVTEP  MQ6ADVTEP  MQ7ADVTEP  MQ8ADVTEP
            MQ9ADVTEP  MQ135ADVTEP (the same, "- Advance")
            (pins VCC, GND, DO and AO on the header, on the left; category
            Sensors > Gas)
  Simple    On-Sheet Panel: the STATUS panel under the module - the banner
            (green: clean air or the gas below the threshold; amber: warming
            up; red: GAS ALARM - DO LOW), THE GAS (the sensor's gases), IN
            THE AIR - / + with a log ruler (the presets, the gas in the air,
            the gas at the sensor), five presets, four actions, ten readouts
            (STATE, GAS, AT THE SENSOR, RS, RS / R0, A0, ANALOGREAD, D0,
            THRESHOLD, HEATER) and the last 4 events. The red X closes the
            panel, PANEL: ON / OFF on the board opens it.
  Advance   Pop-Up Panel: only the module on the schematic; at Run a TEP
            pop-up window opens - the look of the TEP Serial Monitor. Tabs
            Sensor, Event log and Tests; gear and ? icons for Settings and
            Help; the palette icon switches the theme:
              Sensor     the presets on the toolbar; THE AIR AROUND THE
                         SENSOR (the gas, - / +, LEAK, VENTILATE, the
                         trimmer, a log bar: in the air and at the sensor);
                         WHAT THE MODULE REPORTS (AO, Rs / R0, what
                         MQUnifiedsensor reads, DO); THE CURVE (Rs / R0
                         against the gas, the clean-air ratio, DO's line and
                         the operating point); AO OVER THE LAST 60 s (with
                         the trimmer's voltage and DO LOW)
              Event log  power, the air, DO, notes, warnings; filters All /
                         The air / DO / Warnings, Pause, Clear
              Tests      Calibration & R0, Gas curves, DO & heater (THE TEST
                         TOOLS)
              Settings   theme, text size, open at Run, window size
              Help       report a bug, suggest a feature, article, updates,
                         donate, forum; Copy diagnostics for a bug report
            The OPEN PANEL button on the board opens the window again.
All sixteen devices use one model, TEPMQGAS.DLL.

TEST STATUS
V1.0: verified in Proteus 8.5 on 17 Oct 2026 (the demo project as shipped:
two Arduino UNO V4.0 boards with their built-in monitors; node 1 with the
Simple MQ-135 (POT 55 %), node 2 with the Advance MQ-7 (POT 70 %, D7 to
GND), clean air at the start). What the runs showed:
  * The warm-up: AO starts high (DO LOW for 0.65 s on the MQ-7 and 3.15 s on
    the MQ-135 - the false alarm) and falls: "warming up: ADC 623 - 17 s
    left" ... "warming up: ADC 149 - 1 s left". Then "R0 = 1.663 kOhm (Rs in
    clean air / 3.6)" (MQ-135) and "R0 = 0.218 kOhm (Rs in clean air /
    27.5)" (MQ-7); clean air reads "CO2 403 ppm" and "CO 1 ppm" at
    analogRead 146 - 147.
  * U2's pop-up and monitor (MQ-7): CO 50 ppm - the reading climbs 17, 27,
    33 ppm, DO LOW from "CO 38 ppm", then "#18  ADC 761  AO 3.72 V  Rs/R0
    1.576  CO 50 ppm"; VENTILATE - down to 3 ppm, DO HIGH again; H2 50 ppm -
    read as CO: "CO 68 ppm" (the MQ-7 reacts more to H2), then GAS H2 - "H2
    50 ppm"; the three tools and the Event log.
  * U1 with the real mouse (MQ-135): CO2 1000 ppm - up to 989 ppm; LEAK
    (2000 ppm) - DO LOW above the trimmer's 2.75 V, up to "CO2 1923 ppm  DO
    LOW - gas alarm"; VENTILATE - back down towards 400 ppm; NH3 50 ppm -
    read as "CO2 447 ppm", then GAS NH3 - "NH3 50 ppm"; STATUS; U1's red X
    and PANEL.
  * 158.5 s of simulation took 284 s - about 0.56 x real time with the
    pop-up and both monitors open.
  Plus automatic checks on a PC, 0 failed: 351 on the model (every sensor's
  gases read back through MQUnifiedsensor's own arithmetic, the lag, the
  warm-up, DO and its threshold, a mixture, the noise, the supply) and 6 on
  the pop-up; the demo project read back from disk (72 checks: devices,
  pins, wires, labels; no wire through a part, no wire crossing).

INSTALLATION (about 2 minutes)
1. Close Proteus. Extract the WHOLE ZIP to a normal folder (e.g. Desktop).
2. Copy everything in "Proteus Library Files" (TEPMQGAS.LIB with the sixteen
   parts, and our Arduino library V4.0, ArduinoV4TEP.LIB, with the ARDUINO
   UNO V4.0 used by the demo) to the LIBRARY folder of Proteus, for example:
     C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY
   (on some PCs: C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\
   LIBRARY - use the folder that already holds Proteus's own .LIB files).
3. Copy TEPMQGAS.DLL and TEPARDUINO.DLL from "Proteus Model Files" to the
   MODELS folder (...\Proteus 8 Professional\MODELS).
   ArduinoV4TEP.LIB and TEPARDUINO.DLL are the files of our Arduino Library
   V4.0 - if you have it, they are the same.
4. Delete TEPMQGAS.IDX from the LIBRARY folder if it is there (Proteus makes
   a new index).
5. Start Proteus. In Pick Devices (P) search "MQ" (or "MQ135", "MQ7" ...).

RUN THE DEMO
"Proteus Simulation\MQ-Gas-Sensors-ArduinoUnoV4.pdsprj" - keep the .hex file
and the two DLLs beside the project.
  ARD1: Arduino UNO V4.0 + U1 = an MQ-135 (Simple), clean air, POT 55 %
        (DO LOW above about 1250 ppm CO2); D7 open.
  ARD2: Arduino UNO V4.0 + U2 = an MQ-7 (Advance), clean air, POT 70 % (DO
        LOW above about 35 ppm CO); D7 to GND.
  Both UNOs run MQ_Gas_Demo.hex (MQUnifiedsensor) and each has its serial
  monitor built in ("TEP Arduino UNO - ARD1" / "- ARD2").
  1. Press Run. Both UNOs' monitor windows open (9600 baud) and so does the
     pop-up of U2 (move it aside - it opens over the schematic).
  2. The heaters warm up for 20 s: AO starts high (DO LOW - a false alarm)
     and falls; the sketch prints "warming up" every 2 s, then calibrates R0
     in clean air and prints a reading every second.
  3. Set a gas on U1's STATUS panel or in U2's pop-up (the presets, - / +):
     the reading follows within seconds. LEAK spreads the gas in; VENTILATE
     clears it; above the trimmer's threshold DO goes LOW.
  4. Choose another gas (e.g. H2 on the MQ-7): the sketch still reads it as
     CO - type GAS H2 to use the H2 curve.
  5. U1: close its panel with the red X, open it with PANEL on the board.
     U2 (Advance): Sensor, Event log, and Tests - Calibration & R0, Gas
     curves, DO & heater.
Closed a monitor window? Click the UNO's USB port.

WIRING (the same in Proteus and on a real board)
  Module   Arduino UNO
  VCC      5V   (the heater: about 150 mA)
  GND      GND
  DO       D2   (LOW = gas above the trimmer's threshold)
  AO       A0   (analog: higher with more gas)
  The demo reads D7: open = the MQ-135, to GND = the MQ-7 (TYPE changes it).
In the sketch (MQUnifiedsensor):
  MQUnifiedsensor MQ("Arduino UNO", 5, 10, A0, "MQ");
  MQ.setRegressionMethod(1); MQ.setA(110.47); MQ.setB(-2.862);  // CO2
  MQ.setRL(1); MQ.init();                 // the board's RL: 1 kOhm
  // after the warm-up, in clean air: R0 = the average of MQ.calibrate(3.6)
  MQ.update(); float ppm = MQ.readSensor() + 400;   // CO2 with the 400
The serial monitor needs no wires: it is built into the Arduino UNO V4.0.
AO and DO reach their UNO through net labels - AO_1 / DO_1 (node 1), AO_2 /
DO_2 (node 2): the same name = connected. VCC and GND are Proteus power
terminals; ARD2's D7 goes to a GND terminal.
REAL HARDWARE:
 * The heater draws about 150 mA and gets hot: power the module from a
   supply that can give it (not from a data pin), and let it warm up before
   you trust a reading - a new sensor needs a burn-in of 24 h or more.
 * Calibrate R0 in clean air, for each sensor - R0 differs from sensor to
   sensor. Temperature and humidity change Rs too (not modelled).
 * The MQ-7 and the MQ-9 measure CO properly with a cycling heater (MQ-7:
   60 s at 5 V, 90 s at 1.4 V); the common module runs the heater at 5 V
   all the time, and so does the model.
 * DO's threshold is the trimmer: turn it until DO just stays HIGH in clean
   air, then test with the gas.
 * These are not safety devices: a real CO or gas alarm needs a certified
   detector.

THE TEST TOOLS (Advance, Tests tab) - what they really measure
Every tool reads the model during the running simulation; each shows one
"Good for:" line and, where it judges, a verdict per row (green = fine, amber
= check, red = wrong).
  Calibration & R0
                Good for: readings far too high or too low, a reading that
                drifts after power-on, an R0 that changes every run. The
                sensor and RL, R0 = Rs in clean air / the clean-air ratio,
                the warm-up (how wrong an R0 calibrated now would be), what
                MQUnifiedsensor computes from analogRead now (with setRL(1)
                and with its default 10), and whether to calibrate now.
  Gas curves    Good for: choosing a sensor, a reading that reacts to the
                wrong gas, the a / b values for a sketch. Every gas of the
                sensor: a, b, what clean air reads as, and Rs / R0 at three
                of its presets.
  DO & heater   Good for: DO that never changes or always LOW, a false alarm
                after power-on, a weak supply. VCC, the heater's current and
                power, the warm-up, the trimmer, the threshold in the gas's
                units, DO and its changes.

THE DEMO SKETCH ON THE SERIAL MONITOR (MQ_Gas_Demo V1.0)
  GAS <name>   the gas whose curve the sketch uses, e.g. GAS H2
  TYPE <MQ-x>  the sensor, e.g. TYPE MQ-3 (R0 again: in clean air!)
  CAL          calibrate R0 now (in clean air)
  STATUS       the sensor, the gas with a and b, R0, RL, warm or not
  HELP         the command list
Commands are not case-sensitive; type them in the UNO's built-in monitor and
press Enter. Once a second the sketch prints a reading by itself.

EXPECTED MONITOR OUTPUT (the start)
ARD1 (the MQ-135, D7 open):
  TEP MQ gas sensor - demo (MQUnifiedsensor)
  MQ-135: AO on A0, DO on D2 - the heater warms up for 20 s
  Commands: GAS <name> | TYPE <MQ-x> | CAL | STATUS | HELP
  warming up: ADC 623 - 17 s left
  warming up: ADC 502 - 15 s left
  ...
  warming up: ADC 149 - 1 s left
  warm - calibrating R0 in clean air ...
  R0 = 1.663 kOhm (Rs in clean air / 3.6)
  #1  ADC 147  AO 0.72 V  Rs/R0 3.584  CO2 403 ppm  DO HIGH
ARD2 (the MQ-7, D7 to GND) prints "MQ-7: ..." and, after its warm-up,
  R0 = 0.218 kOhm (Rs in clean air / 27.5)
  #1  ADC 146  AO 0.71 V  Rs/R0 27.500  CO 1 ppm  DO HIGH
The last digits move a little: the sensor's noise (property NOISE).

PROPERTIES (double-click the part > Edit Properties)
  GAS          the gas at the start (one of the sensor's gases; default its
               main gas)
  CONC         its concentration at the start (ppm, mg/L for the MQ-3; 0 =
               clean air)
  POT          the trimmer at the start (%, 0 - 100): DO LOW above VCC x POT
  WARMUP       the heater's warm-up in s (default 20; 0 = already warm)
  NOISE        the noise on Rs in % (default 1; 0 = none)
  PANEL        Simple only: the STATUS panel at the start, OPEN or CLOSED
Every run starts again from the properties, and the module from power-on.
The demo's UNOs (ARDUINO UNO V4.0): PROGRAM MQ_Gas_Demo.hex, MONITOR YES (the
built-in monitor), BAUD 9600, AUTOOPEN YES, BOOTLOADER YES.

LINKS.INI (OPTIONAL)
The Help page cards of the Advance devices open web pages. To point them
somewhere else without a new DLL, put a text file named links.ini next to
TEPMQGAS.DLL with lines KEY=URL, for example:
  ARTICLE=https://www.theengineeringprojects.com/...
Keys: WEBSITE, FORUM, BUG_REPORT, FEATURE_REQUEST, ARTICLE, USER_GUIDE,
UPDATE_CHECK, DONATE. Only http:// and https:// links are used; lines starting
with # are comments.

TROUBLESHOOTING
* The reading is far too high right after Run: the warm-up - wait, then
  calibrate (the demo waits 20 s).
* Every reading is too high (or too low): R0 was calibrated with gas in the
  air (or during the warm-up) - type CAL in clean air.
* The reading reacts to the wrong gas: an MQ sensor sees more than its main
  gas - the Gas curves tool shows how much; choose the gas with GAS <name>.
* DO is LOW all the time: the trimmer is too low (POT +), or the module is
  still warming up. DO never goes LOW: POT too high, or no gas.
* DO flickers: AO is right at the threshold (no hysteresis on the board).
* The parts are not simulated: TEPMQGAS.DLL is missing from MODELS and from
  the project folder. No UNO / no monitor window: TEPARDUINO.DLL is missing,
  or click the UNO's USB port.
* Advance: the pop-up does not appear - click OPEN PANEL on the board, or
  turn "Open the panel at Run" on its Settings page back on.

BUG REPORTS AND FEATURE REQUESTS
Please post them in our forum with a screenshot, the Serial Monitor text, the
simulation log and (Advance) the Copy diagnostics text:
  https://www.theengineeringprojects.com/forum/category/mq-gas-sensors-proteus-library

SUPPORT US
This library is free. If it saves you time, please support our work:
  https://www.theengineeringprojects.com/donate

WEBSITE
  https://www.theengineeringprojects.com/

LICENCES AND THIRD-PARTY NOTES
* The MQ model (TEPMQGAS.DLL), the symbols and artwork and the Arduino
  Library V4.0 (ArduinoV4TEP.LIB / TEPARDUINO.DLL, with its built-in TEP
  Serial Monitor Advance) are made by The Engineering Projects. The model's
  gas curves are MQUnifiedsensor's (see below); the rest is our own.
  The model uses only standard Windows libraries; no Visual C++
  redistributable is needed.
  The C++ source code is not included.
* Arduino UNO V4.0 (ArduinoV4TEP.LIB / TEPARDUINO.DLL, our Arduino Library
  V4.0 - its microcontroller is Proteus's own AVR model): The Engineering
  Projects, https://www.theengineeringprojects.com/2026/10/arduino-uno-library-for-proteus-v40.html
* The demo sketch uses MQUnifiedsensor 3.0.0 (MQSensorsLib) by Miguel Califa,
  MIT License - it is not included: install it from the Arduino Library
  Manager ("MQUnifiedsensor") or https://github.com/miguel5612/MQSensorsLib
  The .hex file contains it, and the model uses its examples' a / b values
  and clean-air ratios; its licence:
    MIT License
    Copyright (c) 2019 Miguel Angel Califa Urquiza
    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the
    "Software"), to deal in the Software without restriction, including
    without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:
    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
    OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
    THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* The .hex file is built from the demo sketch, MQUnifiedsensor and the
  Arduino AVR core 1.8.6, which includes LGPL-licensed code; its source code
  is available at
  https://github.com/arduino/ArduinoCore-avr/tree/1.8.6
  The demo sketch's source is in "Arduino Code", so the .hex can be rebuilt
  with other versions of the core (REBUILDING THE FIRMWARE).
* Proteus is a product of Labcenter Electronics and is not included. Arduino is
  a trademark of Arduino SA. This library is not made or endorsed by the
  makers of the MQ sensors (Hanwei and others) or by Labcenter.

REBUILDING THE FIRMWARE (OPTIONAL)
The HEX file is supplied; Arduino IDE is not needed to run the demo. To edit the
sketch, install MQUnifiedsensor (Library Manager), open
Arduino Code\MQ_Gas_Demo\MQ_Gas_Demo.ino in the Arduino IDE, select Arduino
Uno and use Sketch > Export Compiled Binary. Replace the simulation's .hex
with the exported HEX.
The sketch needs 13,836 bytes of flash and 620 bytes of RAM.

MODEL SCOPE AND LIMITS
Modelled: eight sensors with MQUnifiedsensor's curves and clean-air ratios,
up to six gases each and their mixture, the lag up and down, the heater's
warm-up, AO through the board's 1 kOhm RL, DO from the LM393 and the
trimmer, the noise, power on / off.
How the part works with the circuit: VCC and GND feed the heater (33 ohm);
Rs sits between VCC and AO, RL between AO and GND; DO has a 10 kOhm pull-up
to VCC and a 50 ohm switch to GND while the gas is above the threshold.
Not modelled: temperature and humidity, the long burn-in of a new sensor,
the MQ-7 / MQ-9 heater cycling, the heater's own warm-up current, ageing and
poisoning, the spread of R0 between real sensors, the sensors' own response
shapes (the model uses one first-order lag for all). The clean-air Rs of
6 kOhm, the warm-up's x 0.06, the lag times and the noise are the model's
values; the curves are MQUnifiedsensor's.

VERSION
TEP MQ gas sensor library V1.0 (Oct 2026). Devices MQ3TEP / MQ3ADVTEP to
MQ135TEP / MQ135ADVTEP (TEPMQGAS.LIB / TEPMQGAS.DLL). Demo sketch MQ_Gas_Demo
V1.0 (MQUnifiedsensor). Demo board: ARDUINO UNO V4.0 (TEP Arduino Library
V4.0) with its built-in serial monitor.
Advertisement

Development1 release

  1. V1.0MQ Gas Sensor Library for Proteus V1.0this page

    V1.0 is the only release in the Download Center so far. When a newer version is published, it appears above with its own download page.

Installation8 steps

From the download to a working project, in order. The steps follow what the package contains.

You will need

  • Proteus Design SuiteProteus 8 or newer (Labcenter), on Windows
  • Arduino IDE1.8 or 2.x, with the board of the tutorial chosen under Tools → Board
  • Any archive toolWindows, macOS and Linux extract ZIP files on their own

Steps

  1. 1

    Extract the archive

    Right-click mq-gas-tep-v1-0-6828f35009ae418e903f2575ce430eb1.zip and choose Extract All (or open it with 7-Zip or WinRAR) into a folder you can find again. Keep its folder structure (MQ-Gas-TEP-v1.0) as it is.

  2. 2

    Copy the library files into Proteus

    Move ArduinoV4TEP.LIB and TEPMQGAS.LIB and the files into the LIBRARY folder of your Proteus installation: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY for Proteus 8, or the matching Proteus 7 folder. Older versions keep it under ProgramData\Labcenter Electronics. If Proteus is open, close it first.

  3. 3

    Add the simulation model

    Copy TEPARDUINO.DLL and TEPMQGAS.DLL into the MODELS folder next to LIBRARY, so the component can run, not only be drawn.

  4. 4

    Restart Proteus and place the component

    Start Proteus, open a schematic, press P (Pick Devices) and search for the component by the name used in the tutorial. It appears with its pins ready to wire.

  5. 5

    Open the sketch in the Arduino IDE

    Open MQ_Gas_Demo.ino, select your board and port under Tools, then Verify. Sketch → Export Compiled Binary writes the HEX file a simulation needs.

  6. 6

    Load the HEX file

    In Proteus double-click the microcontroller, set Program File to MQ_Gas_Demo.hex and run the simulation. For real hardware, flash the same file with your programmer.

  7. 7

    Open the example simulation

    Open MQ-Gas-Sensors-ArduinoUnoV4.pdsprj in Proteus to see the wiring exactly as in the tutorial. Check the controller's Program File path, then press Play.

  8. 8

    Follow the tutorial

    MQ Gas Sensor Library for Proteus V1.0: MQ-3, MQ-7, MQ-135 and More explains every connection and setting in order; keep it open beside the files while you build.

How to add a library in Proteus 8

FAQs9 questionsContact TEP

How do I download MQ Gas Sensor Library for Proteus V1.0?

Wait for the 30-second guest countdown on this page, then press the download button; the file comes straight from our storage. Members who are logged in skip the wait. If the browser opens the file instead of saving it, use its Save as option. The download link is made for you when the countdown ends and works for 15 minutes; a saved or shared link stops working, so share this page instead.

What is inside the archive?

MQ Gas Sensor Library for Proteus V1.0 comes as a ZIP archive of 10 files (1.2 MB, 3.2 MB unpacked) holding Proteus library files, simulation model DLLs, a Proteus simulation, an Arduino sketch and compiled HEX firmware. Open the File Structure tab for the full list of 10 files.

What should I do if the download does not start?

Check the browser's download list first; an ad blocker or a company firewall can also hold it back, so try another browser or network. If the file arrives incomplete, download it again. For an installation problem, read the Install tab or tell us in the comments with your software version and the exact error message.

Is this file free?

Yes. Every file in the TEP Download Center is free for learning, personal and student projects. If you share it, link back to this page or the tutorial so others find the latest version.

How do I check that the file arrived complete?

Compare its SHA-256 with the one on this page, 1c57579a5dfc2a8760536bdd2d3cb30c9f01b892f7a5c492012088946927731d. In PowerShell run Get-FileHash "mq-gas-tep-v1-0-6828f35009ae418e903f2575ce430eb1.zip"; on macOS or Linux run shasum -a 256 "mq-gas-tep-v1-0-6828f35009ae418e903f2575ce430eb1.zip". The same value means the file is exactly the one in our storage; a different one means the download broke off, so download it again.

Do I need WinRAR to open the ZIP file?

No. Windows, macOS and Linux open ZIP archives on their own (Extract All, or double-click). WinRAR and 7-Zip work too. Extract the whole archive before using the files.

Where do I put the LIB and IDX files?

Both files go into the LIBRARY folder of your Proteus installation (Proteus 8: C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\LIBRARY; Proteus 7 has the same folder under its own name). Restart Proteus afterwards and search for the component with P.

Which Proteus version does the library need?

The tutorial names the Proteus version the library was made and tested with. Most TEP libraries work in Proteus 7 and Proteus 8; if the component does not appear after a restart, check that both the LIB and the IDX file were copied and that Proteus was fully closed while copying.

How do I get the HEX file into the simulation?

Compile the sketch in the Arduino IDE (Sketch → Export Compiled Binary gives you the HEX next to the sketch), then in Proteus double-click the board, set Program File to that HEX and run.

preparing · mq-gas-tep-v1-0-6828f35009ae418e903f2575ce430eb1.zip
Rating
Your download will be ready shortly
Preparing your download…

Members skip the wait. Log in or join TEP.

  • 62Total downloads
  • 4%Popularity
  • ProteusCategory
  • 0Comments
  • ssyedzainnasirUploaded by
  • 16 Oct 2026Uploaded at
Last 14 days32 downloads
SHA-256 1c57579a5dfc2a8760536bdd2d3cb30c9f01b892f7a5c492012088946927731d
DocumentationMQ Gas Sensor Library for Proteus V1.0: MQ-3, MQ-7, MQ-135 and More
Need help with this file? Bug report Ask a question Download problemsGet updates
Advertisement

Comments

0

Join the conversation

Start the conversationAsk a question or share how you used this download.