365ShelfSense — Frictionless Produce Checkout for Unattended Retail

The Problem

365 Retail Markets operates thousands of micro markets, smart stores, and kiosks across corporate offices, warehouses, and transit hubs — all unattended. No cashiers. No staff on the floor. That creates two problems that compound silently every day.

First, shrinkage. Items leave shelves without being paid for. Existing solutions like camera-based detection catch some of it, but they're kiosk-dependent and don't cover the shelf itself.

Second, the physical gap. 365's transaction system knows what was sold. It has no way of knowing what physically exists on the shelf right now. A restock that never happened, a misplaced product, a grab-and-go with no kiosk interaction — all of these create a drift between what the system thinks is there and what's actually there. In unattended retail, nobody catches that drift until it's already a loss.


The Solution

The core insight: theft and inventory problems are both symptoms of the same underlying issue — the physical shelf state is never reconciled against the transaction record in real time.

We built a system that closes that gap. Every item movement on the shelf is logged, timestamped, and tied to either a valid customer session or flagged as a discrepancy. Add a card scanner to that loop and you get something even better — a frictionless checkout experience where the shelf itself becomes a point of sale.

$$\text{theft} = \begin{cases} \text{true} & \text{if item removed with no active card session} \ \text{false} & \text{if valid session exists at time of removal} \end{cases}$$

No speed-based detection. No arbitrary timers. If you scanned your card before picking something up, it's a purchase. If you didn't, it's flagged.


The Final Product

365ShelfSense is a frictionless produce checkout system with built-in physical reconciliation, running on a Raspberry Pi 4B.

The flow:

  1. Customer scans their 365 member card at the shelf display
  2. Session opens — their name appears on screen
  3. They pick up produce — sensors detect the removal, weight is deducted, item is priced per pound and added to their cart automatically
  4. They can return items — cart updates instantly
  5. They hit checkout — the completed cart is sent directly to the 365 kiosk for payment

Hardware:

  • Raspberry Pi 4B + Seeed Studio Grove Base Hat
  • HC-SR04 Ultrasonic Distance Sensor
  • Red, yellow, and green LEDs
  • Grove 4-digit display showing live item count
  • CATIA V5 physical shelf enclosure prototype

Software:

  • Python 3 + Flask backend
  • SQLite — sessions, cart, events, kiosk transfers
  • Two live frontend views: operator dashboard and customer shelf display
  • RPi.GPIO for hardware control

Produce: Bananas ($0.59/lb), Apples ($1.29/lb), Oranges ($0.99/lb), Grapes ($2.49/lb). Each shelf slot holds a randomized weight assigned on restock. Customers select how many pounds they want — price updates live on the slider.

Two interfaces:

The operator dashboard shows live shelf state across all four produce types, active sessions, theft alerts, kiosk transfer history, and analytics covering sales, shelf health, and loss prevention.

The customer shelf display is a landscape screen mounted at the shelf. It shows a scan prompt when idle — user is set to none by default. The moment a card is scanned it greets the customer by name, builds their cart in real time, and sends the order to the kiosk on checkout.


The Challenges

This build pushed us hard from the first hour.

SSH never worked. The hackathon network had device isolation enabled — it silently blocked all peer-to-peer traffic between our laptop and the Pi. We didn't know this at first. We spent hours trying to fix what we thought was a Pi configuration problem: direct ethernet, phone hotspot bridging, manually editing cloud-init configs through DiskGenius on Windows, regenerating password hashes via WSL, editing live netplan configs directly on the ext4 partition, spoofing a new instance ID to force cloud-init to rerun. Eventually other hardware teams confirmed the same issue. We adapted by running Flask locally on the laptop and keeping the Pi wired as the physical hardware artifact.

The Pi came pre-imaged for a different hackathon — with a locked cloud-init config and an unknown password hash. We reflashed with Raspberry Pi OS Lite using the official imager, preconfiguring everything before first boot.

CATIA V5 kept crashing during the session, forcing design restarts throughout the build. On top of that, we had no access to official 365 shelf dimensions — every measurement in the enclosure model was an educated estimate. The design revised every time the hardware plan changed.

Despite all of it, we shipped a working end-to-end system — sensor logic, backend, database, two live frontend views, and a physical CAD prototype — in under 24 hours.


Integration with 365 Retail Markets

ShelfSense slots directly into 365's existing ecosystem.

Kiosk integration — the cart built at the shelf arrives at the 365 kiosk already loaded. One less friction point between picking produce and paying for it.

Operator dashboard — our REST API exposes shelf state, session logs, and theft events as JSON endpoints that feed into 365's universal management platform.

Reorder automation — low stock events fire webhooks to the VMS to generate restock requests automatically, routed to the nearest driver.

Cost — HC-SR04 sensor under $2, Pi Zero 2W at $15. Under $20 per shelf deployment, viable at scale across thousands of locations.


What's Next

  • Real barcode scanner for card reading
  • HX711 load cell replacing ultrasonic for precise weight tracking
  • Multi-shelf support with individual sensor nodes
  • NFC/RFID as a faster alternative to barcode scanning
  • Mobile push alerts for theft and restock triggers
  • Demand forecasting from session and weight data

Built With

Share this project:

Updates