0% found this document useful (0 votes)
30 views4 pages

Alevel Iot 13april20 SM

The document discusses the MQ-135 gas sensor, including how it works, its pin configuration, specifications, and interfacing with an Arduino. The MQ-135 gas sensor detects gases by ionizing them and changing its resistance when they come into contact with its sensing element. It has analog and digital output pins and detects gases like NH3, NOx, alcohol, and benzene. The document provides code to read the sensor's analog and digital values using an Arduino and light an LED based on gas detection.

Uploaded by

rmangle50
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

Alevel Iot 13april20 SM

The document discusses the MQ-135 gas sensor, including how it works, its pin configuration, specifications, and interfacing with an Arduino. The MQ-135 gas sensor detects gases by ionizing them and changing its resistance when they come into contact with its sensing element. It has analog and digital output pins and detects gases like NH3, NOx, alcohol, and benzene. The document provides code to read the sensor's analog and digital values using an Arduino and light an LED based on gas detection.

Uploaded by

rmangle50
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

NIELIT, Gorakhpur

Course Name: A-level (1st Sem.) Subject:IoT


Topic: MQ135 interfacing with Arduino Date: 13.04.2020

In today’s world, we encounter different scenario where we see different gasses being emitted in
atmosphere such as home appliances like air conditioner and industrial chimneys. Monitoring of
these gasses is very important with safety point of view. Gas Sensors are very helpful in
accomplishing this task. Small nose like sensor spontaneously respond to the alteration of gas
concentration and keep our systems updated for special tasks.

What is MQ-135 gas sensor and how does it work?


The gas sensor module consists of a steel exoskeleton under which a sensing element is housed.
This sensing element is subjected to current through connecting leads. This current is known as
heating current through it, the gases coming close to the sensing element get ionized and are
absorbed by the sensing element. This changes the resistance of the sensing element which
alters the value of the current going out of it.

.
Pin Configuration MQ-135 gas sensor
From left to right first pins are as follows:
A0 Analog output
D0 Digital output
GND Ground
Vcc Supply (5V)

Specifications of MQ-135 gas sensor


• Wide detecting scope
• Fast response and High sensitivity
• Stable and long-life Simple drive circuit
• Used in air quality control equipment for buildings/offices, is suitable for detecting
of NH3, NOx, alcohol, Benzene, smoke, CO2, etc.
• Size: 35mm x 22mm x 23mm (length x width x height)
• Working voltage: DC 5 V
• Signal output instruction.
• Dual signal output (analog output, and high/low digital output)
• 0 ~ 4.2V analog output voltage, the higher the concentration the higher the voltage.

interfacing of MQ-135 gas sensor with Arduino

When no gas digital output is 1 and analog output gives 1023 max value. When gas is present
digital output is 0 and analogue output is much less than 1023. Using potentiometer on chip we can
control the turning OFF point of digital pin at some value of analog pin. The sensor needs a load-
resistor at the output to ground. Its value could be from 2kOhm to 47kOhm. The lower the value,
the less sensitive is the sensor. The higher the value, the less accurate is sensor for higher
concentrations of gas. If only one specific gas is measured, the load-resistor can be calibrated by
applying a known concentration of that gas. If the sensor is used to measure any gas (like in a air
quality detector) the load-resistor could be set for a value of about 1V output with clean air.
Choosing a good value for the load-resistor is only valid after the burn-in time

NOTE: Don’t touch the sensor, it will be very hot.


Testing the Circuit:
1. After hardware connection, insert the sample sketch into the Arduino IDE.
2. Using a USB cable, connect the ports from the Arduino to the computer.
3. Upload the program.
4. See the results in the serial monitor.

Code for interfacing of MQ-135 gas sensor with Arduino


int sensorValue;
int digitalValue;
void setup()
{

Serial.begin(9600); // sets the serial port to 9600


pinMode(13, OUTPUT);
pinMode( 3, INPUT);

void loop()

sensorValue = analogRead(0); // read analog input pin 0

digitalValue = digitalRead(2);
if(sensorValue>400)
{
digitalWrite(13, HIGH);
}
else
digitalWrite(13, LOW);
Serial.println(sensorValue, DEC); // prints the value read
Serial.println(digitalValue, DEC);

delay(1000); // wait 100ms for next reading

}
Result:
On serial monitor you can see values of analog pin being detected. Currently in my case they are
around about 150 which indicate normal air.
• Normal air returns approximately 100-150
• Alcohol returns approximately 700
• Lighter gas returns approximately 750

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy