cancel
Showing results for 
Search instead for 
Did you mean: 

CO Gas Concentration Reading with the board P-Nucleo-IKA02A1.

SLee.9
Associate

Hello, 

​I'm trying to tuning CO​ Gas reading value with the board P-Nucleo-IKA02A1.

By the P-Nucleo-IKA02A1 BSP, Get_Gas_concentration function is belows..

​float Get_Gas_concentration(float gain, float sens){

return ((float)Get_ADC_value(ANALOG_GAS_VALUE_PIN)-Get_ADC_value(ANALOG_REF_VOLT_VALUE_PIN))*805664/gain/sens; }

What's the meaning of the constant, 805664, of above source code?

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
3 REPLIES 3
Jiri HLADIK
Associate II

Hello,

This constant represents conversion from ADC value to voltage. One LSB of 12bit ADC powered from 3,3V represents 805,664uV

The value is multiplied by 1000 to have correct gas concentration reading in ppm

Best regards

ST support

Thanks for your quick answer.

Dsaka.686
Associate

STM32 Nucleo sheets give a moderate and adaptable path for clients to explore different avenues regarding new thoughts and manufacture models with any STM32 microcontroller line.

Tutuapp 9Apps ShowBox