User Tools

Site Tools


en-us_commands:reference:ntcread

This is an old revision of the document!


ntcRead()

ntcRead() returns the temperature of an NTC 3950 10kΩ sensor as an integer in 0.1℃ units.

ntcRead command operation flow

int ntcRead(uint8_t ch)

Commands

Command Arguments Return Value Operation
ntcRead(ch) uint8_t ch — MPINO: analog pin number; MPAINO: overall analog input channel number int Returns the temperature of an NTC 3950 10kΩ sensor as an integer in 0.1℃ units.

Example

void setup() {
  Serial.begin(115200);
}
 
void loop() {
  int temp10 = ntcRead(0);  // Return the NTC 3950 10kΩ sensor temperature as an integer in 0.1°C units.
  float tempC = ntcReadf(0);  // Return the NTC 3950 10kΩ sensor temperature as a floating-point value in °C.
 
  Serial.print("NTC = ");
  Serial.print(tempC, 1);
  Serial.println(" C");
  delay(500);
}

Precautions

  • ntcRead() is based on an NTC 3950, 10kΩ at 25 C sensor.
  • ntcReadf() divides the ntcRead() result by 10.0F, so its resolution remains 0.1 C.
  • Connecting a sensor with a different B value, reference resistance or wiring configuration causes temperature errors.
  • On MPAINO, the temperature is incorrect unless the DIP switch is in NTC mode.
  • On MPAINO, the first call internally initializes only the corresponding analog input module.

Built-in Commands in the Same Category

en-us_commands/reference/ntcread.1788796404.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki