• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos | Circuits for Beginners | Basic Circuits | Hobby Projects | Transistor Circuits | LED Drivers 

You are here: Home / Electronics Tutorial / How to Wire a MQ-135 Gas Sensor Module Correctly

How to Wire a MQ-135 Gas Sensor Module Correctly

Last Updated on February 26, 2022 by Swagatam Leave a Comment

caution electricity can be dangerous

MQ-135 is a gas sensor designed to sense or detect gaseous substance and generate a corresponding positive output voltage.

In this post we will learn how to connect or wire the pinouts of an MQ-135 module with a relay driver stage correctly.

The MQ-135 module is an enhanced or upgraded package of the basic MQ-6 gas sensor module. In this module the analogue output from the MQ-6 is converted into a digital output, with an adjustable sensitivity feature.

The conversion of the analogue to digital is done through a comparator IC, usually an LM393.

How The MQ-135 Module Works

As described above the MQ-135 works by converting the analogue signals from the sensor unit into digital output through a comparator.

The module basically features 4 pinouts.

  1. Vcc
  2. Ground
  3. Digital Out
  4. Analogue Out

Sensor side View

Component Side View

The analogue out is directly taken from the MQ-6 sensor pin.

The Vcc works with a +5V DC supply, ground is the negative or the 0V terminal of the module.

The digital output is derived from the output of a differential comparator using the IC LM393.

How to Configure MQ-135 Correctly

Recently I purchased the MQ-135 module and while testing it I was surprised to see my external relay driver not responding at all. However, since the module's in-built LED was illuminating, I knew the module was OK.

I assumed and expected the output to produce a positive digital signal for every input detection. However, I simply couldn't get this working.

Then I realized that the IC LM393 has an open collector output, meaning its output pin was associated with an open collector of an internal NPN BJT.

And since my external relay driver NPN BJT was unresponsive meant that the module did not have a pull up resistor with the LM393 output.

I quickly configured a pull-up resistor with the comparator output pin and tried again. The relay now responded but with an opposite effect.

Meaning, now the relay remained switched ON when powered, and switched OFF as soon as the sensor detected gas. This was very undesirable, and was due a wrongly configured module.

It seemed the manufacturer missed the fact that the LM393 is not an op amp, and its input pins needs to be wired in a way opposite to an op amp input wiring. In other words (+) input pin should have been wired with the reference preset and the (-) input with the sensor analogue input.

Anyway, since it was not possible to modify the module PCB and the ICs input configuration, I ultimately decided to change the NPN relay driver with a PNP transistor driver. And this solved the issue.

Wiring Diagram

Here's the complete wiring diagram of MQ-135 for all the new hobbyists, who may otherwise find it impossible to drive a relay using NPN transistor, for a positive detection. May be, for the future productions this issue will be addressed by the manufacturer and corrected.

Smoke, Gas sensor alarm circuit

Video Demo

You'll also like:

  • 1.  How to Connect a Relay through an Opto-Coupler
  • 2.  Transistor Monostable Circuits with Applications
  • 3.  How to Make Dog Barking Preventer Circuit using High Frequency Deterance
  • 4.  Learning Basic Arduino Programming – Tutorial for the Newcomers
  • 5.  2 Simple RF Detector Circuits Explored
  • 6.  Transcutaneous Nerve Stimulator Circuit

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments

Primary Sidebar

Calculators

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (114)
  • Battery Chargers (82)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (100)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (116)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (102)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (65)
  • Mini Projects (148)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (77)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (61)
  • Sensors and Detectors (120)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations

wpDiscuz