Calculate temperature based on resistance from thermistor with lookup chart

thermister_ert-j0eg1.h

Committer:
joeata2wh
Date:
2016-04-02
Revision:
6:3c9cb2bd08c6
Parent:
5:88bf5a42812e

File content as of revision 6:3c9cb2bd08c6:

/* thermister_ert-j0eg1.h
   Read the ERT0xxx thermister and return the temperature
   in C on the specified pin.   Includes lookup table to 
   compute precision temperature based on non-linear 
   change of resistance in thermister.   
   
   Update the resitance array in cpp to properly reflect
   your specific device. 

  By Joseph Ellsworth CTO of A2WH
  Take a look at A2WH.com Producing Water from Air using Solar Energy
  March-2016 License: https://developer.mbed.org/handbook/MIT-Licence 
*/
#ifndef thermister_ert_j0eg1_h
#define thermister_ert_j0eg1_h
#define ERTThermisterAdcRef  3.30f
#define ERTThermisterErrorOver 255.0f 
#define ERTThermisterErrorUnder -255.0f

float conv_c_to_f(float tempC);
float conv_f_to_c(float tempF);
float ERTThermisterReadTemp(AnalogIn adcpin);
float ERTThermisterAvgReadTemp(AnalogIn adcpin, int numRead);



// Shorthand to read thermister by pinName
// rather than reading it with pre-allocated
// AnalogIn.  
float ERTThermisterRead(PinName apin);

// read the temp from thermister and print out
// both the reading and intermediate values.
float ERTThermisterReadPrint(Serial log, char *label, PinName apin);

#endif