Gas Sensor Getting Started

GAS Sensor Getting Started.

This article describes how to use Gas Sensor, which consists of MG-811 Carbon Dioxide CO2 Sensor, MQ-2 Flammable Gas & Smoke Sensor, MQ-6 LPG Sensor, MQ-7 Cabon monoxide Sensor, MQ-135 Air Quality Sensor which is GAS. Sensor to ThaiEasyElec confused with the many sales and use significantly.

To understand the PIN before.

Many users are often confused as to the need to continue to work on the leg GAS Sensor Datasheet however, because of Hanwei also very detailed. Ask the user to see the image below three pictures, pin H is in the middle of the coast between the two, pin A to pin B to see it in any of the three pictures See pictures below for the discerning.

MG-811 - Carbon Dioxide CO2 Sensor. 

MG-811 Sensor is a sensor CO2 gas in the air will come out as the Output Voltage (EMF) by EMF voltage is inversely proportional to the amount of CO2 that reacts with the Sensor. 

Voltage EMF measured by experiment (experiment ThaiEasyElec) is the voltage in the mV and the least we can do it in tens of millivolts, the pressure is set too low. put into processing with MCU with ADC 10 Bit resolution is 4.8 mV to 5V reference voltage must be extended to allow MCU voltage can be measured. Because they can not know the exact value of the Maximum of the Sensor can therefore estimate the Maximum Output is about 300 mV and the cycle none inverting amp amplifier Output the clock to 11 times, so the Output 300mV to pressure the past. extending to approximately 3.3V.

 
(Click on image to enlarge).

When the input voltage to the H or I should wait for the helical coil heat before it can be measured.

Sample Code.

int adcPin = 0; 
int adcValue = 0; 
float v; 
float real_v; 
void setup (). 
{. 
Serial.begin (9600); 
delay (2000); 
}. 
void loop (). 
{. 
adcValue = analogRead (adcPin); 
Serial.print ("Out put ="); 
Serial.println (adcValue); 
delay (1000); 
}.

Results. 
Be found that can read the Analog Out ​​put of the MG-811, which is a value that is not stationary. Change in the constant up and down all the time, and when the breath into the MG-811 Analog Out ​​put signal is found to be reduced by the amount of CO2 captured. It enables us to detect trends. The amount of CO2 gas can. 

How to Calibrate MG-811. 
Output voltage can be correlated to the amount of MG-811 CO2 gas from Nernst's Equation.

EC = EMF + (RxT) / (2F) x ln [P (CO2)]. 
EC = the potential difference is measured between the indicator and reference electrodes (Eind - Eref) (mV). 
EMF = constant potential difference is proportional to the Temp (Output from MQ811). 
R = Gas Constant is equal to 8.3144 J / K. 
T = absolute temperature (K). 
F = Faraday's constant (Faraday's constant = 96485 Faraday). 

Therefore 
EMF = Ec - (R x T) / (2F) ln (P (CO2)). 
EMF = EC-(((º C + 273.15) x 8.3144) / (2 x (9,649 x10 ^ 4))) x ln (quantity of CO2). 

MQ-2 - Flammable Gas & Smoke Sensor.

MQ-2 as Sensor checks the amount of flammable gas and smoke, such as LPG, i-butane, propane, methane, alcohol, Hydrogen, smoke in the air, which is when we started supplying power to the MQ-2 pin H heat up. spire On various flammable gas.To react to. The resistance between the legs A and B (RS) decreased.

(Click on image to enlarge).

From power on to the H pin will cause heat to chemical energy in the Sensor can react with various flammable gases and flammable gas detector MQ-2 on variousCan make the resistance between pin A and pin B changes (Input A and B are the legs that are not fixed can be customized by your leg is the leg A leg on the opposite side, it would be legged B) When the MQ. -2 detect various toxic gases. RS will have much lower resistance or impedance inversely proportional to the amount ofVarious flammable gas. 

How to find the value of the resistance RS.

To determine the resistance of the RS can be done two ways.

How can one measure the resistance using Ohm meter to pin A and B directly below.

(Click on image to enlarge).

Method 2 is an indirect way to measure the voltage division rule Voltage Divider.

(Click on image to enlarge).

From the green bar. We can see that the power pin into the A or B on the left, which when taken into a new arrangement with our familiar. Pressure is split into the picture as a rule.

(Click on image to enlarge).

The RS values ​​using voltage division rule is applied to. Microcontroller has introduced the Out put of the ADC input pin of the Microcontroller. (The input voltage pin ADC of the MCU must ensure that the voltage input is beyond the Port ADC of the MCU to receive it) and see that the voltage measured will be greater when RS decreases. 

Examples of use for MQ-2 Arduino.

Sample Code.

