Skip to content

Repository files navigation

AIoT-based Smart Fridge System

Smart Fridge monitors your fridge, alerts you when food is about to expire, or when someone steals your food. In addition, it can generate recipe based on items in fridge with the help of OpenAI API.

Features

Real-Time Fridge Monitoring

  • Temperature & Humidity Tracking — Continuous sensor data from the Raspberry Pi, displayed live on the dashboard
  • Door Status Detection — Know when the fridge is opened or closed in real time

AI-Powered Food Recognition

  • On-Device Object Detection — YOLO-v5 running on Raspberry Pi identifies food items inside the fridge
  • Automatic Inventory Sync — Detected items are synced to the backend and reflected on the web UI instantly
  • Smart Item Lifecycle — Items that disappear for multiple scans are automatically removed from inventory

Expiration Management

  • Custom Expiration Dates — Set or update expiration dates for any item via the calendar picker
  • Proactive Expiry Alerts — Get notified when items are within 3 days of expiring so nothing goes to waste

Food Theft Protection

  • Face Verification — Verify authorized users via the web camera or Raspberry Pi camera module
  • Unauthorized Access Detection — Items removed by unverified users are flagged as "stolen" and displayed with a badge
  • Time-Bound Verification — Verified faces are stored for 3 minutes, covering typical fridge access windows

AI Recipe Generation

  • Smart Recipe Suggestions — Powered by OpenAI ChatGPT, generates recipe ideas based on the actual items currently in your fridge
  • One-Click Access — Tap "Generate Recipe" on the dashboard for instant meal inspiration

Interactive Web Dashboard

  • Live Fridge State — Real-time temperature, humidity, and door status at a glance
  • Visual Item Cards — Each item shows name, date added, expiration date, and theft status
  • Push Notifications — Toast notifications for expiry warnings and system events
  • Responsive Design — Mobile-first UI built with React, Tailwind CSS, and shadcn/ui

Hardware

  • Raspberry Pi 4B x3
  • Sensors
    • Temperature and Humidity Sensor
    • Camera Module (Webcam)

Frontend Web UI

Frontend codebase developed using Next.js.

Backend

Python FastAPI

  • Provides API endpoints for frontend and other Raspberry Pi
  • Uses Redis DB to store fridge state and items in fridge

Object Detection

Raspberry Pi on-device detection using YOLO-v5

Face Detection

The system supports two modes of face verification:

Web UI Face Verification

Users can verify themselves through the web interface:

  1. Click the "Verify Face" button on the dashboard
  2. A camera dialog opens requesting camera access
  3. Capture a photo of your face
  4. Click "Verify" to send the image to the backend
  5. The backend stores your verified face in Redis for 3 minutes
  6. During this window, items removed from the fridge won't be marked as "stolen"

Raspberry Pi On-Device Detection

A Raspberry Pi with a camera module can perform continuous face detection:

  • Captures images when the fridge door opens
  • Sends face data to the backend via POST /sync/face_detection
  • Verified users are stored in Redis with a 3-minute TTL

API Endpoint

POST /sync/face_detection
Body: { "face": "<base64-encoded-image-data>" }

Stores the verified face in Redis for 180 seconds. Any food items removed during this window are not flagged as stolen.

About

Smart Fridge monitors your fridge, alerts you when food is about to expire, or when someone steals your food. In addition, it can generate recipe based on items in fridge with the help of OpenAI API.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages