Skip to content

Kronbii/smart-interactive-desk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

228 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ“ Smart Interactive Desk - Senior Graduation Project

An IoT-Enabled, AI-Powered Smart Desk System with Multi-Device Communication, Posture Correction, and Interactive Learning Features

Status Hardware Software


๐Ÿค– Smart Interactive Desk

Smart Interactive Desk Demo

Watch the Smart Interactive Desk in action!
Experience automatic height adjustment, posture correction, multi-interface control, and seamless IoT connectivity in this cinematic demonstration.


๐ŸŽฅ Demo Video

Smart Interactive Desk Demo

Click the image above to watch the full demonstration video on YouTube


๐Ÿ“‹ Table of Contents


๐ŸŽฏ Project Overview

The Smart Interactive Desk (BEMO) is a comprehensive IoT-enabled workstation system designed for modern classrooms, offices, and collaborative learning environments. This senior graduation project integrates hardware control, computer vision, artificial intelligence, network communication, and ergonomic assistance into a unified, intelligent desk system.

What Makes This Project Special?

  • ๐Ÿค– Full-Stack IoT System: Complete integration from hardware firmware to web interfaces
  • ๐ŸŒ Multi-Device Communication: Desks can communicate with each other across classrooms via WiFi
  • ๐Ÿ“ฑ Multiple Control Interfaces: Web app, desktop GUI, Bluetooth controller, and manual buttons
  • ๐Ÿง  AI-Powered Features: Handwriting recognition using Microsoft TrOCR, computer vision for posture monitoring
  • ๐Ÿƒ Automatic Posture Correction: Real-time sensor feedback with motorized height and tilt adjustment
  • ๐Ÿ“Š Comprehensive Analytics: Usage statistics, posture tracking, and data logging
  • ๐ŸŽจ Modern UI/UX: Custom-built GUI with theming support and responsive web interface

๐Ÿ‘ฅ Team Members

  • Rami Kronbi
  • Bassam Kousa
  • Ali Daaboul
  • Mohamad Berjawi
  • Mohamad Hariri

โœจ Key Features

๐Ÿƒ Ergonomic & Health Features

  • Motorized Standing Desk

    • Automatic height adjustment (80-100cm range)
    • Tilt adjustment for optimal viewing angle
    • Safety limits and position feedback
    • Real-time height and angle display on LCD
  • Automatic Posture Correction

    • Ultrasonic sensors for height measurement
    • ToF (Time-of-Flight) sensors for tilt detection
    • Kalman filtering for sensor data smoothing
    • Real-time posture monitoring and alerts
    • Automatic desk adjustment based on user position

๐ŸŒ Connectivity & Communication

  • WiFi Connectivity

    • Network-enabled communication between desks
    • Cross-classroom desk-to-desk messaging
    • Real-time status synchronization
  • Bluetooth Support

    • PS4 controller integration for desk control
    • Wireless control interface
  • Web-Based Control

    • Responsive web interface accessible from any device
    • Real-time Socket.io communication
    • RESTful API for desk control
    • Multi-user support with user database
  • AirDrop-like File Sharing

    • Network-based file transfer between desks
    • Seamless document sharing in classroom environments

๐ŸŽจ Interactive Features

  • Desktop GUI Application

    • Modern Tkinter-based interface
    • Customizable themes and styling
    • Multi-page navigation (Home, Notes, Music, Lists, Alarm, Settings)
    • Real-time desk status display
  • Notes & AI Integration

    • Handwriting capture via webcam
    • AI-powered text recognition using Microsoft TrOCR
    • Image segmentation and processing
    • Digital note-taking and storage
  • Music Player

    • Built-in audio playback
    • Play, pause, stop controls
    • File browser integration
  • Task Management

    • To-do lists and reminders
    • Alarm system with notifications
    • User-specific task storage

๐Ÿ”ง Hardware Control

  • Dual Motor System

    • Height adjustment motor (PWM controlled)
    • Tilt adjustment motors (dual motor control)
    • Safety interlocks and position limits
  • Sensor Array

    • Ultrasonic sensors (HC-SR04) for height measurement
    • VL53L0X ToF sensors for precise distance measurement
    • Manual control buttons with interrupt handling
  • Display System

    • Nokia 5110 LCD display (84x48 pixels)
    • Real-time height and tilt angle display
    • Status messages and welcome screen

