Skip to content

Commit

Permalink
Updated Scaling function
Browse files Browse the repository at this point in the history
The R0 resistance and scaling functions were updated and adapted to
correspond better to the reference Keto-Diastix test strips results.
  • Loading branch information
clarholm committed Jun 27, 2013
1 parent 63525f3 commit a6673a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Binary file added .DS_Store
Binary file not shown.
11 changes: 3 additions & 8 deletions ketosense/ketosense.ino
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ float value2 = 0;
float value3 = 0;

// General Var
float R0 = 3000;
float R0 = 4500;
int lastPPM = 0;

double currentHumidity;
Expand Down Expand Up @@ -263,15 +263,10 @@ int acetoneResistanceToPPMf(float resistance){
if (tempResistance > 50000){
double PPM = 0;
}
else if (tempResistance <= 50000 && tempResistance > 3600){
double logPPM = (log10(tempResistance/R0)*-1.5512)+2.5911;
else {
double logPPM = (log10(tempResistance/R0)*-2.6)+2.7;
PPM = pow(10, logPPM);
}
else{
double logPPM = (log10(tempResistance/R0)*-0.9768)+2.4906;
PPM = pow(10, logPPM);
}

return (int)PPM;
}

Expand Down

0 comments on commit a6673a6

Please sign in to comment.