Do Not Disturb — Focus-Aware Robotic Arm

A four-minute BCI experiment that combines EEG-derived focus signals, real-time visualization, and a two-axis face-tracking robot.

Technologies Used

RoboticsBCIComputer VisionEEGPID ControlPythonResearch
⋮⋮

Table of Contents

The idea

Interruptions are not always bad; they are frustrating mainly when they break a period of real concentration. I built Do Not Disturb to explore whether a machine could notice that difference and communicate it without asking the user to stop working.

The project began during a four-day hackathon. I slept very little, broke two motors before adding proper limits, and spent a large part of the final night chasing serial-communication problems. It was exhausting, but it was also the project that convinced me to keep working in robotics. The finished prototype won first place in the competition’s Brain Interaction robotics category.

Reading the user’s state

An EMOTIV Insight headset supplies six performance measures: attention, engagement, excitement, interest, stress, and relaxation. The Python pipeline combines them into a weighted score, with attention carrying the largest weight and relaxation reducing the result. A score above 0.44 is treated as a focused state.

The classifier runs every two seconds during a four-minute session. A short moving average reduces noise, while peak and gradient analysis help describe when a focus interval begins and ends. The raw readings and classifications can be exported to CSV, and a summary plot shows the score against the decision threshold.

The robotic signal

When the system identifies a focused state, a camera and two-axis robot turn toward an approaching person. The vision code uses YOLOv8n to find people, estimates a face region from the upper part of the selected body box, and tracks the largest target when several people are visible.

A PID controller converts the target’s offset from the image center into horizontal and vertical servo commands. If detection drops for a moment, a two-second lock holds the last target instead of immediately jumping elsewhere. Mechanical angle limits and a home-position routine were added after early tests exposed how quickly a bad control value could damage a servo.

Interface and integration

A small browser dashboard receives state updates over WebSockets and displays the current classification, attention, engagement, and combined score. I designed it to work on both a laptop and a phone on the same local network, which made the experiment easier to observe without crowding the robot.

The difficult part was integration. EEG data, camera inference, a real-time control loop, serial commands, and a web interface all operate at different rates. Building explicit boundaries between those loops—and adding safe behavior when any one of them stalls—mattered more than making an individual model more complicated.

The public repository contains the robot-control code, setup notes, dependencies, and a longer technical description.