MyRoboPathOpen Robotics Lab
Arduino Uno #22 of 35
Est. 0.75 Hours
Budget: $2 - $4
Beginner

KY-028 NTC Thermistor Digital Temperature Sensor

Measure temperature curves with an NTC thermistor using the Steinhart-Hart Beta equation and LM393 setpoint alarm.

Explore precision analog thermal sensing with the KY-028 NTC thermistor module. Convert nonlinear thermistor ADC readings into accurate degrees Celsius using the Beta equation, while simultaneously monitoring the onboard LM393 hardware over-temperature comparator.

Arduino Uno R3KY-028 ThermistorSteinhart-Hart BetaLM393 SetpointThermal Alarm
KY-028 NTC Thermistor Digital Temperature Sensor Blueprint
KY-028 NTC Thermistor Digital Temperature SensorCAD Blueprint

Key Learning Objectives & Robotics Concepts

By building and programming this project, you will master the following core engineering skills:

1Understand Negative Temperature Coefficient (NTC) behavior: resistance drops as temperature climbs.
2Apply the simplified Steinhart-Hart Beta formula (1/T = 1/T0 + (1/B)·ln(R/R0)) in C++.
3Combine continuous software °C measurement with an independent hardware comparator setpoint.
4Average ADC readings to resolve 0.1°C smooth temperature changes.

Power Architecture & Voltage Staging

5V / 3.3V Regulated Power

The KY-028 operates cleanly from Arduino Uno 5V, consuming under 5mA across its 10kΩ NTC thermistor divider and LM393 comparator. NTC bead self-heating is negligible through the onboard 10kΩ divider; keep bead away from open flame.

KY-028 NTC Thermistor Digital Temperature Sensor Power Architecture Schematic
Figure: Regulated Arduino Uno supply rails, current budget, and component protection.Power Schematic

Bill of Materials (BOM) & Hardware Components

Bill of Materials for KY-028 NTC Thermistor Digital Temperature Sensor
ComponentSpecifications & AlternativeQtyApprox Cost
Arduino Uno R3ATmega328P @ 16MHz1$8.00
KY-028 Digital Temperature Module10kΩ NTC thermistor (B≈3950) + LM393 comparator1$1.50
5mm Red LED + 220Ω ResistorOver-temperature warning indicator1$0.15
Breadboard & Jumper Wires6× breadboard leads1$2.00

Electrical & System Architecture

Connect KY-028 (+) to 5V, (G) to GND, (A0) to A0, and (D0) to D2. Wire a thermal warning LED (+220Ω resistor) to D8.

Figure: Complete Arduino Uno R3 pin-to-pin wiring schematic for KY-028 NTC Thermistor Digital Temperature Sensor.
Figure: Complete Arduino Uno R3 pin-to-pin wiring schematic for KY-028 NTC Thermistor Digital Temperature Sensor.Wiring Schematic

Autonomous Behavior & Finite State Machine (FSM)

Deterministic Arduino loop handling KY-028 NTC Thermistor + LM393 Module acquisition, filtering, and real-time output updates.

Figure: Firmware execution flow and state transitions for KY-028 NTC Thermistor Digital Temperature Sensor.
Figure: Firmware execution flow and state transitions for KY-028 NTC Thermistor Digital Temperature Sensor.Control Algorithm

Step-by-Step Physical Assembly & Wiring Tutorial

Follow each of the 5 sequential milestone stages with technical photos, wiring checks, and pre-flight tests.

1

Inspect KY-028 NTC Glass Bead & Pinout

Duration: 5 Mins

Locate the tiny glass-encapsulated NTC thermistor at the tip of the PCB and verify pin labels.

KY-028 NTC Thermistor Digital Temperature Sensor hardware layout diagram
Stage 1: KY-028 NTC Thermistor + LM393 Module hardware inspection & pinout overview.Stage 1 Diagram
Step Action Checklist:
  • Verify pin labels left-to-right: A0, G (GND), + (5V), D0.
  • Note the blue multi-turn potentiometer used to dial the D0 hardware trigger temperature.
  • Keep fingers off the bead during baseline calibration.
Engineering & Tuning Tip: Pinch the thermistor lightly between your fingers during testing—human body warmth (~33°C) triggers an instant clean rise!
2

Wire KY-028 to A0/D2 & Thermal LED to D8

Duration: 5 Mins

