V1 uses an ESP32-S3, an OLED screen, a button, and a VL53L1X distance sensor to estimate how much shelf depth is occupied by an object.
The idea is simple:
empty shelf back distance - object front distance = occupied shelf depth
The prototype works well with the current firmware.
- reads distance from the VL53L1X sensor
- shows live distance on the OLED
- saves an empty shelf back reference
- calculates occupied shelf depth in mm and percent
- checks if the sensor reading is stable before saving
- shows the measurement variation/span on the screen
- saves measurements in ESP32 flash memory
- exports CSV through Serial Monitor
- ESP32-S3
- VL53L1X ToF distance sensor
- SSD1306 128x64 I2C OLED
- push button
- breadboard / soldered wiring
- USB power
| Action | Function |
|---|---|
| Short press before calibration | Save empty shelf back distance |
| Short press after calibration | Save current shelf measurement |
| Hold 2 seconds | Dump CSV over Serial Monitor |
| Hold 5 seconds | Clear calibration and logs |
The VL53L1X is very sensitive to movement, angle, and small disturbances. A simple validation system checks the variation of recent sensor readings.
The OLED shows the span of the recent readings, so you can see if the sensor is stable before saving a measurement. The sensor should be placed on a stable support for reliable measurements.
This project uses PlatformIO for building. Install PlatformIO (via VS Code extension or CLI) and run:
pio run # Build
pio run -t upload # Upload to ESP32
pio device monitor # Open serial monitorLibraries are automatically installed via platformio.ini.
Stable reading (span < 35mm):
Waiting for stable reading:
The firmware keeps a small buffer of recent distance readings, uses a median-style filtered value, and calculates the span between the minimum and maximum recent values. A measurement is only accepted when the reading is inside the expected range and stable enough.
V1 prototype is working.




