Transistor Gijutsu, October 2014, Special Features Chapter 8,Software of the thermistor thermometer of 0.001 ° resolution, トランジスタ技術2014年10月号 特集第8章のソフトウェア 0.001℃分解能で気配もキャッチ「超敏感肌温度計」
Information
tg_201410s8_AD7714 トランジスタ技術 2014年 10月号 第8章のソフトウェア
Program for Section 8 in October. 2014 issue of the Transistor Gijutsu
(Japanese electronics magazine)
概要
このプログラムは、サーミスタの抵抗値変化をAD7714(24bitADC)で測定し、抵抗値を温度値に変換することで、0.001℃程度の分解能で温度変化を測定します。
ファイル
このソフトウエアは、次のファイルから構成されています。
- AD7714.cpp - AD7714の内部レジスタを設定
- Thermistor.cpp - サーミスタの抵抗値から温度値に変換
- ExpAvr.cpp - 指数平均によるソフトウエアLPF
- main.cpp - main()関数
詳細については、10月号の記事および上記ファイル中のコメントを参照してください。
Diff: Thermistor/Thermistor.h
- Revision:
- 0:de885a6da962
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Thermistor/Thermistor.h Fri Aug 29 08:38:36 2014 +0000 @@ -0,0 +1,30 @@ +#ifndef THERMISTOR_H +#define THERMISTOR_H + +/// サーミスタクラス +/// AD変換結果から温度を算出する +#define ABSTMP (273.0) +class Thermistor { +private: + double b; ///< B定数 + double t0; ///< 上記B定数となる温度 + double rs0; ///< 上記温度での抵抗値 + double t; + double a2, a1, a0; /// 補正多項式の係数 +public: + /// コンストラクタ + Thermistor(double B, double T0, double Rs0); + + /// 2次式による補正係数を決定 + void adjust(double t1, double t1r, double t2, double t2r, double t3, double t3r); + /// 1次式による補正係数を決定 + void adjust(double t1, double t1r, double t2, double t2r); + + /// 抵抗値を温度値に変換する + double toTempValue(double rval); +}; + + + + +#endif