Smart shelf that counts stock by weight

Kirana shops and college stores run out of items without noticing. A shelf that weighs stock and alerts before it runs out helps small shopkeepers reorder in time.

ESP32Mini projectECE, CSE, EIE, Diploma
ESP32+726 gOLEDFeatured
Parts
₹1,125
Build
8 weeks
Board
ESP32
Objectives
5

Block diagram

Inputs
  • +
    Load cell and HX711Weigh the items on the shelf
Controller
  • ESP32
    ESP32Converts weight to item count
Outputs
  • 23.4°COLED
    OLED displayShows count
  • AlertWarns when stock is low
  • CLOUD
    Cloud dashboardStores readings, plots trends and sends alerts+

Objectives

  1. To calibrate a load cell within ±5 g.
  2. To convert weight into item count for a chosen product.
  3. To alert at a low-stock level.
  4. To measure drift over 24 hours.
  5. To publish readings over MQTT and show them on a live dashboard with threshold alerts.

Parts and specifications

Total about ₹1,125 at typical online prices. Tap a part for its pinout and datasheet notes.

Design calculations

Bridge output

1 mV/V × 5 V excitation (HX711 regulator about 4.3 V) gives about 4.3 mV at 5 kg full scale.

Resolution

Gain 128 makes 4.3 mV about 70% of the ±20 mV input. Usable resolution after noise is about 1 g on a 5 kg cell.

Calibration factor

Tare, then put a known 500 g weight: factor = (reading − tare) / 500 counts per gram.

Item count

Count = round(net weight / unit weight). For 22 g biscuit packets and 1.5 kg net, count = 68. The scale must resolve well under half a unit (11 g).

Pin map

SignalPin or connection
HX711 DT / SCKGPIO 16 / 4
Load cell E+ / E− / A+ / A−HX711 red / black / white / green (check your cell)
OLED SDA / SCLGPIO 21 / 22
BuzzerGPIO 27

Firmware outline

  1. Tare on start with an empty platform.
  2. Read 10 samples at 10 Hz, average, apply the calibration factor.
  3. Round to item count; ignore changes under half a unit to avoid flicker.
  4. Below the reorder level, beep and show 'Reorder'.
  5. Every hour log weight to watch drift.

Test plan

TestExpected result
Known weights 100 g to 4 kgError within ±5 g
Add and remove one itemCount changes by one
24 hours emptyDrift recorded
Item placed at the edge vs centreCorner error recorded

These rows start your results table when you plan the project.

Viva practice

Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.

1. How does a load cell work?
2. Why the HX711?
3. What causes drift?
4. Why tare?
5. What would a real shop need?

Make it yours

One or two upgrades for a mini project, two to four for a major one.

Build these first

Datasheets and sources to cite

  • Avia Semiconductor HX711 datasheet
  • OIML R76 non-automatic weighing instruments
  • Legal Metrology (General) Rules 2011

About this project

How much does the smart shelf that counts stock by weight project cost?

About ₹1,125 for the parts in the base list: ESP32 DevKit V1, Load cell 5 kg (bar type), HX711 load cell amplifier, 0.96 inch OLED (SSD1306, I²C), Active buzzer 5 V, Acrylic or wooden platform with spacers.

How long does it take?

About 6 weeks for the base project, built on an ESP32. Each upgrade adds time.

Which branches is it suitable for?

Electronics and Communication, Computer Science / IT (IoT, AI), Instrumentation, Diploma (any electronics branch), as a mini project.

Which pins and design calculations does it use?

HX711 DT / SCK on GPIO 16 / 4; Load cell E+ / E− / A+ / A− on HX711 red / black / white / green (check your cell); OLED SDA / SCL on GPIO 21 / 22. Worked calculations on this page: bridge output, resolution, calibration factor, item count.

How do I test it?

Known weights 100 g to 4 kg: Error within ±5 g. Add and remove one item: Count changes by one. 24 hours empty: Drift recorded. Item placed at the edge vs centre: Corner error recorded.

What are the objectives?

To calibrate a load cell within ±5 g. To convert weight into item count for a chosen product. To alert at a low-stock level. To measure drift over 24 hours.