Connect power, analog/digital outputs, and the warning LED.

KY-028 NTC Thermistor Digital Temperature Sensor breadboard wiring check diagram
Stage 2: Breadboard layout & Arduino Uno pin-to-pin wiring audit.Stage 2 Diagram
Step Action Checklist:
  • Connect KY-028 + → 5V and G → GND.
  • Connect KY-028 A0 → Arduino A0 and D0 → Arduino D2.
  • Wire D8 → 220Ω resistor → Red LED anode → cathode to GND.
Engineering & Tuning Tip: Double-check whether your KY-028 pulls A0 UP or DOWN as temperature rises (set NTC_TO_GND accordingly).
3

Verify Thermal Direction with Diagnostic

Duration: 5 Mins

Run the quick ADC test and touch the bead with a warm fingertip to see which way A0 moves.

KY-028 NTC Thermistor Digital Temperature Sensor power rail protection diagram
Stage 3: Supply rail check (USB 5.0V Regulated Rail (<5mA)) and circuit protection verification.Stage 3 Diagram
Step Action Checklist:
  • Upload the diagnostic test below and open Serial Monitor.
  • Observe baseline room ADC (typically ~480–550 near 25°C).
  • Warm the bead gently with your finger and note whether ADC falls or climbs.
Engineering & Tuning Tip: If ADC falls when warmed, NTC sits on the GND leg (NTC_TO_GND = true); if it climbs, set NTC_TO_GND = false.
4

Upload Steinhart-Hart Thermometer Firmware

Duration: 10 Mins

Flash the calibrated °C/°F converter and verify room temperature matches a desk thermometer.

KY-028 NTC Thermistor Digital Temperature Sensor serial telemetry verification diagram
Stage 4: Firmware upload & 115200 baud Serial Monitor verification.Stage 4 Diagram
Step Action Checklist:
  • Upload the production sketch below.
  • Compare printed °C against room ambient temperature.
  • Hold the thermistor between your fingers until it crosses 30.0°C and watch D8 LED turn ON!
Engineering & Tuning Tip: You can fine-tune BETA_COEFF (typically 3950) by ±100 if your thermistor reads 1–2°C off at high heat.
5

Dial Hardware Comparator Setpoint

Duration: 5 Mins

Adjust the blue multi-turn screw so the module's D0 LED stays OFF at room temp and triggers on fingertip touch.

KY-028 NTC Thermistor Digital Temperature Sensor live operational logic diagram
Stage 5: Live operational logic flow & calibration verification.Stage 5 Diagram
Step Action Checklist:
  • Turn the screw until the module's onboard trigger LED just switches OFF at room temperature.
  • Pinch the thermistor bead for 3 seconds—confirm onboard LED and D2 jump HIGH.
  • Release and watch both return cleanly to normal.
Engineering & Tuning Tip: Having both software °C telemetry AND a hardware comparator setpoint mimics real battery-pack BMS thermal protection.

Subsystem Benchtop Verification Scripts

Test each hardware subsystem independently before deploying the full autonomous firmware.

1Bench Diagnostic: KY-028 NTC Thermistor + LM393 Module Hardware Check

Subsystem Diagnostic

Minimal standalone sketch to verify pin wiring and signal response for KY-028 NTC Thermistor + LM393 Module before running the full project firmware.

Arduino IDE Diagnostic ScriptC++ / Arduino
// Diagnostic: KY-028 Raw ADC & Digital Trigger Check
void setup() { pinMode(2, INPUT); Serial.begin(115200); }
void loop() {
  Serial.print("A0: "); Serial.print(analogRead(A0));
  Serial.print(" | D0(D2): "); Serial.println(digitalRead(2));
  delay(250);
}
Expected Output: A0 shifts smoothly by 40–90 counts when warmed by your fingertips.

Complete Production Firmware

Full working C++ source code with pin mappings, non-blocking timers, and FSM avoidance routines.

arduino_uno_ky028_digital_temperature_sensor.ino
arduino_uno_ky028_digital_temperature_sensor.inoArduino C++
/**
 * Project 22: KY-028 NTC Thermistor Precision Thermometer & Alarm
 * Board: Arduino Uno R3 | Pins: A0 (KY-028 A0), D2 (D0), D8 (Thermal LED)
 */
#include <math.h>

const uint8_t THERM_AO = A0;
const uint8_t THERM_DO = 2;
const uint8_t ALERT_LED = 8;

