CNAP

NTC Temperature Sensor Reference

An analog temperature sensor based on a negative-temperature-coefficient (NTC) thermistor — resistance drops as temperature rises.

Pin names

NameDescription
GNDGround
VCCPower (5V)
OUTAnalog Out — voltage proportional to temperature

Attributes

This component has no configurable attributes.

Usage

Connect VCC to 5V, GND to GND, and OUT to an analog input pin. Read the raw value with analogRead(); converting it to a real temperature requires the thermistor's Beta coefficient and reference resistance (consult the specific sensor's datasheet).

const int NTC_PIN = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int raw = analogRead(NTC_PIN);
  Serial.print("Raw ADC: ");
  Serial.println(raw); // higher raw value = lower temperature (NTC characteristic)
  delay(500);
}

Examples

DescriptionAttrs
Default NTC sensor{}

See also

  • DHT22 — digital temperature + humidity alternative
  • Photoresistor — same simple analog output pattern for light instead of heat