Transistor Gijutsu, October 2014, Special Features Chapter 8,Software of the thermistor thermometer of 0.001 ° resolution, トランジスタ技術2014年10月号 特集第8章のソフトウェア 0.001℃分解能で気配もキャッチ「超敏感肌温度計」

Dependencies:   USBDevice mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Thermistor.h Source File

Thermistor.h

00001 #ifndef THERMISTOR_H
00002 #define THERMISTOR_H
00003 
00004 /// サーミスタクラス
00005 /// AD変換結果から温度を算出する
00006 #define ABSTMP (273.0)
00007 class Thermistor {
00008 private:
00009     double b;   ///< B定数
00010     double t0;  ///< 上記B定数となる温度
00011     double rs0; ///< 上記温度での抵抗値
00012     double t;
00013     double a2, a1, a0;  /// 補正多項式の係数
00014 public:
00015     /// コンストラクタ
00016     Thermistor(double B, double T0, double Rs0);
00017 
00018     /// 2次式による補正係数を決定
00019     void adjust(double t1, double t1r, double t2, double t2r, double t3, double t3r);
00020     /// 1次式による補正係数を決定
00021     void adjust(double t1, double t1r, double t2, double t2r);
00022 
00023     /// 抵抗値を温度値に変換する
00024     double toTempValue(double rval);
00025 };
00026         
00027 
00028 
00029 
00030 #endif