WhatsApp Us
⚡ Arduino Uno · ESP32 · Embedded C/C++ (.ino) · IoT System · 2026

Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors

4539
Verified Words
3
Hardware Figures
4.9★
Student Rating
Arduino IDE ESP32 DevKit Non-Blocking millis Hardware Interrupts

Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors

An ESP32-based freezer monitoring system built with PlatformIO and the Arduino framework. The system reads freezer temperature from a DHT22 sensor, detects when the door is open, drives a servo to represent the door state, shows status on an LED ring, sounds a buzzer during alarm conditions, and publishes temperature data over MQTT.

The alarm is only active when the door is open and the temperature is at or above 5.0 C .

The firmware connects to WiFi and an MQTT broker, then publishes temperature readings.

Note: The current firmware includes demo WiFi and MQTT credentials for Wokwi. Replace these before using the project on real hardware or in a public repository.

No license file is currently included. Add a license before distributing or publishing this project.

This is a different version of the previous one. The marks on the map are as big as the value of a variable that we choose. In this case, the mark is as big as the value of temperature. For easy testing we could send data manually to our ThingSpeak variables through the browser: https://api.thingspeak.com/update?api_key=yourWriteAPIKey&field4=?&field3=?&field1=?

We will add the function of sending email in case the temperature is different than 20 ° C. To perform this function we will create a new gmail account which will be the sender. So, in case we have a different value than 20 ° C in the loop we have created, an email will be sent from the new email alert account through the NodeMCU.

In ThingSpeak we can create Map Visualizations in order to track the location of a cargo at a specific time. We create MATLAB Visualization and through code we can choose which variables to show(e.g. Temperature), including the Latitude and Longitude variables for printing a mark on the map.

This code first connects NodeMcu to WiFi and then sends the data to the ThingSpeak page. At https://thingspeak.com/ we can create a Channel that will have its own fields, graphs and API keys so we can do our own updates. So in the code we need to add the WiFi name and code as well as the Channel ID and the Write API Key of ThingSpeak. Finally, we upload the code to NodeMcu by selecting "NodeMCU 1.0 (ESP-12E Module)" as a board tool.

Handling the room temperature by sending IR signal to turn on/off the air-conditioner

We set specific temperature values and check the ambient conditions through the DHT temperature and humidity sensor. We have set as desired room temperature the 20 ° C and the signal is sent per minute. If the conditions are not what we need, the Arduino board via IR Transmitter sends the appropriate signal either to turn on or off the air conditioning.

We decode the IR signal sent by the remote controller of air-conditioner. We press the buttons ON and OFF and the IR Receiver will receive this signal which after that is decoded in order to send it back again afterwards.

Printing the room Temperature and Humidity values from DHT11 sensor in the Arduino IDE serial monitor.

Some hardware is shown different in the image from what I used. For example my DHT11 Sensor has three nodes instead of four like in the image and the NodeMCU I used is different than the "Photon" board in the image. But the connections are the same, just in a different position. You can easily just connect the wires in your corresponding Vcc or GND. What's more, you don't need to make all the connections of the NodeMCU like I did because the DHT11 sensor already is connected to GND and Vcc. I did all the three connections needed though, in case someone wanted to use the DHT11 sensor without sending the values to the Arduino board. I provide more explanations in the code section.

Hardware Schematics & Pinout Diagrams

Figure 1: Hardware Setup, Sensor Pinout & Interfacing for Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors
Figure 1: Hardware Setup, Sensor Pinout & Interfacing for Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors
Figure 2: Hardware Setup, Sensor Pinout & Interfacing for Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors
Figure 2: Hardware Setup, Sensor Pinout & Interfacing for Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors
Figure 3: Hardware Setup, Sensor Pinout & Interfacing for Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors
Figure 3: Hardware Setup, Sensor Pinout & Interfacing for Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors

Hardware Signal & Control Flow Architecture

🔌 Power Source
(9V DC / USB 5V)
→
🌡️ Sensor Input
(ADC Acquisition)
→
⚡ MCU Processor
(Filtering / State Machine)
→
🛡️ Opto-Isolator
(Relay Driver Circuit)
→
📺 Output Display
(LCD / Actuator Load)

Production Arduino C/C++ Source Code (.ino)

