SVSEmbedded will do new innovative thoughts. Any latest idea will comes we will take that idea & implement that idea in a few days. We always encourage the students to take good ideas/projects.
SVSEmbedded providing latest innovative electronics projects to B.E/B.Tech/M.E/M.Tech students. We developed thousands of projects for engineering student to develop their skills in electrical and electronics
Monday, 20 July 2026
AI-Based Smart Retail Inventory Monitoring System
Yes. Below is the same complete Smart Retail Inventory Monitoring project converted into a PHP-based project structure, with the web dashboard, APIs, database, AI logic, n8n integration, Telegram alerts, Google Sheets integration, ThingSpeak integration, and documentation pages.
Important: ESP32 firmware must remain .ino/Arduino C++ code because ESP32 cannot execute PHP. PHP is used for the web server, APIs, database, AI logic, cloud integration, and dashboard.
1. Complete PHP Project Structure
smart-retail-inventory/
│
├── index.php
├── dashboard.php
├── products.php
├── alerts.php
├── predictions.php
├── settings.php
│
├── config/
│ ├── database.php
│ ├── config.php
│ └── api_keys.php
│
├── api/
│ ├── esp32_data.php
│ ├── inventory.php
│ ├── products.php
│ ├── alerts.php
│ ├── prediction.php
│ ├── telegram.php
│ ├── thingspeak.php
│ └── google_sheets.php
│
├── ai/
│ ├── inventory_ai.php
│ ├── consumption_prediction.php
│ └── reorder_prediction.php
│
├── includes/
│ ├── header.php
│ ├── footer.php
│ ├── navbar.php
│ └── functions.php
│
├── assets/
│ ├── css/
│ │ └── style.css
│ └── js/
│ └── dashboard.js
│
├── database/
│ └── smart_retail.sql
│
├── n8n/
│ └── inventory_workflow.json
│
├── documentation/
│ ├── project_description.php
│ ├── components.php
│ ├── circuit.php
│ ├── flowchart.php
│ ├── installation.php
│ └── future_enhancements.php
│
└── esp32/
└── smart_retail_inventory.ino
2. config/database.php
connect_error) {
die(
"Database connection failed: "
. $conn->connect_error
);
}
$conn->set_charset("utf8mb4");
?>
3. config/config.php
4. config/api_keys.php
"YOUR_N8N_SECRET_KEY",
"esp32" => "YOUR_ESP32_SECRET_KEY",
"telegram" => "YOUR_TELEGRAM_BOT_TOKEN",
"thingspeak" => "YOUR_THINGSPEAK_WRITE_API_KEY"
];
?>
5. Database SQL File
database/smart_retail.sql
CREATE DATABASE IF NOT EXISTS smart_retail;
USE smart_retail;
CREATE TABLE products (
id INT AUTO_INCREMENT PRIMARY KEY,
product_id VARCHAR(100) NOT NULL UNIQUE,
product_name VARCHAR(200) NOT NULL,
rfid_uid VARCHAR(100),
category VARCHAR(100),
unit_weight FLOAT DEFAULT 0,
minimum_stock INT DEFAULT 10,
reorder_level INT DEFAULT 10,
supplier_name VARCHAR(200),
supplier_contact VARCHAR(100),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE inventory (
id INT AUTO_INCREMENT PRIMARY KEY,
product_id VARCHAR(100),
quantity INT DEFAULT 0,
weight FLOAT DEFAULT 0,
temperature FLOAT DEFAULT 0,
humidity FLOAT DEFAULT 0,
daily_consumption FLOAT DEFAULT 0,
predicted_consumption FLOAT DEFAULT 0,
days_remaining FLOAT DEFAULT 0,
stock_status VARCHAR(50),
risk_level VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (product_id)
REFERENCES products(product_id)
);
CREATE TABLE inventory_history (
id INT AUTO_INCREMENT PRIMARY KEY,
product_id VARCHAR(100),
quantity INT,
weight FLOAT,
temperature FLOAT,
humidity FLOAT,
recorded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE alerts (
id INT AUTO_INCREMENT PRIMARY KEY,
product_id VARCHAR(100),
alert_type VARCHAR(100),
message TEXT,
severity VARCHAR(50),
sent_to_telegram BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE predictions (
id INT AUTO_INCREMENT PRIMARY KEY,
product_id VARCHAR(100),
average_daily_consumption FLOAT,
predicted_consumption FLOAT,
estimated_days_remaining FLOAT,
recommended_reorder_quantity INT,
risk_level VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
6. includes/header.php
= SITE_NAME ?>
7. includes/navbar.php
8. includes/footer.php
9. includes/functions.php
10. Main Dashboard index.php
query(
"SELECT
i.*,
p.product_name,
p.category
FROM inventory i
LEFT JOIN products p
ON i.product_id = p.product_id
ORDER BY i.id DESC"
);
$total_products = $conn->query(
"SELECT COUNT(*) AS total
FROM products"
)->fetch_assoc()["total"];
$low_stock = $conn->query(
"SELECT COUNT(*) AS total
FROM inventory
WHERE stock_status = 'LOW_STOCK'"
)->fetch_assoc()["total"];
$out_of_stock = $conn->query(
"SELECT COUNT(*) AS total
FROM inventory
WHERE stock_status = 'OUT_OF_STOCK'"
)->fetch_assoc()["total"];
?>
AI Smart Retail Dashboard
This project is an AI-powered IoT inventory monitoring system designed to automatically monitor retail products using ESP32, RFID, load cells, environmental sensors, PHP, MySQL, n8n automation, Telegram notifications, Google Sheets and ThingSpeak.
The ESP32 collects product and inventory data and sends it through Wi-Fi to the PHP API or n8n webhook.
The AI Agent analyzes current stock, historical consumption, stock depletion rate and future inventory requirements.
When the inventory reaches a critical level, the system automatically sends Telegram text and voice notifications.
Inventory information is stored in MySQL and Google Sheets and visualized through a PHP dashboard and ThingSpeak cloud platform.
No comments:
Post a Comment