Advertisement
Guest User

Untitled

a guest
May 6th, 2015
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. float TempCoefficient=1.0+0.0185*(temperature-25.0); //temperature compensation formula: fFinalResult(25^C) = fFinalResult(current)/(1.0+0.0185*(fTP-25.0));
  2. float CoefficientVolatge=(float)mVProbe/TempCoefficient;
  3. if(CoefficientVolatge<150)Serial.println("No solution!"); //25^C 1413us/cm<-->about 216mv if the voltage(compensate)<150,that is <1ms/cm,out of the range
  4. else if(CoefficientVolatge>3300)Serial.println("Out of the range!"); //>20ms/cm,out of the range
  5. else
  6. {
  7. if(CoefficientVolatge<=448)ECcurrent=6.84*CoefficientVolatge-64.32; //1ms/cm<EC<=3ms/cm
  8. else if(CoefficientVolatge<=1457)ECcurrent=6.98*CoefficientVolatge-127; //3ms/cm<EC<=10ms/cm
  9. else ECcurrent=5.3*CoefficientVolatge+2278; //10ms/cm<EC<20ms/cm
  10. ECcurrent/=1000; //convert us/cm to ms/cm
  11. Serial.print(ECcurrent,2); //two decimal
  12. Serial.println("ms/cm");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement