MQ-7 curve & ppm

Hello,

I know there is many post for this, but I can't find exactly some code to get ppm values for each gas.
I've tried to update the code provide by sandboxelectronics
MQ-2 sketch

I've updated values with the MQ-7 datasheet, I think it must be ok.
I took 2 values, 50 ppm & 4000ppm on sensitivity graph here : MQ7 datasheet

Here is my values :

float           LPGCurve[3]  =  {1.7,0.95,-0.13};   
float           COCurve[3]  =  {1.7,0.20,-0.66};   
float           H2Curve[3] =  {1.7,0.11,-0.73};    
float           CH4Curve[3]  =  {1.7,1.15,-0.10};  
float           AlCurve[3]  =  {1.7,1.23,-0.08};
float           Ro           =  10;

Do you think it's ok ? The graph is not very precise.

Here is Full code I’m currently testing on my Arduino if you want to test or give me some feedback.

MQ-7.ino (9.11 KB)

The PPM values that you get are just about meaningless unless you calibrate the sensor against known gas concentrations.

Also the sensor should be read at correct time in its 60+90 sec periodic cyclus

Ok so MQ7 can be used to detect gaz CO / H2, but use it to display concentrations is not the usage right ?

look at this

@Minims

Please can you explain to me how you got to the values of the curve. I see that in your sketch you have log50 which is 1.7, but where did you get the values 0.95,-0.13 from?

@BitMask I’ve answered in your private message :slight_smile:

Is there any difference in MQ7 & MQ2 ???

Yes.

bsharmavik:
Is there any difference in MQ7 & MQ2 ???

MQ 7 only for CO and MQ 2 for LPG, Smoke, Alcohol, Propane, Hydrogen, Methane.

Minims:
Here is Full code I’m currently testing on my Arduino if you want to test or give me some feedback.

hi
@Minims

thank you for code.
Please help me for how you got to the values:

1)RO_CLEAN_AIR_FACTOR //RO_CLEAR_AIR_FACTOR=(Sensor resistance in clean air)/RO, which is derived from the chart in datasheet

i read all datasheet and not find?(page number or …)

2)COCurve[3] = {1.7,0.20,-0.66}; //data format:{ x, y, slope}; point1: (lg50, 0.20), point2: (lg400, -1.05)
(lg50, 0.20) & (lg400, -1.05): lg50 of log(50 ppm in datasheet), and log400 of log(400 ppm in datasheet)
0.20 and -1.05?

3)COCurve[3] = {1.7,0.20,-0.66};
1.7 == log(50)
0.2 and -.66?