๐Ÿ—๏ธ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Smart Interactive Desk                    โ”‚
โ”‚                      System Architecture                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Web App    โ”‚      โ”‚  Desktop GUI โ”‚      โ”‚   Bluetooth   โ”‚
โ”‚  (Node.js)   โ”‚โ—„โ”€โ”€โ”€โ”€โ–บโ”‚   (Python)   โ”‚โ—„โ”€โ”€โ”€โ”€โ–บโ”‚   Controller  โ”‚
โ”‚              โ”‚      โ”‚              โ”‚      โ”‚               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                     โ”‚
       โ”‚  Socket.io / HTTP   โ”‚
       โ”‚                     โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚   Flask API Bridge  โ”‚
       โ”‚    (Python/Flask)   โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
                  โ”‚ Serial/USB
                  โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚   ESP32/Arduino    โ”‚
       โ”‚   Microcontroller   โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                  โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚          โ”‚          โ”‚
   โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”
   โ”‚Motors โ”‚  โ”‚Sensorsโ”‚  โ”‚Displayโ”‚
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Communication Flow

  1. User Input โ†’ Web App / GUI / Bluetooth Controller
  2. Command Processing โ†’ Node.js Server / Python GUI
  3. API Bridge โ†’ Flask API (localhost:5001)
  4. Serial Communication โ†’ ESP32/Arduino (115200 baud)
  5. Hardware Control โ†’ Motors, Sensors, Display
  6. Feedback Loop โ†’ Sensor data โ†’ Display โ†’ User Interface

๐Ÿ’ป Technology Stack

Backend & Firmware

  • Python 3.x

    • Flask (REST API)
    • Tkinter (Desktop GUI)
    • PySerial (Serial communication)
    • OpenCV (Computer vision)
    • Pygame (Audio playback)
    • Transformers (AI/ML - TrOCR)
    • NumPy (Image processing)
    • PyYAML (Configuration)
  • Node.js

    • Express.js (Web server)
    • Socket.io (Real-time communication)
    • CORS (Cross-origin support)
  • Arduino/ESP32 (C++)

    • Hardware abstraction
    • Motor control libraries
    • Sensor libraries (NewPing, Adafruit_VL53L0X)
    • LCD display drivers (Adafruit_PCD8544)

Frontend

  • HTML/CSS/JavaScript

    • Responsive web interface
    • Real-time updates via Socket.io
    • Modern UI components
  • Tkinter (Python)

    • Custom GUI framework
    • Theming system
    • Multi-page navigation

AI/ML

  • Microsoft TrOCR (Transformer-based OCR)

    • Handwritten text recognition
    • Image-to-text conversion
  • OpenCV

    • Image segmentation
    • Computer vision processing
    • Webcam integration

๐Ÿ”Œ Hardware Components

Microcontroller

  • ESP32 or Arduino Mega (primary controller)

Actuators

  • 2x DC Motors (height adjustment)
  • 2x DC Motors (tilt adjustment)
  • Motor drivers (H-bridge configuration)

Sensors

  • 2x HC-SR04 Ultrasonic Sensors (height and tilt measurement)
  • 2x VL53L0X Time-of-Flight Sensors (precise distance measurement)
  • 4x Manual Control Buttons (up, down, tilt up, tilt down)

Display

  • Nokia 5110 LCD (84x48 pixel monochrome display)

Communication

  • WiFi Module (ESP32 built-in or external)
  • Bluetooth Module (for PS4 controller)

๐Ÿš€ Installation & Setup

Prerequisites

  • Python 3.8+
  • Node.js 14+
  • Arduino IDE (for firmware upload)
  • USB-to-Serial driver (for ESP32/Arduino communication)

Step 1: Clone the Repository

git clone https://github.com/Kronbii/smart-interactive-desk.git
cd smart-interactive-desk

Step 2: Install Python Dependencies

pip install -r requirements

