Design a temperature warning system.
This project combines the thermistor voltage divider, Serial Monitor, variables, comparisons and several LED outputs. The focus is the design process: turn a brief into a circuit, plan the logic, build it, code it and prove that it works.
The customer brief
Design a simple temperature warning unit for an equipment enclosure. A green lamp should show normal conditions, amber should warn that the enclosure is becoming warm, and red should show an over-temperature condition.
Requirements
- Use a thermistor in a manual voltage divider.
- Show one clear status at a time: green, amber or red.
- Print the raw sensor value to Serial Monitor while calibrating.
- Allow threshold values to be edited in the sketch.
- Use straightforward Level 1 code only.
1. Identify the input and outputs
2. System plan diagram
3. Circuit diagram
4. Breadboard build plan
5V → 10 kΩ NTC → A0 junction → 10 kΩ → GND
Pin 8 → resistor → LED → GND
Pin 9 → resistor → LED → GND
Pin 10 → resistor → LED → GND
Keep all LED cathodes on the common ground rail. Before adding the decision logic, upload a tiny sketch that prints A0 and warm the thermistor gently between your fingers. Record a few typical readings.
5. Pseudocode
Set green, amber and red pins as outputs
Start Serial Monitor
Set two threshold values
REPEAT FOREVER
Read thermistor value
Print value
IF value is below warm limit
Green ON, amber OFF, red OFF
ELSE IF value is below hot limit
Green OFF, amber ON, red OFF
ELSE
Green OFF, amber OFF, red ON
END IF
Wait briefly
REPEAT
6. Arduino code
const int thermistorPin = A0;
const int greenLed = 8;
const int amberLed = 9;
const int redLed = 10;
int warmLimit = 500;
int hotLimit = 700;
void setup() {
pinMode(greenLed, OUTPUT);
pinMode(amberLed, OUTPUT);
pinMode(redLed, OUTPUT);
Serial.begin(9600);
}
void loop() {
int temperatureValue = analogRead(thermistorPin);
Serial.println(temperatureValue);
if (temperatureValue < warmLimit) {
digitalWrite(greenLed, HIGH);
digitalWrite(amberLed, LOW);
digitalWrite(redLed, LOW);
}
else if (temperatureValue < hotLimit) {
digitalWrite(greenLed, LOW);
digitalWrite(amberLed, HIGH);
digitalWrite(redLed, LOW);
}
else {
digitalWrite(greenLed, LOW);
digitalWrite(amberLed, LOW);
digitalWrite(redLed, HIGH);
}
delay(200);
}Important: the example threshold numbers are not universal temperatures. They are raw ADC values used to teach the system. Calibrate your own warm and hot limits by observing Serial Monitor readings. Converting a thermistor reading into degrees Celsius can be taught later once the learner understands the basic divider and decision process.
7. Test plan
| Test | Input / condition | Expected result | Actual result | Pass? |
|---|---|---|---|---|
| 1 | Sensor value below warmLimit | Green only | ||
| 2 | Sensor value exactly at warmLimit | Amber only | ||
| 3 | Value between warmLimit and hotLimit | Amber only | ||
| 4 | Sensor value exactly at hotLimit | Red only | ||
| 5 | Sensor value above hotLimit | Red only | ||
| 6 | Warm thermistor gradually | Status progresses green → amber → red | ||
| 7 | Allow thermistor to cool | Status returns red → amber → green |
8. Evaluation questions
- Were the chosen warm and hot limits sensible?
- Did only one LED illuminate at a time?
- Were the status changes repeatable?
- What happens if the thermistor is disconnected?
- Would a real product need an alarm, display or fail-safe state?