int adcPin = 0; 
int adcValue = 0; 
float v; 
float rs, ppm; 
void setup (). 
{. 
Serial.begin (9600); 
delay (2000); 
}. 
void loop (). 
{. 
adcValue = analogRead (adcPin); 
v = adcValue * (5.00/1024); 
rs = (100 - (20.00 * v)) / v; 
Serial.print ("Volt out put"); 
Serial.println (v); 
Serial.print ("RS ="); 
Serial.println (rs); 
delay (1000); 
}.

MQ-6 - LPG Sensor.

MQ-6 LPG gas sensor Sensor is in the air, which is when we started supplying power to the MQ-6 H leg heat up the coils on LPG gas into the reaction. The resistance between the legs A and B (RS), which reduced the Data Sheet of the MQ-6 indicated that Resistance RS 10-60 K, the value of the gas to LPG 10,0000 - 200 ppm.

(Click on image to enlarge).

From when power to pin H will cause heat to chemicals within the Sensor can react with gas, LPG, and on MQ-6 detector LPG will cause the resistance between pin A and pin B changes. (Input A and B are legs are not fixed, we can customize by selecting any pins to pin A pin on the opposite side, it would be legged B) When the MQ-6 detection, the LPG has a lot to reduce the resistance. RS or decrease the resistance is inversely proportional to the amount of gas, LPG.

How to find the value of the resistance RS.

To determine the resistance of the RS can be done two ways.

How can one measure the resistance using Ohm meter to pin A and B directly below.

(Click on image to enlarge).

Method 2 is an indirect way to measure the voltage division rule Voltage Divider.

(Click on image to enlarge).


From the green bar. We can see that the power pin into the A or B on the left, which led to a new service we are familiar with. Pressure is split into the picture as a rule.

(Click on image to enlarge).

The RS values ​​using voltage division rule is applied to. Microcontroller has introduced the Out put of the ADC input pin of the Microcontroller. (ADC input voltage pin of the MCU must ensure that the input voltage does not exceed the Port ADC of the MCU to get it) and solve to find the value of RS out and compared to the amount of LPG.

Example MQ-6 with Arduino.


Sample Code.

# Include "TimerOne.h". 
int sec = 0; 
int VH = 13; 
int ADC_pin = 0; 
int time = 60; 
int status = true; 
int co; 
void setup (). 
{. 
pinMode (10, OUTPUT); 
Timer1.initialize (1000000); 
Timer1.attachInterrupt (callback); / / attaches callback () as a timer overflow interrupt. 
pinMode (VH, OUTPUT); 
Serial.begin (9600); 
}. 

void callback (). 
{. 
sec + +; 
if (status). 
{. 
if (sec <60). 
{. 
digitalWrite (VH, HIGH); 
}. 
else. 
{. 
status = 0; 
sec = 0; 
}. 
}. 
else. 
{. 
if (sec <90). 
{. 
digitalWrite (VH, LOW); 
}. 
else. 
{. 
status = 1; 
sec = 0; 
}. 
}. 

}. 

void loop (). 
{. 
if (status == 0). 
{Co = analogRead (ADC_pin); 
Serial.println (co); 
}. 
else. 
{. 
Serial.println ("sensor heating!"); 
}. 
delay (100); 
}. 

MQ-7-Cabon monoxide Sensor.

MQ-7 gas sensor is Sensor Cabon monoxide in the air, which is when we started supplying power to the MQ-7 H leg heat up the coils on Cabon monoxide gas into the reaction. The resistance between the legs A and B (RS) decreased.

 
(Click on image to enlarge).

Be seen from the Heater voltage to be controlled by the MCU as the MQ-7. Be used to supply voltage to Heater to heat for 60 seconds and stops supplying power to the Heater for 90 seconds alternately and in 90 seconds, this is a range that can measure changes in gas Cabon monoxide. Cabon monoxide volume is inversely proportional to the resistance RS.

 
(Click on image to enlarge).

How to find the value of the resistance RS. 

To determine the resistance of the RS can be done two ways. 

How can one measure the resistance using Ohm meter to pin A and B directly in 90 seconds. Heater voltage to stop the picture.

 
(Click on image to enlarge).

Method 2 is an indirect way to measure the voltage division rule Voltage Divider.

 
(Click on image to enlarge).

After pressure from holiday pay Heater within 90 seconds, we can see that the power pin into the A or B on the left, which led to a new service we are familiar with.Pressure is split into the picture as a rule.

(Click on image to enlarge).

The RS values ​​using voltage division rule is applied to. Microcontroller has introduced the Out put of the ADC input pin of the Microcontroller. (ADC input voltage pin of the MCU must ensure that the input voltage does not exceed the Port ADC of the MCU to get it) and solve to find the value of RS, and to compare it with the amount Cabon monoxide. 

Example MQ-7 with Arduino.

 
(Click on image to enlarge). 

Timer Library. 
http://www.arduino.cc/playground/Code/Timer1.

Sample Code.

# Include "TimerOne.h". 
int sec = 0; 
int VH = 13; 
int ADC_pin = 0; 
int time = 60; 
int status = true; 
int co; 

void setup (). 
{. 
pinMode (10, OUTPUT); 
Timer1.initialize (1000000); 
Timer1.attachInterrupt (callback); / / attaches callback () as a timer overflow interrupt. 
pinMode (VH, OUTPUT); 
Serial.begin (9600); 
}. 
void callback (). 
{. 
sec + +; 
if (status). 
{. 
if (sec <60). 
{. 
digitalWrite (VH, HIGH); 
}. 
else. 
{. 
status = 0; 
sec = 0; 
}. 
}. 

else. 
{. 
if (sec <90). 
{. 
digitalWrite (VH, LOW); 
}. 
else. 
{. 
status = 1; 
sec = 0; 
}. 
}. 

}. 
void loop (). 
{. 
if (status == 0). 
{. 
co = analogRead (ADC_pin); 
Serial.println (co); 
}. 
else. 
{. 
Serial.println ("sensor heating!"); 
}. 
delay (100); 
}. 

MQ-135 - Air Quality Sensor.

MQ-135 as Sensor monitors the quality of the air to detect gas NH3, NOx, alcohol, Benzene, smoke, CO2, etc in the air, which is when we started supplying power to the MQ-135 pin H heat up. spire On various gases. To react to. The resistance between the legs A and B (RS) decreased.

(Click on image to enlarge).

From power on to the H pin will cause heat to chemical energy in the Sensor can react with various toxic gases and toxic gas detector MQ-135 on various Can make the resistance between pin A and pin B changes (Input A and B are the legs that are not fixed can be customized by your leg is the leg A leg on the opposite side, it would be legged B) When the MQ. -135 detect various toxic gases. RS will have much lower resistance or impedance inversely proportional to the amount of various toxic gases. 

How to find the value of the resistance RS. 

To determine the resistance of the RS can be done two ways.

How can one measure the resistance using Ohm meter to pin A and B directly below.

(Click on image to enlarge).

Method 2 is an indirect way to measure the voltage division rule Voltage Divider.

(Click on image to enlarge).

From the green bar. We can see that the power pin into the A or B on the left, which when taken into a new arrangement with our familiar. Pressure is split into the picture as a rule.

(Click on image to enlarge).

The RS values ​​using voltage division rule is applied to. Microcontroller has introduced the Out put of the ADC input pin of the Microcontroller. (The input voltage pin ADC of the MCU must ensure that the voltage input is beyond the Port ADC of the MCU to receive it) and see that the voltage measured will be greater when RS decreases.

Example MQ-135 with Arduino.

Sample Code.

int adcPin = 0; 
int adcValue = 0; 
float v; 
float rs, ppm; 
void setup (). 
{. 
Serial.begin (9600); 
delay (2000); 
}. 
void loop (). 
{. 
adcValue = analogRead (adcPin); 
v = adcValue * (5.00/1024); 
rs = (100 - (20.00 * v)) / v; 
Serial.print ("Volt out put"); 
Serial.println (v); 
Serial.print ("RS ="); 
Serial.println (rs); 
delay (1000); 
}.




Review Product Article.

 Arduino Send-Receive Data via Ad hoc WIFI. 
 Wifi Data Logging using Arduino. 
 Hantek Digital Osilloscope DSO5000 Series Review Part 1. 
 The address of the application project for Visual Stduio 2005,2008 ARM11 FriendlyARM WIN CE 6.0 OS (mini6410 / Tiny6410). 
 How to Calibrate screen FriendlyARM in WIN CE 6.0. 
 WIN CE License. 
 Quick and Easy Steps to Install or run the OS on ARM11 FriendlyARM. 
 PIR Motion Sensor Getting Started. 
 Hardcore with a GPS Locator SUP500F (EGPS013). 
 Box testing uCAM JPEG Camera (ESEN112). 
 Keil ARM Quick Start Guide for SUN7 and Bluescreen. 
 How to use LPCXpresso IDE for developing your project. article.
 FriendlyARM Product Comparison. article.
 The Memory of the ARM9 S3C2440 FriendlyArm. article.
 Buying Xbee appropriate to the task. article.
 Zigbee and Xbee BASIC (11-11-2551). article.
 What is the Xbee Zigbee and Xbee BASIC (11-11-2551). article.
 Zigbee and Xbee BASIC microcontroller when connected to the Xbee Elementary (12-11-2551). article.
 Zigbee and Xbee BASIC at the initial Xbee (12-11-2551). article.
 Part # 1 Article of Oscilloscope HANTEK. 
 Waveform Test Case by Hantek DSO5000B Series - LED driver 7 inch innolux. 

發佈了44 篇原創文章 · 獲贊 0 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章