Note: The requirements file contains:

  • serial / pyserial
  • opencv-python
  • python-box
  • tkinter (usually pre-installed)
  • ttkinter
  • numpy

Additional dependencies (install separately):

pip install flask pygame transformers torch pillow pyyaml

Step 3: Install Node.js Dependencies

cd model/web-app
npm install

Step 4: Configure Serial Port

Edit model/config.yaml or config.yaml to set your serial port:

serial:
  port1: "/dev/ttyUSB0"  # Linux
  # port1: "COM3"        # Windows
  baudrate: 115200
  timeout: 1

Step 5: Upload Firmware

  1. Open model/esp/esp.ino in Arduino IDE
  2. Select your board (ESP32 or Arduino Mega)
  3. Select the correct COM port
  4. Upload the firmware

Step 6: Launch the System

Option A: Using Launch Script

cd model
chmod +x launch.sh
./launch.sh

Option B: Manual Launch

# Terminal 1: Start Node.js web server
cd model/web-app
npm start

# Terminal 2: Start Python GUI
cd model
python3 -m gui.main

Step 7: Access the Web Interface

Open your browser and navigate to:

  • Web Interface: http://localhost:3000 (or your local IP)
  • Desktop GUI: Launches automatically when running gui.main

๐Ÿ“ Project Structure

smart-interactive-desk/
โ”‚
โ”œโ”€โ”€ model/                          # โœ… Production code (use this)
โ”‚   โ”œโ”€โ”€ esp/                        # ESP32/Arduino firmware
โ”‚   โ”‚   โ”œโ”€โ”€ esp.ino                 # Main firmware code
โ”‚   โ”‚   โ””โ”€โ”€ bemo.h                  # Hardware definitions & classes
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ gui/                        # Desktop GUI application
โ”‚   โ”‚   โ”œโ”€โ”€ main.py                 # GUI entry point & Flask API
โ”‚   โ”‚   โ”œโ”€โ”€ home.py                 # Home page with controls
โ”‚   โ”‚   โ”œโ”€โ”€ notes.py                # Notes & AI features
โ”‚   โ”‚   โ”œโ”€โ”€ music.py                # Music player
โ”‚   โ”‚   โ”œโ”€โ”€ lists.py                # Task management
โ”‚   โ”‚   โ”œโ”€โ”€ alarm.py                # Alarm system
โ”‚   โ”‚   โ”œโ”€โ”€ setting.py              # Settings page
โ”‚   โ”‚   โ”œโ”€โ”€ control.py              # Desk control interface
โ”‚   โ”‚   โ”œโ”€โ”€ web.py                  # Web integration
โ”‚   โ”‚   โ””โ”€โ”€ icons/                  # GUI icons
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ notes/                      # AI & Computer Vision
โ”‚   โ”‚   โ”œโ”€โ”€ ai.py                   # TrOCR handwriting recognition
โ”‚   โ”‚   โ”œโ”€โ”€ segment.py              # Image segmentation
โ”‚   โ”‚   โ””โ”€โ”€ notes.py                # Notes processing
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ web-app/                    # Web interface
โ”‚   โ”‚   โ”œโ”€โ”€ server.js               # Node.js/Express server
โ”‚   โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ index.html          # Web UI
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ script.js           # Client-side logic
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ styles.css          # Styling
โ”‚   โ”‚   โ””โ”€โ”€ package.json            # Node dependencies
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ config.yaml                 # Configuration file
โ”‚   โ”œโ”€โ”€ control.json                # Control state storage
โ”‚   โ”œโ”€โ”€ users.json                  # User database
โ”‚   โ””โ”€โ”€ launch.sh                   # Launch script
โ”‚
โ”œโ”€โ”€ koubeisically/                  # โŒ Deprecated (early prototype)
โ”‚   โ””โ”€โ”€ src/                        # Old Python modules
โ”‚
โ”œโ”€โ”€ bash-scripts/                    # Utility scripts
โ”‚   โ”œโ”€โ”€ bluetooth.sh                # Bluetooth setup
โ”‚   โ”œโ”€โ”€ run_pipeline.sh             # Pipeline execution
โ”‚   โ””โ”€โ”€ web.sh                      # Web server management
โ”‚
โ”œโ”€โ”€ website/                         # Project website
โ”‚   โ”œโ”€โ”€ website.html                # Main page
โ”‚   โ”œโ”€โ”€ pages/                      # Additional pages
โ”‚   โ””โ”€โ”€ styles/                     # Website styling
โ”‚
โ”œโ”€โ”€ readme/                          # Documentation
โ”‚   โ”œโ”€โ”€ install-node                # Node.js installation guide
โ”‚   โ”œโ”€โ”€ remove-sudo-passwd          # System setup
โ”‚   โ””โ”€โ”€ static-ip                   # Network configuration
โ”‚
โ”œโ”€โ”€ user-database/                   # User data storage
โ”‚   โ””โ”€โ”€ users.json
โ”‚
โ”œโ”€โ”€ config.yaml                     # Root configuration
โ”œโ”€โ”€ requirements                     # Python dependencies
โ””โ”€โ”€ README.md                        # This file

