Project Info
Magic Table - Voice-Controlled Object Retrieval
A voice-controlled robotic system for accessibility. Uses computer vision to identify objects on a tabletop and an XY magnet gantry to drag them to a pickup zone.
Core use case: Accessibility for blind/mobility-impaired users — "voice-controlled physical retrieval" in a clean, magical demo.
How It Works
- Camera + Vision Model watches the tabletop, identifies objects (keys, phone, glasses, etc.), and tracks their (x, y) position
- XY Gantry with powerful magnets moves under the table surface
- Metal pucks attached to objects couple with magnets underneath
- Voice commands like "bring me the keys" route the magnet to pull that object to the pickup zone
Hardware Requirements
Electronics Stack
| Component | Purpose |
|---|---|
| Arduino Uno | Controller (runs GRBL firmware) |
| CNC Shield V3 | Motor driver interface (plugs onto Uno) |
| DRV8825 Drivers (x3) | Stepper motor drivers (X, Y, A slots) |
| 24V Power Supply | Motor power (NOT to Arduino!) |
| NEMA 17 Steppers (x3) | Two for Y-axis (ganged), one for X-axis |
| Webcam | Overhead view of table surface |
Mechanical Stack
| Component | Specification |
|---|---|
| 2020 Aluminum Extrusion | 400mm length (x3) |
| Linear Rails/V-wheels | For smooth gantry movement |
| GT2 Belts + Pulleys | Motion transmission |
| Strong Neodymium Magnets | Under-table magnet carriage |
| Metal Pucks | Attached to objects for magnetic coupling |
Wiring Diagram
┌─────────────────┐
│ 24V Power │
│ Supply │
└────────┬────────┘
│
┌────────────────────────┴────────────────────────┐
│ CNC Shield V3 │
│ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐ │
│ │ X │ │ Y │ │ Z │ │ A │ ← Drivers │
│ │DRV │ │DRV │ │empty│ │DRV │ │
│ └──┬──┘ └──┬──┘ └─────┘ └──┬──┘ │
│ │ │ │ │
│ Motor Motor Motor │
│ #3 #1 #2 │
│ (X) (Y) (Y clone) │
│ │
│ Set A→Y jumper to clone A axis to Y! │
└─────────────────────────────────┬──────────────┘
│ (sits on top)
┌─────────────────┴──────────────┐
│ Arduino Uno │
│ (GRBL) │
└─────────────────┬──────────────┘
│ USB
┌─────────────────┴──────────────┐
│ Computer │
│ (runs this Python code) │
└────────────────────────────────┘
Software Setup
1. Flash GRBL to Arduino
- Download GRBL
- Flash to Arduino Uno via Arduino IDE
- Configure GRBL settings (see below)
2. Install Python Dependencies
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # Linux/Mac
# .venv\Scripts\activate # Windows
# Install dependencies
Note for macOS: PyAudio may require portaudio:
brew install portaudio
pip install pyaudio
3. Configure Serial Port
Edit config.py and set the correct serial port:
# macOS
port: str = "/dev/tty.usbmodem1101"
# Linux
port: str = "/dev/ttyUSB0"
# Windows
port: str = "COM3"
Find your port:
# macOS/Linux
ls /dev/tty.*
# Or use Python
python -c "from grbl_controller import GRBLController; print(GRBLController.list_ports())"
4. GRBL Configuration
Connect via serial terminal (115200 baud) and configure:
$100=160 # X steps/mm (adjust for your setup)
$101=160 # Y steps/mm
$110=5000 # X max rate mm/min
$111=5000 # Y max rate mm/min
$120=500 # X acceleration mm/sec^2
$121=500 # Y acceleration
$130=400 # X max travel mm
$131=400 # Y max travel mm
Usage
Run Full System
python main.py
Test Individual Components
# Test vision only (no motor/voice)
python main.py --test-vision
# Test voice recognition
python main.py --test-voice
# Test motor control
python main.py --test-motor
# Run without voice
python main.py --no-voice
# Run without motor (vision demo)
python main.py --no-motor
Calibrate Camera-to-Gantry Mapping
python main.py --calibrate
This walks you through clicking four corners to map camera pixels to physical coordinates.
Motor Sweep Calibration (recommended for motion accuracy)
# Default 4x3 sweep grid (12 points)
python main.py --calibrate-motor
# Denser grid for higher accuracy
python main.py --calibrate-motor --cal-grid-x 5 --cal-grid-y 4
The gantry automatically moves across the board. At each stop, click the magnet in the camera view.
This records many pixel->physical pairs and saves an improved homography in calibration_data.json.
Voice Commands
| Command | Action |
|---|---|
| "bring me the keys" | Fetch keys to pickup zone |
| "get my phone" | Fetch phone to pickup zone |
| "where is the wallet" | Highlight wallet location |
| "stop" | Emergency stop |
| "go home" | Return magnet to home position |
You can also just say the object name: "keys", "phone", "glasses"
Detectable Objects
Default objects (configurable in config.py):
- keys
- airpods
- phone
- wallet
- pill bottle
- glasses
- remote
- pen
- cup
File Structure
treehacks2026/
├── main.py # Main orchestration
├── config.py # Configuration settings
├── grbl_controller.py # Arduino/GRBL serial control
├── object_tracker.py # Vision-based object detection
├── voice_control.py # Speech recognition
├── calibration.py # Camera-to-gantry calibration
├── requirements.txt # Python dependencies
└── README.md # This file
Troubleshooting
Camera not found
- Check camera index in
config.py(try 0, 1, 2) - Ensure no other app is using the camera
Motor not responding
- Check USB connection
- Verify serial port in
config.py - Ensure GRBL is flashed correctly
- Check 24V power to CNC shield
Voice not recognized
- Ensure microphone is working
- Calibrate ambient noise (automatic on startup)
- Speak clearly and at normal volume
- Check internet connection (uses Google Speech API)
Object detection poor
- Improve lighting (even, diffused)
- Adjust
score_thresholdin config (lower = more sensitive) - Try different objects/backgrounds
- Camera should be overhead with clear view
Development
Architecture
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Voice │ │ Vision │ │ Motor │
│ Controller │ │ Tracker │ │ Controller │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
│ ┌───────────────┴───────────────┐ │
└────► MagicTable (main.py) ◄────┘
│ - Orchestrates components │
│ - Coordinate transforms │
│ - Command processing │
└──────────────────────────────┘
Adding New Objects
Edit config.py:
@dataclass
class DetectionConfig:
prompts: list = None
def __post_init__(self):
if self.prompts is None:
self.prompts = [
"keys",
"phone",
"your_new_object", # Add here
]
License
MIT License - TreeHacks 2026
Credits
- Zero-shot object detection: GroundingDINO
- Motor control: GRBL
- Speech recognition: SpeechRecognition
Analysis
View
Metric
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- CSSIn code
- FlaskIn code
- Hugging FaceIn code
- JavaScriptIn code
- Next.jsIn code
- OpenAIIn code
- PythonIn code
- PyTorchIn code
- ReactIn code
- Tailwind CSSIn code
- TypeScriptIn code
- VercelClaimed
12 of 13 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- CursorCommits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
269 KB
Source files
22
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
Jaybear411/treehacks2026
33 files · 458 KB · @ 3915f5b
Structure
Interface
4 files · 12%Screens, components and styles rendered to the user.
Application logic
16 files · 48%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python93%
- Markdown3%
- TypeScript3%
- CSS0%
- JavaScript0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
requirements.txt
pypi · 16- anthropic
- elevenlabs
- flask
- flask-cors
- numpy
- openai
- opencv-python
- pillow
- pyaudio
- pynput
- pyserial
- python-dotenv
- SpeechRecognition
- torch
- torchvision
- transformers
magic-table-web/package.json
npm · 10- next
- react
- react-dom
- +7 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.