Multichannel Gas Sensor - How to read the values (cpp file)

Grove is a modulated, ready-to-use tool set.
Much like Lego, it takes a building block approach to assembling electronics.

Moderators: lily.li, violet, jeremy882, crail.lyu969

marcoverdial1
Pre-kindergarten Posts: 2
Joined: Thu Mar 07, 2019 12:09 am

Multichannel Gas Sensor - How to read the values (cpp file)

Hello guys, I'm doing a project and I need your help, please.
In the MultichannelGasSensor.cpp that you provide, we have some lines that calculate the actual value of the gas that we want to measure. I've been trying to understand the next questions for a long time but I didn't figured out anything... The next lines are from the calcGas () funcion.

//-1.552, 1.622, the expression.. Where does this expression come? I know there's a graph on datasheet but how do you relate it?
c = pow(ratio1, -1.552)*1.622;

//The ratio is Rs/R0? Where does this expression ((float)An_1/(float)A0_1*(1023.0-A0_1)/(1023.0-An_1)) come from?
ratio1 = (float)An_1/(float)A0_1*(1023.0-A0_1)/(1023.0-An_1);

//A0_1 is equal to what? I know where it comes from but what does it represent?
Thank you 