Mission
Build this
Build a cold watcher that translates a thermistor, follows a warning rule your team can defend, and raises a visible flag.
Borrowed parts are labelled below and have a fallback. The registered device ID is fixed; sensing and behaviour decisions remain yours.
Bill of materials
Parts
| Source | Part | Fallback |
|---|---|---|
| ● kit | Thermistor | — |
| ● kit | 10 kΩ resistor | — |
| ● kit | SG90 servo | — |
| ● kit | Active buzzer | — |
Disconnect USB before rewiring. Motors, the relay, and the servo need appropriate power and a shared ground. Never drive an actuator from the ESP32 3V3 pin.
Your invitation
Someone should notice the cold before it becomes a surprise
A cold night does not arrive with a clean line drawn at 0 °C. Air cools at different speeds. Leaves can become colder than the air around them. A warning is therefore not a fact you find in a component box. It is a promise your team designs.
You will build a watchful flag that measures temperature, notices danger according to a rule you can defend, and becomes quiet again only when the danger has genuinely passed.
8 °C
5 °C
2 °C
Which matters more here: the final number, or how quickly the night is heading toward it?
Meet the strange resistor
The thermistor never says “degrees”
A thermistor is a resistor whose behaviour changes strongly with temperature. The one in your kit resists electricity more when it is cold and less when it is warm.
The thermistor’s resistance rises.
A fixed resistor helps turn that resistance into something the board can read.
The ESP32 reports a count. It still does not know celsius.
Paired reference readings give the count a temperature meaning.
The relationship bends rather than following a neat straight line. You can use a standard thermistor equation, or fit a simpler conversion across the small temperature range you care about. Either is respectable if you test how wrong it becomes.
What is the voltage divider doing?
The thermistor and a fixed 10 kΩ resistor share 3.3 V. The voltage where they meet depends on how the total resistance is divided between them. GPIO 34 reads that middle voltage as a number from 0 to 4095.
Swapping the two resistors is not dangerous, but it reverses the direction of the curve. Write down which part is connected to 3V3 before you interpret the number.
The difficult decision
A warning threshold is a claim about the future
If you raise the flag at 1 °C, you are not claiming that every plant freezes there. You are saying that, for this sensor and this setting, 1 °C is the point where people should pay attention.
Watch the line
Raise the flag below a temperature supported by your tests and the plants you are protecting.
Watch the fall
Warn when temperature is dropping unusually quickly, even before it reaches the final threshold.
Use both clues
Let a cold number and a fast fall create different levels of concern.
Sunlight, a warm enclosure, still air, or a clear view of the night sky can make the sensor differ from the plant. Placement is part of your warning rule, not a detail after it.
Wiring
Build the quiet thermometer before the alarm
Read the divider in Serial Monitor first. Add the flag next. Let the buzzer join only after the warning logic behaves calmly.
The power rule: The divider and buzzer use 3V3 logic. The servo uses a separate 5 V supply. Join the grounds and unplug USB before rewiring.
Bench referenceOpen the exact wiring map
| ESP32 pin | Part | Part marking | Carries |
|---|---|---|---|
3V3 | Thermistor | top leg | 3V3 power — top of the divider |
GPIO 34 | Divider junction | thermistor meets resistor | Analog voltage — ADC1 pin, safe while Wi-Fi runs |
GND | 10 kΩ resistor | bottom leg | Ground — bottom of the divider |
GPIO 25 | Active buzzer | + | Digital in/out — switches the built-in tone on and off |
GND | Active buzzer | − | Ground |
GPIO 26 | SG90 servo | signal (orange) | PWM to actuator — raises the flag arm |
external 5 V | SG90 servo | V+ (red) | 5V power — its own supply, never 3V3 |
GND | SG90 servo | GND (brown) | Ground — join servo and ESP32 grounds |
Never power the servo from 3V3. Keep the divider on an ADC1 pin such as GPIO 34 because ADC2 cannot be read while Wi-Fi runs.
- 3V3 power
- Analog voltage
- Ground
- Digital in/out
- PWM to actuator
- 5V power
Shade the thermistor and keep it away from the warm ESP32. A perfectly wired sensor in the wrong place still gives the wrong warning.
Teach the flag not to chatter
Use one door in and another door out
Suppose the warning begins at 1 °C. If it also ends at 1 °C, a reading wandering between 0.9 °C and 1.1 °C will raise and lower the flag every minute.
Only after several cold readings agree.
Only after the air has clearly recovered.
The gap between those doors is called hysteresis. The word is less important than the idea: do not change your mind at the exact point where you first made it.
Your team decides:
- How many readings must agree before the flag moves?
- Does the buzzer sound once, repeat gently, or remain silent at night?
- What physical pose distinguishes “watching” from “warning”?
Your cold-room rehearsal
Test the warning before the weather needs it
- Pair it with Juliet’s sensor.
Place the thermistor beside the DHT11 and collect matching readings as temperature changes.
- Build the conversion.
Choose a standard equation or your own fitted line. Record where it agrees and where it begins to drift.
- Cool it gradually.
Use a cool space or a sealed cold object nearby. Keep water away from the electronics and never press the sensor directly onto ice.
- Warm it back again.
Check that the flag clears at the second threshold rather than flickering at the first.
| Reference °C | Raw count | Converted °C | Flag state |
|---|---|---|---|
| ___ | ___ | ___ | safe |
| ___ | ___ | ___ | watch |
| ___ | ___ | ___ | warning |
When it gets dramatic
Most false alarms have a physical cause
The temperature jumps several degrees
One analog sample is carrying electrical noise. Average several quick samples before conversion.
The reading fails when Wi-Fi connects
The divider is on ADC2. Move its middle connection to an ADC1 pin such as GPIO 34.
The afternoon reading is strangely warm
Sun or the ESP32 is heating the thermistor. Shade it and move it away on leads.
The flag chatters at the boundary
Use separate enter and leave thresholds, then require several agreeing readings.
The board restarts as the flag rises
Give the servo its own 5 V supply and keep spine.loop() free of long blocking delays.
Choose your watch
What kind of sentinel will stand outside?
The translators
Make the thermistor conversion the main work. Compare a standard equation with a simple local fit.
The night watchers
Make the threshold the main work. Defend when the flag should rise and when it is safe to lower.
The trend readers
Make the speed of cooling the main work. Ask whether the direction of travel warns earlier than a fixed line.
A calm way through the build
Collect four small wins
fs-01says hello.Prove the garden connection first.
- Warm and cool produce an orderly raw change.
Read GPIO 34 before converting it.
- Your conversion survives a comparison.
Test it beside a reference across the useful range.
- The warning enters and leaves calmly.
Add the separately powered flag and then the buzzer.
The garden handshake
Share what you found
These names are the rigid part of the project. They let another team find your work without knowing what you called the variables in your code.
Temperature
garden/outdoor-1/frost-node/fs-01/temperatureUnit: celsius
Warning state
garden/outdoor-1/frost-node/fs-01/statusUnit: enum
Listen beyond your own device.
garden/greenhouse-1/climate-node/gm-01/temperatureJuliet’s indoor temperature gives you a comparison, not a replacement reference. Use it to show how differently protected and exposed places change.
Finish line
Ready to introduce to the garden
fs-01 stays online and publishes temperature and warning state.
The reject feed stays clear after the final code starts.
The device reads Juliet’s microclimate temperature topic.
The flag and buzzer respond without chatter, resets, or interrupted messages.
The build log records the conversion test, warning rule, recovery rule, placement, and one thing the sensor cannot predict.
The sensor is sheltered appropriately, the moving parts are safe, and the device label can be scanned.
A good sentinel is not the one that sounds most certain. It is the one whose warning can be understood, tested, and trusted.