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.
- Parts
- ₹1,125
- Build
- 8 weeks
- Board
- ESP32
- Objectives
- 5
Block diagram
- Load cell and HX711Weigh the items on the shelf
- ESP32Converts weight to item count
- OLED displayShows count
- AlertWarns when stock is low
- Cloud dashboardStores readings, plots trends and sends alerts+
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.
- To publish readings over MQTT and show them on a live dashboard with threshold alerts.
Parts and specifications
- ESP32 DevKit V1Dual-core 240 MHz, 520 KB SRAM, Wi-Fi + Bluetooth, 3.3 V logic, 12-bit ADC (use ADC1 pins when Wi-Fi is on)₹450Buy
- Acrylic or wooden platform with spacers₹200
Total about ₹1,125 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
1 mV/V × 5 V excitation (HX711 regulator about 4.3 V) gives about 4.3 mV at 5 kg full scale.
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.
Tare, then put a known 500 g weight: factor = (reading − tare) / 500 counts per gram.
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
| Signal | Pin or connection |
|---|---|
| HX711 DT / SCK | GPIO 16 / 4 |
| Load cell E+ / E− / A+ / A− | HX711 red / black / white / green (check your cell) |
| OLED SDA / SCL | GPIO 21 / 22 |
| Buzzer | GPIO 27 |
Firmware outline
- Tare on start with an empty platform.
- Read 10 samples at 10 Hz, average, apply the calibration factor.
- Round to item count; ignore changes under half a unit to avoid flicker.
- Below the reorder level, beep and show 'Reorder'.
- Every hour log weight to watch drift.
Test plan
| Test | Expected result |
|---|---|
| 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 |
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.
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.
