IoT Smart Locker System | Remote Access & Monitoring by Muhammad UsmanIoT Smart Locker System | Remote Access & Monitoring by Muhammad Usman

IoT Smart Locker System | Remote Access & Monitoring

Muhammad Usman

Muhammad Usman

Project Overview

The Smart Locker Box Management System is an IoT-based platform designed to manage small cabinet lockers through a connected ecosystem of hardware sensors, embedded firmware, and a cloud-based management dashboard. The system enables remote monitoring, access control, and real-time status tracking for locker units deployed across multiple locations.
Built for facility managers, coworking spaces, logistics hubs, and parcel delivery networks, the platform replaces manual key-based locker management with a fully digital, sensor-driven workflow.

The Problem

Traditional locker systems rely on physical keys or static PIN codes, creating several operational pain points:
No visibility into locker occupancy or usage patterns across locations
Manual intervention required for every lock/unlock event, lost key, or code reset
Zero audit trail for access events, making accountability difficult
No remote management capability for facility operators managing multiple sites
Scaling friction when adding new locker units or locations to the network
The client needed a system that could bring real-time intelligence to their locker infrastructure while keeping the hardware footprint small enough for compact cabinet-style units.

The Solution

IoT Hardware Layer

Each locker unit is equipped with:
Electromagnetic lock module controlled via microcontroller (ESP32-based)
Proximity sensor for detecting occupancy status (empty/occupied)
NFC/RFID reader for contactless user authentication at the locker
Status LED indicators for visual feedback (available, occupied, locked, error)
Wi-Fi connectivity module for real-time communication with the cloud backend
The firmware handles local lock/unlock logic, sensor polling, heartbeat signals to the server, and graceful offline fallback when connectivity drops.

Cloud Backend & API

The server-side architecture powers all remote operations:
RESTful API built with Node.js and Express for device registration, access control commands, and telemetry ingestion
MQTT broker for lightweight, real-time device-to-cloud messaging (lock events, sensor readings, heartbeats)
PostgreSQL database for structured storage of locker configurations, user access logs, and location hierarchies
Redis caching layer for fast locker status lookups and session management
WebSocket connections for pushing live status updates to the admin dashboard

Admin Dashboard (Web Application)

A responsive web dashboard built with React.js gives facility managers full control:
Real-time locker grid view showing occupancy, lock state, and health status across all locations
Remote lock/unlock controls with confirmation dialogs and audit logging
User management with role-based access (admin, operator, viewer)
Access history timeline with filterable logs per locker, user, or location
Alert system for hardware faults, connectivity drops, unauthorized access attempts, and maintenance reminders
Analytics dashboard with occupancy heatmaps, peak usage hours, and utilization rates per location
Multi-location management with site grouping and bulk operations

Mobile App (User-Facing)

End users interact with lockers through a companion mobile application:
QR code / NFC tap to unlock assigned lockers
Real-time notifications for locker assignments, access confirmations, and expiry reminders
Booking system for reserving lockers in advance with configurable time slots
Access history showing personal usage logs

Technical Architecture

[Locker Hardware (ESP32 + Sensors)] | [MQTT / Wi-Fi] | [MQTT Broker] ←→ [Node.js API Server] ←→ [PostgreSQL + Redis] | ┌───────────┼───────────┐ | | | [React Dashboard] [Mobile App] [Webhook Integrations]

Key Technical Decisions

MQTT over HTTP for device communication: MQTT's lightweight publish/subscribe model is ideal for constrained IoT devices. It reduces bandwidth, supports QoS levels for reliable delivery, and handles intermittent connectivity gracefully.
ESP32 as the microcontroller: Cost-effective, built-in Wi-Fi/Bluetooth, sufficient GPIO pins for lock control and sensor inputs, and strong community support for OTA firmware updates.
PostgreSQL for structured data: Access logs, user permissions, and location hierarchies benefit from relational integrity and complex query support.
Redis for real-time status: Locker state lookups need sub-millisecond response times for the dashboard grid view. Redis serves as the single source of truth for current device state.
WebSockets for dashboard updates: Polling hundreds of lockers would be wasteful. WebSocket connections push state changes to connected admin clients instantly.

Challenges & Solutions

Challenge 1: Offline Resilience

Lockers deployed in basements or areas with spotty Wi-Fi needed to function even when disconnected from the cloud.
Solution: Implemented local access control logic on the ESP32 firmware. The device caches the last-known authorized user list and processes NFC/RFID authentication locally. When connectivity resumes, queued events sync to the server automatically.

Challenge 2: Secure Access Control

Physical security systems demand tamper-resistant authentication to prevent unauthorized access.
Solution: Implemented end-to-end encrypted communication between devices and the server using TLS. NFC tokens use rolling codes rather than static IDs. The API enforces time-bound access tokens that expire after the reservation window closes.

Challenge 3: Scalability Across Locations

The system needed to support hundreds of locker units across multiple physical sites without degrading dashboard performance.
Solution: Designed the backend with location-scoped data partitioning. MQTT topics are namespaced by site, and the dashboard lazy-loads locker grids per selected location. Redis handles the hot path for status queries, keeping PostgreSQL reserved for historical and analytical workloads.

Results & Impact

100% remote management capability, eliminating on-site visits for routine lock/unlock operations
Real-time visibility across all deployed locker units from a single dashboard
Sub-second lock response time from user tap to electromagnetic lock release
Automated alerting reduced hardware downtime by catching connectivity and sensor faults early
Scalable architecture supporting multi-site deployments with independent location management

My Role

I led the full-stack development of this project, covering:
System architecture design spanning IoT hardware integration, cloud backend, and client applications
Backend API development with Node.js, MQTT broker configuration, and database schema design
Frontend dashboard development with React.js, including real-time data visualization
IoT device communication protocol design and firmware integration planning
Security implementation including encrypted device communication and token-based access control
UI/UX design for both the admin dashboard and the mobile companion app
Like this project

Posted Jul 3, 2026

IoT smart locker platform with ESP32 hardware, MQTT messaging, Node.js backend, and React dashboard. Remote lock/unlock, NFC auth, occupancy tracking.