An IoT-based smart desk occupancy system that detects whether a desk is in use and displays the data through a backend API and a web dashboard.
This project uses an ESP32 to collect occupancy data, a backend service to process and store it, and a frontend application to visualize desk usage in real time.
- Real-time desk occupancy detection
- ESP32 microcontroller with sensor integration
- Backend API for data ingestion and retrieval
- Web dashboard for visualization
- Modular and scalable system design
Smart-Desk-Occupancy-System
├── backend/ # Backend API & services
├── esp32/
│ └── deskOccupancySystem/ # ESP32 firmware
└── frontend/ # Web dashboard
The ESP32 firmware is responsible for:
- Reading sensor data
- Determining desk occupancy
- Sending occupancy updates to the backend over Wi-Fi
- Install Arduino IDE or PlatformIO
- Select your ESP32 board
- Configure Wi-Fi credentials and backend URL in the code
- Connect the occupancy sensor to the ESP32 GPIO pins
- Flash the firmware to the board
The backend receives occupancy data from the ESP32 and exposes APIs for the frontend.
- Receive sensor data
- Store desk occupancy state
- Provide APIs for current and historical data
cd backend
npm install # or pip install -r requirements.txt
npm start # or python app.py| Endpoint | Method | Description |
|---|---|---|
| /api/occupancy | POST | Submit occupancy data |
| /api/occupancy | GET | Get current desk status |
| /api/history | GET | Retrieve occupancy history |
The frontend displays desk occupancy data in real time.
- Live desk availability
- Simple dashboard UI
- Scalable for multiple desks
cd frontend
npm install
npm start- ESP32 Development Board
- Occupancy sensor (PIR, pressure, or ultrasonic)
- USB power source or battery
- Test backend APIs using Postman or curl
- Simulate sensor payloads
- Verify UI updates in real time
- Authentication and security
- Advanced analytics and reporting
- Calendar and office system integrations
Marmik Patel