Here’s how we approached the hardware and firmware for an interactive retail display with a built-in timer and anti-theft alert — specifically tuned for an office vending machine.
---
The Core Problem: Trust & Time in an Office Setting
Offices are different from public spaces. Employees are trusted, but not completely. The client wanted a machine where users could open a door, grab a product, and have the system automatically charge them — but only if the door was closed within a set time window. If someone lingered too long or tried to remove multiple items without payment, the system needed to alert staff immediately.
This is not a standard vending machine logic. It’s a retail display with smart access control.
Hardware Stack: From Sensor to Alert
We started with the nRF52840 as the main MCU. Why? It gives us BLE 5.2 for local connectivity to an office tablet or smartphone app, plus enough GPIOs to handle a door sensor, a timer trigger, and a buzzer. No need for Wi-Fi here — the machine syncs with a local hub via BLE, and the hub talks to the cloud over MQTT.
Key components we used:
- Magnetic reed switch on the door — detects open/close state.
- IR break-beam sensor across the shelf front — detects if a product is removed.
- Piezo buzzer + red LED strip for the anti-theft alert.
- ESP32 as a secondary controller for the touchscreen UI (7-inch TFT, running LVGL).
- LiPo battery + USB-C charger for backup — if power is cut, the system still logs the last event.
The PCB design was done in KiCad. We kept the power rail separate from the sensor lines to avoid noise on the reed switch input. Two-layer board, 1.6mm thickness, ENIG finish — standard for low-volume prototypes.
Why This Works for Office Vending Machines
A smart vending machine for office use needs to balance convenience with control. Employees don’t want to fumble with coins or cards. Managers don’t want to chase down unpaid items.
Our approach gives them:
- No checkout line — open, grab, close. It’s faster than a coffee machine.
- Audible and visual deterrent — the buzzer and red LED are enough to discourage casual theft without being aggressive.
- Remote monitoring — the BLE-to-MQTT bridge means the office admin can see real-time inventory and alerts on a dashboard.
We shipped three prototypes to the client in Bangalore. Each unit included the full PCB assembly, the touchscreen bezel (3D printed in PETG), and a pre-flashed firmware that works out of the box. They had it running in their office break room within 48 hours.
Himanshu Dada