Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HEV - High Energy Ventilator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
HEV - High Energy Ventilator
Commits
c2e40516
Commit
c2e40516
authored
Jan 27, 2021
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed adc calibration for O2 measurement
parent
001b25df
Pipeline
#851
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
common.cpp
arduino/hev_prototype_v1/src/common.cpp
+3
-3
No files found.
arduino/hev_prototype_v1/src/common.cpp
View file @
c2e40516
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment