x 「関連情報」は、(MCP9701) ココ←をクリックしてね!!
リンク一覧が出ます。
目的
ほぼ、一番安い、温度センサーの使い方
秋月で8個200円で売っている(2022/12/22)
[MCP9701-E/TO]
通販コード I-03199
発売日 2009/10/26
アナログ出力である
あんまり精度が高くない+-4℃
1℃当たりのステップが19.5mVである
ちょうど8ビットADCだとそのまま温度になる
0℃の時の中心電圧は、400mV
8ビットADCだと20℃を引いて上げるとよい
直線性は、S-8120Cよりは、いい
ピン配列は、そんなに悪くは、ない
Arduino UNOの10ビットADCで取り込んだ時。
小数点以下2ビットは、0,0.25,0.5,0.75になる
整数部は、4で割り20を引く
値の取り込み例
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the Serial Monitor.
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogReadSerial
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}