0% found this document useful (0 votes)
13 views7 pages

ActivityCard5 GasSensor

Uploaded by

sarikhahegde
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)
13 views7 pages

ActivityCard5 GasSensor

Uploaded by

sarikhahegde
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/ 7

ACTIVITY CARD - 5

MQ GAS SENSOR

Introduction
MQ gas sensors are a family of sensors which are used to detect a wide variety of gases
like alcohol, smoke, methane, LPG, hydrogen, NH3, Benzene, Propane etc. These sensors
are made up of electrode which is coated with a sensing material, and it is heated to
make it more reactive and sensitive. When the gas reacts with these electrodes, its
resistance changes, more the gas, less is the resistance and vice-versa.

Low Resistance

Glass Reference
Electrode Electrode

Gas
container
Here is a list of the different sensors that we have provided and the gases they
detect:

Sensor Gases detected


MQ 3 Alcohol
MQ 7 CO
MQ 4 Methane, Natural Gas
MQ135 Air Quality Control
MQ6 LPG, Propane
MQ 8 Hydrogen
MQ 2 General combustible gas
MQ 5 LPG, Natural gas, Coal gas

Objective:
During this activity, you will help students to achieve following objectives:
• Understanding principle and operations of MQ Gas sensor.
• Design algorithm and flowchart to sense moisture of soil using MQ Gas sensor.
• Programming MQ Gas sensor using Arduino API for Intel Genuino.
• Interfacing MQ Gas sensor with Intel Genuino using analog pin A0.
Algorithm
Step 1 Assign analog pin A0 to MQ GAS Sensor

Step 2 Define and initialize Setup Function for GAS sensor

Step 3 Read GAS Sensor Value

Step 4 If GAS sensor value is Greater than Threshold value than Print High

Step 5 If GAS sensor value is Less than Threshold value than Print Low
Flowchart
Programming
int input =
A0; int
output = 7;
int thr=500; // Set threshold level. void
setup()
{

Serial.begin(9600);
pinMode(output,OUTPUT);
digitalWrite(output,LOW);

void
loop()

{ Serial.println(analogRead(input if(analogRead(input)>th
)); r)
{

digitalWrite(output,HIGH
);

else

digitalWrite(output,LOW delay(500
); );
}

}
Hardware

Instructions:
• Connect GND pin of Gas sensor to GND on the Genuino board
• Connect Out pin of Gas Moisture sensor to A0 on the Genuino board
• Connect VCC pin of Gas Moisture sensor to 5V on the Genuino board
• Connect power supply to the Genuino and USB to USB Client Port on the Genuino
• Open Arduino IDE under Tools → Board select Intel® Genuino
• Under Tools → Serial Port select the Com # where the Genuino is connected to
• Write the above code on Arduino IDE
• Upload to the Genuino by clicking the upload button
• Monitor the value of the gas sensor in the Serial Monitor

Hardware Connection
Genuino pin MQ Gas Sensor Pin

5V VCC

GND GND

Analog pin 0 Signal


Circuit Diagram:

You might also like