Important Notes

  • โœ… model/ - This is the production-ready code. Use this directory for all development and deployment.
  • โŒ koubeisically/ - Deprecated early prototype. Kept for reference only.
  • ๐Ÿ“ Configuration - Edit model/config.yaml for serial ports, themes, and system settings.

๐ŸŽฎ Usage

Web Interface

  1. Start the servers (see Installation)
  2. Open browser to http://localhost:3000
  3. Control the desk using the web interface buttons
  4. Monitor status in real-time via Socket.io updates

Desktop GUI

  1. Launch python3 -m gui.main
  2. Navigate using the sidebar menu
  3. Control desk from the Home page
  4. Access features:
    • ๐Ÿ“ Notes: Capture and recognize handwriting
    • ๐ŸŽต Music: Play audio files
    • โœ… Lists: Manage tasks
    • โฐ Alarm: Set reminders
    • โš™๏ธ Settings: Configure preferences

Bluetooth Controller (PS4)

  1. Pair your PS4 controller via Bluetooth
  2. Run the controller script (if available)
  3. Use arrow keys to control desk height and tilt

Manual Control

  • Physical buttons on the desk allow direct control
  • Safety limits prevent over-extension
  • LCD display shows current height and tilt angle

๐Ÿ“š Project Resources

For detailed documentation, reports, and project resources, visit:

Project Resources - Google Drive

This includes:

  • Project proposal and design documents
  • Technical specifications
  • User manuals
  • Presentation materials
  • Research papers and references

๐Ÿค Contributing

This is a senior graduation project. While contributions are welcome, please note:

  1. Main branch contains the production code in model/
  2. Documentation improvements are always appreciated
  3. Bug reports should include:
    • Hardware configuration
    • Software versions
    • Error logs
    • Steps to reproduce

๐Ÿ“Š Project Statistics

  • Lines of Code: 10,000+ (across all components)
  • Languages: Python, JavaScript, C++ (Arduino), HTML/CSS
  • Components: 15+ major modules
  • Hardware Interfaces: 4+ (Serial, WiFi, Bluetooth, USB)
  • AI/ML Models: 1 (Microsoft TrOCR)
  • Development Time: Full academic year

๐ŸŽ“ Academic Context

This project was developed as a Senior Graduation Project demonstrating:

  • Full-stack development capabilities
  • IoT system integration
  • Hardware-software interfacing
  • AI/ML implementation
  • Network programming
  • Real-time systems
  • User interface design

๐Ÿ“„ License

This project is developed for academic purposes. All rights reserved by the project team.


๐Ÿ™ Acknowledgments

  • Microsoft for TrOCR model
  • Adafruit for sensor libraries
  • OpenCV community
  • Arduino and ESP32 communities
  • Faculty advisors and reviewers

๐Ÿ“ž Contact

For questions or inquiries about this project, please contact the team members or refer to the project resources link above.


Built with โค๏ธ by the Smart Interactive Desk Team

Last Updated: 2024

About

End-to-end IoT and AI-powered smart workstation system integrating embedded hardware, real-time sensor fusion, motor control, computer vision, and multi-platform software interfaces to deliver automated posture correction, interactive learning features, and networked desk-to-desk communication.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors