How To Use - Seeed Grove Manual

Gas sensor
Hide thumbs Also See for Grove:
Table of Contents

Advertisement

5.3

How to use

There're two steps you need to do before getting the concentration of gas.
First, connect the module with Grove Shield using A0 like the picture above. And put the sensor in
a clear air and use the program below.
void
setup() {
Serial.begin(9600);
}
void
loop() {
float
sensor_volt;
float
RS_air;
float
R0;
// Get the value of R0 via in LPG
float
sensorValue;
/*--- Get a average data by testing 100 times ---*/
for(int
x
=
0
{
sensorValue
}
sensorValue
= sensorValue/100.0;
/*-----------------------------------------------*/
sensor_volt
= sensorValue/1024*5.0;
RS_air
= (5.0-sensor_volt)/sensor_volt;
R0
= RS_air/9.9;
Serial.print("sensor_volt =
Serial.print(sensor_volt);
Serial.println("V");
Serial.print("R0 =
Serial.println(R0);
delay(1000);
}
Then, open the monitor of Arduino IDE, you can see some data are printed, write down the value
of R0 and you need to use it in the following program. During this step, you may pay a while time
to test the value of R0.
Second, put the sensor in one gas where the environment you want to test in.
// Get the value of RS via in a clear air
;
x
<
100
; x++)
=
sensorValue
+ analogRead(A0);
// The ratio of RS/R0 is 9.9 in LPG gas
");
");
// omit *RL
7
However, don't forget

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Grove and is the answer not in the manual?

This manual is also suitable for:

Mq9

Table of Contents