const bool NTC_TO_GND = true; // Set false if ADC rises when heated
const float R_SERIES = 10000.0f;
const float R_NOMINAL = 10000.0f;
const float T_NOMINAL_K = 298.15f; // 25°C in Kelvin
const float BETA_COEFF = 3950.0f;
const float OVER_TEMP_C = 30.0f;

float readTempC() {
  long sum = 0;
  for (uint8_t i = 0; i < 16; i++) { sum += analogRead(THERM_AO); delay(2); }
  float adc = constrain(sum / 16.0f, 1.0f, 1022.0f);

  float rNtc = NTC_TO_GND
    ? R_SERIES * (adc / (1023.0f - adc))
    : R_SERIES * ((1023.0f - adc) / adc);

  float invT = (1.0f / T_NOMINAL_K) + (log(rNtc / R_NOMINAL) / BETA_COEFF);
  return (1.0f / invT) - 273.15f;
}

void setup() {
  pinMode(THERM_DO, INPUT);
  pinMode(ALERT_LED, OUTPUT);
  Serial.begin(115200);
  Serial.println(F("KY-028 NTC Thermal Monitor Ready"));
}

void loop() {
  float tempC = readTempC();
  bool hwTrip = (digitalRead(THERM_DO) == HIGH);
  bool alert = (tempC >= OVER_TEMP_C) || hwTrip;
  digitalWrite(ALERT_LED, alert ? HIGH : LOW);

  Serial.print(F("Temp: ")); Serial.print(tempC, 2);
  Serial.print(F(" C (")); Serial.print(tempC * 1.8f + 32.0f, 1);
  Serial.print(F(" F) | HW D0: ")); Serial.print(hwTrip ? F("TRIP") : F("OK"));
  Serial.print(F(" | Alert: ")); Serial.println(alert ? F("OVER-TEMP") : F("NORMAL"));
  delay(400);
}

Firmware Architecture Explanation:

  • Averages 16 ADC samples and computes exact NTC resistance from the ratiometric 10kΩ divider.
  • Solves the Steinhart-Hart Beta equation in Kelvin and converts cleanly to Celsius and Fahrenheit.
  • OR-combines software limit (30°C) with the onboard LM393 comparator for redundant thermal alerting.

Operational Verification & Pin State Matrix

1Double-check all 4 Arduino Uno pin connections against the wiring schematic before plugging in USB.
2Upload the Bench Diagnostic sketch first and confirm Serial Monitor at 115200 baud matches: A0 shifts smoothly by 40–90 counts when warmed by your fingertips.
3Upload the complete production sketch and verify every condition in the operational truth table below.

Input Signal vs. System Output Truth Table:

Operational truth table for KY-028 NTC Thermistor Digital Temperature Sensor
Input / StatePin / SignalDetected ConditionExpected Output
Temp < 30.0°CD2 = LOWNominal Thermal BandD8 LED OFF (NORMAL)
Temp ≥ 30.0°Cor D2 = HIGHOver-Temp ThresholdD8 LED ON (OVER-TEMP)

Engineering Troubleshooting Matrix

Engineering troubleshooting matrix for KY-028 NTC Thermistor Digital Temperature Sensor
ProblemLikely CauseDiagnostic CheckEngineering Solution
Temperature drops when you warm the sensor with fingersNTC divider leg orientation opposite of NTC_TO_GNDPinch bead and observe °C trendFlip NTC_TO_GND between true and false.
Prints -273°C or NaNA0 reading pinned at 0 or 1023 due to loose jumperRun raw A0 diagnosticRe-seat 5V, GND, and A0 connections.
D2 hardware trigger stays stuck HIGHBlue multi-turn trimpot dialed below ambient temperatureObserve module onboard LEDRotate trimpot screw until trigger LED just turns OFF at room temp.

Engineering Challenges & Upgrades

Take your build to the next level with these progressive engineering upgrades:

Level 1Thermal Cooling Fan Controller

Turn on a 5V DC fan (Project 29) above 29°C and shut it off below 27°C.

Level 2Live OLED Temperature Graph

Plot a rolling temperature sparkline on the Project 4 SSD1306 OLED.

Level 3DHT11 vs. NTC Accuracy Audit

Wire DHT11 (Project 3) side-by-side and compare response speed and agreement over Serial.