AI Smart Cold Storage Monitoring and Food Preservation System

AI Smart Cold Storage Monitoring and Food Preservation System ESP32 + AI Agent + IoT Web Dashboard + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak
<?php echo $title; ?>

AI Smart Cold Storage Monitoring and Food Preservation System

ESP32 + AI Agent + n8n Automation + Telegram Voice Alerts + Google Sheets + ThingSpeak

1. Project Overview

This project is an AI powered IoT cold storage monitoring system. ESP32 collects temperature, humidity, gas leakage, door status and power consumption data. AI analyzes the data and predicts failures.

2. Features

  • Real Time Temperature Monitoring
  • Humidity Monitoring
  • Food Spoilage Detection
  • AI Prediction
  • Telegram Voice Alerts
  • Google Sheets Logging
  • ThingSpeak Cloud Dashboard
  • ESP32 Web Dashboard

3. Components Required

Component Quantity
ESP32 Board1
DHT22 Sensor1
DS18B20 Temperature Sensor1
MQ135 Gas Sensor1
ACS712 Current Sensor1
OLED Display1
Relay Module1
Buzzer1

4. ESP32 Pin Configuration

Sensor ESP32 Pin
DHT22GPIO 4
DS18B20GPIO 5
MQ135GPIO 34
Door SensorGPIO 18
ACS712GPIO 35
BuzzerGPIO 26
RelayGPIO 27

5. System Flow


Sensors
   |
ESP32
   |
WiFi
   |
n8n Automation
   |
AI Agent
   |
---------------------
|        |          |
Telegram Google   ThingSpeak
Voice     Sheet    Cloud

6. Working Principle

  1. ESP32 starts and connects to WiFi.
  2. Sensors collect cold storage data.
  3. Data is sent to n8n webhook.
  4. AI Agent checks abnormal conditions.
  5. Alerts are generated automatically.
  6. Data stored in Google Sheets.
  7. Dashboard updated in ThingSpeak.

7. ESP32 Source Code


#include <WiFi.h>
#include <HTTPClient.h>
#include "DHT.h"


#define DHTPIN 4
#define DHTTYPE DHT22


DHT dht(DHTPIN,DHTTYPE);


void setup()
{

Serial.begin(115200);

dht.begin();

}


void loop()
{

float temp=dht.readTemperature();

float hum=dht.readHumidity();


Serial.println(temp);
Serial.println(hum);


delay(5000);

}

8. n8n Automation Workflow


ESP32 Webhook
       |
       |
Data Processing
       |
       |
AI Agent
       |
       |
Condition Check
       |
 ----------------
 |              |
Normal        Alert
 |              |
Sheets       Telegram
 |
ThingSpeak


9. Telegram Bot Setup

Open Telegram and search:

BotFather

/newbot

Create Bot

Copy Token

Add Token in n8n Telegram Node

10. Telegram Voice Alert


AI Alert
   |
Text To Speech
   |
Telegram Audio Message


Example:

"Warning.
Cold storage temperature is high.
Please check compressor."

11. Google Sheets Integration

Time Temperature Humidity Power Status
10:00 5°C 60% 120W Normal

12. ThingSpeak Dashboard

  • Temperature Graph
  • Humidity Graph
  • Power Usage Graph
  • Gas Level Graph

13. AI Power Prediction Logic


Input:

Temperature
Humidity
Compressor Current
Runtime


AI Model:

Power Prediction =
Temperature Difference
+
Cooling Load
+
Time


If power increases:

Cooling failure warning

14. Future Enhancements

  • ESP32 Camera Food Inspection
  • Mold Detection using AI Vision
  • Mobile Application
  • Machine Learning Shelf Life Prediction
  • Solar Backup System

15. Deployment Steps

  1. Assemble Hardware
  2. Upload ESP32 Code
  3. Create n8n Workflow
  4. Configure Telegram Bot
  5. Connect Google Sheets
  6. Create ThingSpeak Channel
  7. Install in Cold Storage

Final Output

The system provides intelligent food preservation, automatic monitoring and AI based failure prediction using ESP32 IoT technology.

Comments