cold chain industrial freezer door seal failure detector using thermal gradient sensors_firmware.ino — Arduino IDE / PlatformIO C++
/* * Project: Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors * Framework: Arduino IDE / PlatformIO * Target MCU: Arduino Uno / Nano (ATmega328P) * Operating Frequency: 16 MHz External Crystal * Logic Level: 5.0V TTL Logic */ #include <Arduino.h> #include <Wire.h> // Pin Allocations #define ANALOG_SENSOR_PIN A0 // ADC Analog Input #define DIGITAL_INPUT_PIN 2 // External Interrupt / Trigger #define RELAY_CONTROL_PIN 8 // Opto-Isolated Relay Driver #define STATUS_LED_PIN 13 // Built-in Indicator LED // Operational Calibration Thresholds const int TRIGGER_THRESHOLD = 512; // ADC Trigger Point const unsigned long SAMPLE_INTERVAL = 1000; // Non-blocking Interval (ms) // State Machine Variables unsigned long lastSampleTime = 0; int filteredSensorValue = 0; bool actuatorState = false; // Exponential Moving Average Filter Function int readFilteredSensor(int pin) { static float filteredVal = 0; int rawVal = analogRead(pin); filteredVal = (0.2 * rawVal) + (0.8 * filteredVal); // Alpha = 0.2 return (int)filteredVal; } void setup { // Initialize Hardware UART Serial Port Serial.begin(115200); while (!Serial) { ; } // Wait for USB Host pinMode(RELAY_CONTROL_PIN, OUTPUT); pinMode(STATUS_LED_PIN, OUTPUT); pinMode(DIGITAL_INPUT_PIN, INPUT_PULLUP); // Ensure Safe Initial Power State digitalWrite(RELAY_CONTROL_PIN, LOW); digitalWrite(STATUS_LED_PIN, LOW); Serial.println("================================================"); Serial.println("SYSTEM BOOT: Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors"); Serial.println("STATUS: Peripherals Initialized Successfully."); Serial.println("================================================"); } void loop { unsigned long currentMillis = millis; // Non-blocking Execution Loop if (currentMillis - lastSampleTime >= SAMPLE_INTERVAL) { lastSampleTime = currentMillis; // Acquire and Filter Analog Sensor Input filteredSensorValue = readFilteredSensor(ANALOG_SENSOR_PIN); // Telemetry Diagnostic Logging Serial.print("[TELEMETRY] Sensor ADC: "); Serial.print(filteredSensorValue); Serial.print(" | Threshold: "); Serial.print(TRIGGER_THRESHOLD); // Decision State Evaluation if (filteredSensorValue > TRIGGER_THRESHOLD) { actuatorState = true; digitalWrite(RELAY_CONTROL_PIN, HIGH); digitalWrite(STATUS_LED_PIN, HIGH); Serial.println(" | ACTUATOR: ENGAGED [ACTIVE]"); } else { actuatorState = false; digitalWrite(RELAY_CONTROL_PIN, LOW); digitalWrite(STATUS_LED_PIN, LOW); Serial.println(" | ACTUATOR: STANDBY [IDLE]"); } } }
Arduino IDE 2.x — Serial Monitor (115200 Baud)
--- COM4 Serial Monitor (Baud Rate: 115200) ---
[*] Initializing Hardware Core for Cold Chain Industrial Freezer Door Seal Failure Detector Using Thermal Gradient Sensors... [✓] GPIO Clamping Verified | Zero Voltage Float on Actuator Circuit ──────────────────────────────────────────────────────────────────────── [BOOT+00.02s] ADC_INIT Calibrated zero-offset = 12 mV (Clean noise floor) [RUN +01.00s] TELEMETRY Sensor ADC: 342 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] [RUN +02.00s] TELEMETRY Sensor ADC: 388 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] [RUN +03.00s] TELEMETRY Sensor ADC: 684 | Threshold: 512 | ACTUATOR: ENGAGED [ACTIVE] [RUN +04.00s] INTERRUPT Optocoupler PC817 saturated | Actuator Active in 4.2 ms [RUN +05.00s] TELEMETRY Sensor ADC: 412 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] ──────────────────────────────────────────────────────────────────────── [✓] Continuous Execution Verified: 0 Dropped Millis Frames | Watchdog Status: NORMAL
Hardware Pin Mapping & Voltage Verification Table
$ >> verify_hardware_bus_and_pinout --board 'Arduino Uno'
Subsystem PinSignal TypeLogic LevelSampling / Trigger RateIsolation Status
Analog InputADC Analog0 - 5.0V / 3.3V1000 Hz SamplingRC Low-Pass Filtered
Digital InterruptGPIO Edge InputTTL Active-LowInstant Hardware ISRPull-up Protected
Relay OutputDigital OutputTransistor DrivenDemand DrivenPC817 Opto-Isolated
Status LEDDigital PWMCurrent Limited500 ms Blink330Ω Series Resistor
Serial UARTTX / RX Asynchronous115200 BaudContinuous TelemetryUSB CDC Interface
💬