Practical Answers Hub · Learn Arduino UNO · Lessons 15–17

Bare LDR and Thermistor Circuits

Build bare LDR and NTC thermistor dividers, switch an LED from raw readings, then estimate temperature with a rough two-point calibration.

Lesson 15 · Bare LDR: read light and switch an LED

Use a bare light-dependent resistor and a fixed 10 kΩ resistor, not a sensor module. Connect them as a divider and measure the junction on A0.

LDR divider: brighter gives a higher reading
15 V → LDR → junction at A0
2A0 junction → 10 kΩ fixed resistor → GND
3D8 → 220–330 Ω resistor → LED anode; LED cathode → GND
PHOTO TO ADDClose-up of the bare LDR, fixed resistor and A0 junction on the breadboard.
const int ledPin = 8;
void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  int lightRaw = analogRead(A0);
  Serial.println(lightRaw);
  if (lightRaw < 500) digitalWrite(ledPin, HIGH);
  else digitalWrite(ledPin, LOW);
  delay(100);
}

Cover and uncover the LDR; note your real values. Replace 500 with a threshold between the readings you measured. In this arrangement darker light should give a lower reading.

Lesson 16 · Bare thermistor: read temperature change

Replace the LDR with a bare 10 kΩ NTC thermistor, keeping the 10 kΩ fixed resistor from A0 to GND. With this orientation the A0 reading normally falls as the NTC warms. Check it on your own components.

Thermistor divider
15 V → bare 10 kΩ NTC thermistor → junction at A0
2A0 junction → 10 kΩ fixed resistor → GND
3Keep the D8 LED and its current-limiting resistor
PHOTO TO ADDBare thermistor and fixed resistor; show how to hold the thermistor without touching other conductors.
void setup() {
  pinMode(8, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  int temperatureRaw = analogRead(A0);
  Serial.println(temperatureRaw);
  if (temperatureRaw < 500) digitalWrite(8, HIGH);
  else digitalWrite(8, LOW);
  delay(200);
}

Record the actual room and warmed-by-hand readings, then put a threshold between them instead of assuming 500 suits every build.

Lesson 17 · Rough two-point calibration

Write down the raw room reading and a raw reading after the thermistor has settled against your hand. For temperature labels, use independent thermometer estimates for those two conditions. Hand surface temperature is not a fixed 37 °C, and an NTC is nonlinear, so this is only a classroom approximation between the two points.

const int roomRaw = 512;  // replace with your reading
const int handRaw = 445;  // replace with your reading
const int roomC = 20;     // measured room temperature
const int handC = 30;     // measured hand-surface temperature
void setup() { Serial.begin(9600); }
void loop() {
  int raw = analogRead(A0);
  long roughC = map(raw, roomRaw, handRaw, roomC, handC);
  Serial.print("Raw: "); Serial.print(raw);
  Serial.print("  Rough C: "); Serial.println(roughC);
  delay(300);
}
VIDEO TO ADDShow LDR readings and LED response, then thermistor raw readings and the two-point estimate.