University of Duhok · Biomedical Engineering

EEG Brain–Computer Interface

Control a machine with your mind — no movement, no touch.

One electrode on the forehead reads your concentration. A fan speeds up. A ball rises inside a tube. Nothing is pressed, spoken or moved.

Selected for MEDICO 2026, Erbil · MedStar section

University of Duhok Technische Hochschule Mittelhessen MEDICO 2026 — Erbil International Health Exhibition MedStars

The poster

The whole project on one sheet. This is not the poster that was shown at the 13th Engineering Design Day — it has been revised since, to match the improvements made after the event: the soldered board in place of the breadboard, the smaller fan on a battery, and the new nozzle and tube. It is a large-format poster, so open it full size to read it properly; the version below is an overview.

The project poster: title, abstract, system architecture diagram, hardware component list with photographs, a five-step methodology flow, photographs of the dashboard and the system in use, results, conclusion and references.
Open the poster at full size — 2400 px

Looking for the version actually presented at the event? The old poster, as shown at the 13th Engineering Design Day

How it works

Five steps, from a thought to a moving motor.

  1. Your brain

    Thinking makes neurons fire together. That produces electrical activity at the scalp measured in millionths of a volt.

  2. The headset

    A NeuroSky MindWave Mobile 2 — one dry electrode on the forehead, one clip on the ear. It splits the signal into eight frequency bands and sends them over Bluetooth, once a second.

  3. The laptop

    A Python program weighs the focus bands (Beta) against the relaxation bands (Alpha and Theta). The ratio becomes one number between 0 and 100, sent to the microcontroller every 30 milliseconds.

  4. The ESP32

    That number sets how fast the fan turns, using 25 kHz PWM through a MOSFET. The switching frequency sits above human hearing, so the fan is silent.

  5. The fan and tube

    Air rises through a 3D-printed nozzle and holds a 2.7 g ping-pong ball in the air. Concentrate and it climbs. Relax and it falls. The whole loop takes 60–100 milliseconds.

Try the mapping

Drag to change the focus value. The duty cycle is calculated exactly the way the firmware on the ESP32 calculates it. The tube is an illustration.

55% focus

185/ 255 duty cycle

Fan running

Why this matters in healthcare

The ball is only there so you can see the signal. What the project actually built is a control channel that starts in the brain and ends at a motor — and a motor is the part that does the work in a wheelchair, in a prosthetic hand, in almost any assistive device.

A prosthetic hand

Take the fan off the end and put a robotic hand there instead. The same number from 0 to 100 that sets fan speed can set how far the fingers close. This is the project's declared next step.

Moving a wheelchair

A powered wheelchair needs exactly what the fan needs: a motor told how fast to turn. For someone who cannot hold or push a joystick, concentration is a control input that does not require a hand.

Asking for something

Put four options on a screen — water, food, help, move me — and let the focus level choose between them. For a person with ALS or a spinal-cord injury who has lost movement but not thought, that is a way to be understood without speaking.

Said plainly: none of those three are built yet, and a single electrode can only tell how hard someone is concentrating — not what they are thinking. What is built and working is the layer everything above would stand on: brain to motor, in under a tenth of a second, from parts anyone can buy.

The prototype

The build has changed since it was first shown. The electronics have moved off the breadboard onto a soldered board inside a 3D-printed brain-shaped enclosure, and the big bench-powered fan has been replaced by a small one running on batteries. The first four photos are the current version. The last is the stand running at the 13th Engineering Design Day, University of Duhok, before those changes.

The team

The two students and their supervisor standing behind the project stand, with the tube and the dashboard monitor on the table in front of them.
The team with their supervisor at the 13th Engineering Design Day, University of Duhok.
Ali Azhar Dewali and Mansour Azad standing either side of the project poster on an easel, each holding a certificate of participation.
Ali Azhar Dewali (left) and Mansour Azad (right) with their certificates of participation and the project poster.

Supervisor

Dr. Soleen Jaladet Al-Sofi

Department of Biomedical Engineering, College of Engineering, University of Duhok

soleen.alsofi@uod.ac

Ali Azhar Dewali

Project team

ali.azhar.dewali@gmail.com
+964 750 792 4022

Mansour Azad

Project team

mansoor.ai2423@stu.uod.ac
+964 750 166 8669

Department of Biomedical Engineering · College of Engineering · University of Duhok

Technical details

Technical details Components, the focus formula, timing, test results, limitations

Full project title: EEG-Based Motor Speed Control System Using a Brain–Computer Interface

Components

Bill of materials
PartRole
NeuroSky MindWave Mobile 2Single dry electrode at Fp1 with an ear-clip reference. Sends 8 band powers over Bluetooth
ESP32-WROOM-32Receives the focus value over USB serial and generates the PWM
Q1 — IRLZ44NLogic-level N-channel MOSFET, low-side switch for the fan
D1 — SS36Schottky flyback diode across the fan, cathode to V+. Clamps the inductive spike when the fan switches off
R1 — 220 ΩLimits gate inrush current during fast switching
R2 — 6.8 kΩGate pull-down. Holds the MOSFET off whenever the ESP32 pin is not actively driving it, including during reset and boot
C1Ceramic snubber capacitor across the fan, in parallel with D1. Damps high-frequency switching noise.
Small DC fanAirflow source, driven by PWM from the battery rail
Battery pack (V+ ≈ 4.2 V)Powers the fan through connector J1. The rig is self-contained — no bench supply
Ping-pong ball (2.7 g, 40 mm)Makes the signal visible
3D-printed nozzle and tubePLA, designed in Fusion 360. Directs the airflow and re-centres the ball

