Alevel Iot 13april20 SM
Alevel Iot 13april20 SM
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.
.
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)
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
void loop()
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);
}
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