Seeed-Studio / Mutichannel_Gas_Sensor

This Arduino library is used for driving "Xadow - Mutichannel Gas Sensor" and "Grove - Mutichanel Gas Sensor"
Other
25 stars 25 forks source link

H2S measurement ? #12

Closed jsalerno closed 1 month ago

jsalerno commented 6 years ago

http://wiki.seeed.cc/Grove-Multichannel_Gas_Sensor/#performance-red-sensor shows a detectable range for H2S (hydrogen sulfide).

What change is required to the MutichannelGasSensor.* files to take this reading ?

paulvha commented 6 years ago

I have spend multiple weeks on this gas-sensor and found that the current design makes me wonder the quality of the readings. (see also my unanswered questions)

Although H2S is shown on the diagram, it is NOT in the specification of the 6814. (Same is true for NO line on the OX-sensor) This makes me doubt even more whether that measurement would be valid.

HOWEVER... since you asked.. as part of my project I have calculated the formulas for all the gas-types that show up on the diagrams. If you want get H2S, I expect the following changes are needed (but not tested :-)

MultiChannelGasSensor.h (line 60) add H2S to enum{CO, NO2, NH3, C3H8, C4H10, CH4, H2, C2H5OH}; so it becomes enum{CO, NO2, NH3, C3H8, C4H10, CH4, H2, C2H5OH, H2S}; (line 119) add line: float measure_H2S(){return calcGas(H2S);}

MultiChannelGasSensor.cpp (line 381, in the switch() command, before default add: case H2S:
{ c = pow(ratio1, -11.51)*0.0014; break; } note : given the short length of the line in the diagram I only got 3 data points, but the formula had an statistical relevance of R = 1.

In the .ino (like ReadSensorValue_Grove.ino) you need to add an entry in the loop to call for H2S: c = gas.measure_H2S(); Serial.print("The concentration of H2S is "); if(c>=0) Serial.print(c); else Serial.print("invalid"); Serial.println(" ppm");

Regards, Paul