Circuit

  • ESP32 GPIO4 → R1 220 Ω → gate of Q1
  • R2 6.8 kΩ from the gate to GND, so the gate is never left floating
  • Q1 drain → FAN− · Q1 source → GND, shared with the ESP32 and the battery
  • Fan V+ and battery V+ sit on the same rail, V+ ≈ 4.2 V
  • D1 SS36 across the fan: cathode to V+, anode to FAN− at the drain
  • C1 across the fan, in parallel with D1 (drain/FAN− to V+)
  • Two connectors: J1 battery in (V+, NC, GND) and J2 fan out (GND, FAN−, V+)
Circuit schematic: the ESP32's GPIO4 drives the gate of an IRLZ44N MOSFET through a 220 ohm resistor, with a 6.8 kilohm pull-down holding the gate low. The MOSFET's drain switches the fan's negative terminal. An SS36 Schottky diode and a ceramic snubber capacitor sit across the fan in parallel with each other, returning to the 4.2 volt rail. Two three-pin connectors carry the battery in and the fan out.
The switching circuit. The ESP32 never carries fan current — it only pulls the MOSFET's gate up and down, and R2 holds that gate low while the board is booting. D1 and C1 sit across the fan to absorb the voltage spike and the switching noise it throws back each time the current is cut.

The focus formula

The headset reports eight band powers once per second. The formula weighs the two Beta bands, which rise with concentration, against the Alpha and Theta bands, which rise with relaxation.

raw_focus = (L-Beta + H-Beta)
            / (L-Alpha + H-Alpha + Theta + 0.1)
  • The + 0.1 prevents a divide by zero.
  • Band powers are stored as log10(raw + 1), so the ratio is computed on log-scaled values.
  • Delta and Gamma are deliberately excluded — Delta is irrelevant while awake, and Gamma is too noisy for a single dry electrode.
  • The raw ratio is remapped linearly from a physiological window of about 0.3–0.7 onto 0–1, then scaled to a 0–100 byte.
  • The value is smoothed exponentially before it is sent, so the fan gets a calm signal.

The eight bands

EEG frequency bands reported by the headset
BandRangeState
Delta0.5–4 HzDeep sleep
Theta4–8 HzDrowsiness, relaxation
Low-Alpha8–10 HzRelaxed
High-Alpha10–13 HzRelaxed, mildly alert
Low-Beta13–17 HzLight focus
High-Beta17–30 HzStrong focus
Low-Gamma30–40 HzHigh-level cognition
Mid-Gamma40–100 HzIntense concentration

All eight are present in the brain at the same time. What changes is their relative power.

Timing

  • Headset to laptop: ThinkGear serial protocol at 57600 baud, checksum verified per packet.
  • Laptop to ESP32: one byte, 0–100, every 30 ms at 115200 baud — about 0.3% of the link.
  • PWM: 25 kHz, 8-bit, on the ESP32 LEDC peripheral.
  • Below 20% focus the fan is switched hard off. From 20% to 100% the duty cycle is mapped onto 132–255 — 132 is the lowest duty at which the fan actually turns.
  • End to end: 60–100 ms. It feels immediate.

Supply voltage test — earlier version

An earlier build used a large fan rated for 12 V, driven well past its rating from an adjustable bench supply, because at 12 V the airflow was not strong enough to hold the ball up. These were the results:

Ball behaviour at different supply voltages
SupplyResult
12 VBall lifts slightly, then drops back
15 VLifts, but holds no stable height
18 VSits around the middle of the tube
20–25 VFull control range, bottom to top. Best

Above 25 V the ball still did not fly out. The tapered nozzle creates a low-pressure region by the Bernoulli effect, which pulls the ball back to the centre. That is a property of the design, not luck.

The current build uses a smaller fan running from a battery pack at about 4.2 V, so it no longer needs a bench supply and the whole rig is self-contained. The test above is kept because it is what led there.

Reliability at the booth

  • A signal-quality gate forces the focus value to zero when the electrode is not making good contact, so the fan cannot run on noise.
  • If the headset disconnects, the software sends zero to the ESP32, closes the port, waits and reconnects on its own.
  • The firmware writes a duty cycle of zero on boot, so the fan is off at power-up.

Known limitations

  1. One electrode. The system can read the general level of concentration and nothing more specific. It cannot distinguish particular thoughts.
  2. 3.3 V gate drive. The ESP32 pin turns the logic-level MOSFET on but does not drive it into full saturation. A dedicated gate-driver IC would fix this.
  3. Per-user baseline. The mapping range that suits one person is slightly off for the next. Automatic per-session calibration is future work.
  4. Smoothing trade-off. Smoothing makes the ball steadier but adds a fraction of a second of lag.