0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

温度センサーMCP9701について

Last updated at Posted at 2022-12-22

x 「関連情報」は、(MCP9701) ココ←をクリックしてね!!
リンク一覧が出ます。

o_cop272.jpg

目的
ほぼ、一番安い、温度センサーの使い方

秋月で8個200円で売っている(2022/12/22)

[MCP9701-E/TO]
通販コード I-03199
発売日 2009/10/26

o_cop267.jpg

アナログ出力である

あんまり精度が高くない+-4℃

1℃当たりのステップが19.5mVである

ちょうど8ビットADCだとそのまま温度になる

0℃の時の中心電圧は、400mV

8ビットADCだと20℃を引いて上げるとよい

直線性は、S-8120Cよりは、いい

o_cop271.jpg

o_cop268.jpg

ピン配列は、そんなに悪くは、ない

Arduino UNOの10ビットADCで取り込んだ時。

o_cop269.jpg

小数点以下2ビットは、0,0.25,0.5,0.75になる

整数部は、4で割り20を引く

値の取り込み例

o_cop270.jpg



/*
  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
}



0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?