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, salmanfarisvp, jeremy882, crail.lyu969

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

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

Post by marcoverdial1 » Sat Jul 20, 2019 2:38 am

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?
int A0_1 = get_addr_dta(6, ADDR_USER_ADC_CO);

//An_1 is equal to what? I know where it comes from but what does it represent?
int An_1 = get_addr_dta(CH_VALUE_CO);


Sorry for so many repetitive questions but I really need to know that in order to present my project...
Thank you :)

Post Reply