Arduino code temperature sensor — food-safety cooling & fridge check

For food trucks, small kitchens, caterers and home bakers in the US (FDA Food Code) or England, Wales and Northern Ireland. Type your own times or readings and get the answer here.

1 · Two-stage cooling check (FDA Food Code 3-501.14)

Cooked food must go from 135°F to 70°F within 2 hours, and to 41°F or less within 6 hours total.


Full version — $44 once: the Arduino sketch that runs this clock from the probe itself, logs one CSV line per minute and latches COOLING FAIL. https://buy.polar.sh/polar_cl_lZFGoSLFKP2a7WMHZlWXEDWyAU54tMbucu85D3dIZpN

2 · Fridge / hot-holding log check



Full version — $44 once: 6 compile-tested Arduino sketches (fridge, hot-hold, cooling, door-ajar, two-probe CSV logger, ice-bath calibration) that take these readings every 2 seconds and keep the alarm latched until you look. https://buy.polar.sh/polar_cl_lZFGoSLFKP2a7WMHZlWXEDWyAU54tMbucu85D3dIZpN

What is in the Arduino pack

6 sketches for Arduino Uno, 19 wiring-table rows, 0 libraries to install. Parts you already own: a 10k NTC thermistor probe, a 10k resistor, a buzzer, an LED, a push button (and a reed switch for the door sketch). One line — const int RULESET = 0; — switches between US and UK limits.

Why not a free tutorial: it prints a temperature; it does not latch the 3 a.m. excursion, start the cooling clock at 135°F or treat an unplugged probe as a fault. Ready-made alarms: ThermoWorks BEEP Mini $39 per unit, PharmAlarm 2 $165 (thermoworks.com, September 2026). One payment, not a subscription. Check your own log above first — the answer is free.

Get the complete version $44

This page is the working piece. The full pack has everything below.

6 compile-tested Arduino Uno sketches, no libraries: a latched alarm when a fridge passes 41°F (FDA Food Code) or 8°C (UK), and a cooling clock that fails a batch not at 70°F within 2 hours.

ThermoWorks list prices (thermoworks.com, September 2026): BEEP Mini dual-zone fridge/freezer alarm $39 per unit; PharmAlarm 2 two-channel alarm $165. This pack is code for hardware you already own.

Buy the full version — $44
ENDEJAESPT

Find a tool

· ReadyStack

Worked example

Real numbers from this tool, line by line.

Arduino Code Temperature Sensor: Food-Safety Fridge, Hot-Hold and Cooling Alarms (FDA 41°F/135°F · UK 8°C/63°C)

Most Arduino code for a temperature sensor ends the same way: a number scrolls past in the Serial Monitor, and the tutorial is over. It is not fine for a fridge full of stock, a soup kettle on a food truck, or a pan of chili cooling on a Friday night. In a kitchen the question is never "what is the temperature right now". It is "was it ever out of limit, for how long, and can I prove when".

Here are the limits this pack is built around. Under the US FDA Food Code, cold-held food must stay at 41°F (5°C) or below and hot-held food at 135°F (57°C) or above. Section 3-501.14 adds a two-stage cooling rule: cooked food must fall from 135°F to 70°F within 2 hours, and to 41°F or below within 6 hours total. In England, Wales and Northern Ireland the chill limit is 8°C and the hot-holding limit is 63°C, with a single tolerance period of up to 4 hours above 8°C and up to 2 hours below 63°C.

Take a real-looking evening. A 4-inch hotel pan of chili reads 135°F at 14:00 and 70°F at 16:25. That is 145 minutes for stage one against a limit of 120, so the batch fails by 25 minutes even though it reaches 41°F at 19:10, 310 minutes in and inside the 360-minute total. The free checker on the product page gives exactly that answer when you type those three times.

So the sketches do the watching. CoolingTwoStageLog starts its clock when the probe crosses 135°F, not when you plug the board in, so a pan that sat on the stove gets no free minutes. It prints one CSV line per minute, warns when 75% of a stage is used so there is still time for an ice bath or shallower pans, and latches COOLING PASS or COOLING FAIL. If the probe comes unplugged halfway, the result is FAIL with the reason, never a silent pass.

ColdHoldAlarm is for the fridge you worry about. Its alarm latches. If the compressor struggled at 3 a.m. and the fridge recovered by 6 a.m., the LED and buzzer are still on when you open up, and the log shows how many excursions there were, the longest one in minutes and the highest temperature. A reset is refused while the fridge is still above the limit. In UK mode it prints the moment the 4-hour single-period tolerance is exceeded. HotHoldAlarm does the same for a bain-marie at 135°F or 63°C, with a refill grace period and hysteresis so it does not chatter at the line.

WalkInDoorAjarAlarm pairs a reed switch with one probe: a debounced door, an alarm after 5 minutes open, and a temperature alarm that stays on after the door is shut. TwoProbeTempLogger writes a CSV line every 15 minutes for a fridge and a freezer, keeping the minimum and maximum between lines, so a spike between two log points is not lost. IceBathCalibration runs first: it waits for a reading that holds within 0.2°C for 30 seconds in ice water, compares the error with the Food Code accuracy of 1°C (2°F), refuses an offset over 2°C because that means a wrong beta or wiring, and prints the CAL_OFFSET_C line to paste into the other five.

Everything runs on an Arduino Uno with a 10k NTC probe, a 10k resistor and a buzzer. There are no libraries to install: all six sketches use only the built-in core and all six compiled with arduino-cli for arduino:avr:uno before this was published. Every number you might change is a named constant at the top of the file, and one line switches between the US and UK rules.

Start with the free checker. Type your own three times, or paste last night's readings. If the answer surprises you, that is the moment a sensor that samples every 2 seconds earns its place.

15 seconds — what it actually does

Questions people ask

What does this Arduino code temperature sensor pack actually do?

It turns an Arduino Uno and a 10k NTC probe into food-safety alarms: a latched fridge alarm at 41°F (FDA Food Code) or 8°C (UK), a hot-holding alarm at 135°F or 63°C, the FDA two-stage cooling clock, a walk-in door-ajar alarm, a two-probe CSV logger and an ice-bath calibration sketch. Six sketches, each with a wiring table.

Who is this pack written for?

Food trucks, small kitchens, caterers and home bakers in the US or in England, Wales and Northern Ireland who already own an Arduino Uno or Nano, a 10k NTC thermistor probe, a 10k resistor and a buzzer. You change one line, RULESET, to switch between the FDA Food Code limits and the UK limits.

Why not use a free Arduino thermistor tutorial?

A tutorial prints a temperature and stops. It does not latch an alarm that happened overnight, refuse a reset while the fridge is still warm, start the cooling clock only when the probe crosses 135°F, flag a disconnected probe as a fault, or switch between the US 41°F and UK 8°C rules. Those devices are what these sketches add.

What do I get free on this page?

The web checker. Type when your batch was at 135°F, 70°F and 41°F, or paste your fridge readings, and it answers PASS or FAIL under the FDA Food Code or UK limits with the minutes over. It is complete for checking a log you wrote by hand; the paid pack is what takes the readings for you around the clock.

How does the price compare with a ready-made alarm?

ThermoWorks lists its BEEP Mini dual-zone fridge/freezer alarm at $39 per unit and its PharmAlarm 2 two-channel alarm at $165 (thermoworks.com, September 2026). This pack is a one-time payment for code you run on hardware you already own, and it adds the FDA two-stage cooling clock and a CSV log you can paste into a spreadsheet.

Ask about this tool

One question, answered by the person who built it. Your email only if you want the answer sent.