Thermistor
Dependents: Nucleo_UDS_controller_Alberto_version
Thermistor.h@0:d4198719a504, 2014-09-07 (annotated)
- Committer:
- macht
- Date:
- Sun Sep 07 16:19:42 2014 +0000
- Revision:
- 0:d4198719a504
Thermistor
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
macht | 0:d4198719a504 | 1 | #ifndef THERMISTOR_H |
macht | 0:d4198719a504 | 2 | #define THERMISTOR_H |
macht | 0:d4198719a504 | 3 | #include "mbed.h" |
macht | 0:d4198719a504 | 4 | #include "math.h" |
macht | 0:d4198719a504 | 5 | |
macht | 0:d4198719a504 | 6 | class Thermistor |
macht | 0:d4198719a504 | 7 | { |
macht | 0:d4198719a504 | 8 | public: |
macht | 0:d4198719a504 | 9 | Thermistor(float T0,float R0,float B); |
macht | 0:d4198719a504 | 10 | float trans_R2T(float R); //transfer resistance to temperature(degrees) |
macht | 0:d4198719a504 | 11 | private: |
macht | 0:d4198719a504 | 12 | float R0_; //basic resisitance of thremister at basic temperature |
macht | 0:d4198719a504 | 13 | float T0_; //basic temperature[°C] |
macht | 0:d4198719a504 | 14 | float K0_; //basic temperature[K] |
macht | 0:d4198719a504 | 15 | float B_; //B constant |
macht | 0:d4198719a504 | 16 | }; |
macht | 0:d4198719a504 | 17 | #endif |
macht | 0:d4198719a504 | 18 | /* |
macht | 0:d4198719a504 | 19 | float R2T(float input){ |
macht | 0:d4198719a504 | 20 | float K0 = T0+273.0; |
macht | 0:d4198719a504 | 21 | float K = (B*K0)/(K0*log(input/R0)+B); |
macht | 0:d4198719a504 | 22 | float temp = K-273.0; |
macht | 0:d4198719a504 | 23 | return temp; |
macht | 0:d4198719a504 | 24 | |
macht | 0:d4198719a504 | 25 | }*/ |