IoT Emergency Supply Cabinets: Architecture and Implementation
This article outlines an IoT architecture for dispensing emergency tissues and sanitary pads in public restrooms and similar settings. It covers terminal hardware, claim workflows, advertising verification, inventory reconciliation, cloud–edge coordination, security, and deployment considerations, showing how to build an operational system with a vendor-neutral technology stack.
Public restroom users sometimes face an immediate need for tissues or sanitary pads without having any available. A compact supply cabinet can address that need while providing an advertising channel: a roughly 30-centimeter cube mounted on one side, with a bottom dispensing outlet and screens that rotate advertisements and QR codes. Users scan a code, watch a short video or complete a follow task, and collect a supply item.
From an engineering perspective, this is more than a small vending machine. It combines an edge device, content delivery, closed-loop inventory management, and cloud-based operations. The following design covers requirements, hardware, claim workflows, advertising, inventory, cloud architecture, and deployment without relying on a specific vendor or device model.
Requirements and Constraints
The central problem is unpredictable emergency demand: someone discovers there is no toilet paper or needs a sanitary pad unexpectedly. The terminal must offer a low-friction, fast collection process while supporting compliant advertising during the wait.
Deployment constraints include limited space, humidity, unreliable power and connectivity, manual replenishment, and low margins per transaction. Usage volume and advertising revenue must help spread operating costs. These constraints make four capabilities especially important:
- Operation during short connectivity outages
- A short, clear interaction flow
- Observable inventory
- Remote content updates
The commercial model can charge for tissues per dispensing transaction and sanitary pads per item, while selling advertising space across three display faces. Dispensing control, identity and entitlement validation, content playback, and inventory reporting should remain separate modules so they can evolve independently. Business rules should not be hard-coded into firmware.
Terminal Design and Interaction
The terminal hardware can be organized into the following components:
- A dispensing mechanism with vending-style product channels
- Displays on three sides and a mounting surface on the fourth
- QR-code and near-field interaction capabilities
- Temperature, humidity, door-contact, and weight sensors
- Local computing and communication modules
A bottom outlet helps reduce accidental contact and water accumulation. When idle, the displays rotate advertisements and collection QR codes. During a claim session, they switch to a short video or an instruction page.
Two collection paths can operate in parallel:
- Scan a QR code and watch a video lasting roughly a dozen seconds to unlock one dispensing action.
- Scan a QR code, complete a supported follow task and any required authorization, and collect an item.
In either case, the edge device should validate proof of task completion before driving the motor or solenoid. Popular video assets can be cached locally for playback under weak connectivity. The cloud issues short-lived tokens to prevent captured credentials from being reused.
Firmware should use an explicit state machine:
- Idle display
- QR-code session
- Playback or authorization
- Dispensing
- Fault lockout
If dispensing fails, the system must restore the claim entitlement and report the failure rather than consume a claim without delivering the item. Mechanical jams, empty compartments, and communication timeouts need clear user-facing indications and remote alerts.
Implementing the Claim Workflow
A single claim consists of identifying the terminal and product channel, creating a session, completing an advertising or authorization task, validating the result, dispensing the item, and recording the transaction.
The session identifier should bind the cabinet ID, product channel, validity window, and a one-time nonce. Cloud services can use a message queue to write transaction records asynchronously. Object storage holds short videos and content packages, while terminals periodically retrieve incremental content manifests.
Claim entitlements should be short-lived and consumable only once. For a follow-based workflow, describe the integration generically: after the user completes a designated follow task, a callback to the business service issues a claim entitlement. Availability depends on the relevant platform and its permitted integrations.
For video completion, the player reports a playback-progress hash or watermark heartbeat, and the server checks whether the required duration threshold has been met.
Dispensing commands must be signed and limited in use. The edge device validates the signature before activating the mechanism. Inventory deductions are confirmed only after successful dispensing.
During a network outage, the terminal may dispense within a predefined offline allowance and reconcile records afterward. The cloud assigns this allowance, and replenishment resets it, limiting abuse during prolonged disconnection.
The following endpoints illustrate an interface style; they are not actual proprietary API names:
POST /v1/sessions{ "device_id": "...", "sku": "tissue", "nonce": "..." }POST /v1/sessions/{id}/complete{ "task_type": "video", "proof": "..." }POST /v1/dispense{ "session_id": "...", "sig": "..." }
General-purpose logging, monitoring, and alerting services should track dispensing success rate, stockout rate, session conversion, and network availability.
Advertising and User Attention
Restroom settings can provide brief periods of focused attention, making short content and repeated exposure suitable formats. Advertising delivery should distinguish between idle rotation and task-based playback during collection:
- Idle rotation: Supports brand awareness.
- Claim-time playback: Provides the task required for an advertising-supported claim.
Content can be assigned by cabinet, time slot, and audience-segment tags. Frequency controls should prevent the same user from repeatedly encountering mandatory advertisements within a short period.
Content safety and compliance require asset review and traceable playback logs. Users should also be able to skip the advertising task by choosing paid collection.
Advertiser reporting can cover the exposure-to-completion-to-collection funnel. It should not promise unverified measures of advertising influence.
The three screens can serve different roles: one continuously displays the QR code and pricing, while the other two rotate advertisements. This keeps the collection entry point easy to find.
Inventory, Replenishment, and Operations
A low-margin, high-volume service depends on keeping products available. Inventory should be reconciled through three sources:
- Weight-sensor readings
- Dispensing counts
- Manual stock checks
The cloud generates replenishment tasks from consumption rates, with venue staff supporting refills. A maintenance application needs a cabinet list, location information, required refill quantities, and fault indicators. Inventory below a configured threshold should trigger an alert.
Tissues and sanitary pads have low material costs per claim, but profitability depends on usage frequency and advertising revenue. Later supplier arrangements can support replenishment. The data model should reserve fields for SKU, batch, and expiration date; sanitary pads require particular attention to shelf life and intact sealed packaging.
The service addresses an immediate, potentially embarrassing need and can reduce hygiene problems caused by missing supplies. Commercially, it combines product and advertising revenue. The long-term goal is dependable infrastructure with contextually relevant advertising, but engineering priorities should remain availability, replenishment, and auditability.
Cloud–Edge Architecture
A layered architecture keeps responsibilities clear:
- Edge layer: Display, dispensing, and short-term offline operation.
- Device access layer: Device authentication and command channels.
- Business layer: Sessions, advertising, inventory, and settlement.
- Data layer: Object storage for media, a relational database for master data, and time-series or log storage for telemetry.
Business and advertising-delivery services can run on a container platform to support regional scaling. Message queues decouple dispensing events, advertisement completion events, and replenishment work orders.
Monitoring and alerts should cover disconnected terminals, mechanical jams, empty compartments, and playback failures.
Device security should include unique identities, certificate rotation, signed firmware updates, and least-privilege access. For privacy, QR-code sessions should collect only the information needed for the workflow. The system should not collect biometric information unrelated to emergency supply access, and video progress data should be used only to validate task completion.
Capacity planning should estimate bandwidth and storage from the number of cabinets, daily claims, and media bitrates. Content can be precached before peak periods.
Roll out gradually: first validate the mechanical system and connectivity at a single location, then expand advertising workflows and support for multiple SKUs.
Deployment Considerations and Future Development
Prioritize sites with steady foot traffic, available power and connectivity, and convenient replenishment access. Installation should account for waterproofing and tamper resistance.
Pricing and the proportion of free claims should be configurable to control repeated abuse of promotional claims. Customer support and fault tickets need a closed-loop resolution process: a user who scans successfully but receives nothing can quickly lose trust in the service.
Future versions may add multiple dispensing channels, temperature control, accessible installation heights, and multilingual interfaces. Keep product channels abstracted and business rules configurable so these changes do not require redesigning the entire system.
Cloud dependencies can remain vendor-neutral, using object storage, message queues, container platforms, logging, and monitoring. If automated content review or voice prompts are needed, use general content-safety and speech capabilities without inventing unverified interfaces or performance figures.
The key is to implement emergency dispensing as a reliable state machine, advertising as a verifiable task, and inventory as an observable, closed-loop process. Cloud–edge coordination then supports replenishment and content delivery at scale. With these responsibilities separated into modules, developers can move from prototype to an operational terminal on a neutral technology stack.
