Commit c2e40516 authored by Your Name's avatar Your Name

changed adc calibration for O2 measurement

parent 001b25df
Pipeline #851 failed
......@@ -240,14 +240,14 @@ float adcToO2PercentFloat(float adc, float offset)
{
// calibration should flush air only (21% o2) or o2 only (100%) for N secs
float PCB_Gain = 4. ; // real voltage is 4 times higher thant the measured in the PCB (there is a voltage divider)
float PCB_Gain = 5. ; // real voltage is 4 times higher thant the measured in the PCB (there is a voltage divider)
float Sensor_Gain = 100./10000. ; // the sensor gain is 100 % / 10000 mVolts
float ADC_to_Voltage_Gain = 3300./4096.0 ; // maximum Voltage of 3.3V for 4096 ADC counts - (It might need recalibration?)
float ADC_to_mVoltage_Gain = 0.788; // this is the measured gain
float ADC_offset = 162.; // this is the measured offset
float o2pc = PCB_Gain * Sensor_Gain * (ADC_to_mVoltage_Gain * adc - ADC_offset);
float o2pc = PCB_Gain * Sensor_Gain * (ADC_to_mVoltage_Gain * adc + ADC_offset);
logMsg("adc: " + String(adc));
return o2pc;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment