Published article
Neurofeedback software for managing attention deficits in adults with ADHD
The peer-reviewed write-up behind my Brain Signal Processing Game: an OpenBCI + Lab Streaming Layer EEG pipeline and a Pygame rocket game that trains sustained attention in adults with ADHD through Beta-rhythm neurofeedback. Published in the XIV CONCCEPAR proceedings (2024).

- neurotech
- research
- eeg
- neurofeedback
- adhd
- python
Attention-Deficit/Hyperactivity Disorder (ADHD) is a neuropsychiatric condition that poses significant challenges for treatment and symptom management. Given the wide variability in responses to conventional ADHD treatments, we developed this neurofeedback (NFB) protocol around software tailored to individualize treatment according to each patient's unique neurophysiological patterns (Krepel et al., 2023), aiming to strengthen sustained attention — a domain commonly impaired in ADHD. The game and exercise protocol was designed as an interactive approach emphasizing the role of selective attention in cognitive control (Mishra et al., 2021), targeting the focus-related deficits associated with the disorder.
This is the peer-reviewed write-up of the system behind my Brain Signal Processing Game project, published in the proceedings of the XIV CONCCEPAR scientific congress (2024). I co-authored it with a joint team from UTFPR and Centro Universitário Integrado; the summary below is an English adaptation of the original Portuguese paper.
Why adults?
Most NFB programs for ADHD are studied in children, occasionally extending into adolescence — yet the disorder usually follows patients into adult life. Barth et al. (2021) highlighted this gap in randomized-controlled NFB research for adults, and the personal and professional costs that accumulate over years make protocols aimed at this age group especially relevant. Alongside the clinical motivation, we wanted new software that lets researchers replicate and re-evaluate NFB protocols, helping settle the open questions and diverging findings in the literature — including how much of the observed benefit is a placebo effect.
The signal pipeline: from scalp to game
The protocol integrates software and hardware through LSL (Lab Streaming Layer), a cross-platform protocol for streaming data asynchronously between applications and devices in real time.
- Signal acquisition uses the OpenBCI GUI connected to a brain-computer interface that reads potential differences across the scalp through 8 EEG electrodes placed by the 10/20 system.
- Samples stream as floating-point batches into a Python processing server, evaluated in 3-second windows with a 300 ms refresh after the initial accumulation period — enough for a stable, high-resolution estimate.
- A 60 Hz notch filter removes mains interference and a 4–100 Hz bandpass cleans the usable range.
- The filtered signal is transformed into the frequency domain using Welch's method, which exposes the classic frequency bands — among them the Beta rhythm, the most important band for ADHD-oriented neurofeedback.
- The predominance of the Beta rhythm is then communicated to the game interface, where the patient's own brain activity drives the gameplay.

The game: a rocket you fly with your attention
The game itself is built with Pygame, chosen for its accessible, flexible platform for interactive simulations and its ability to handle real-time data input. Visual assets come from OpenGameArt.org, and the palette is deliberate: a calm blue background (rgb 27, 61, 102) chosen not to distract, and an attention-grabbing yellow marking the direction the patient should focus on to control the rocket.
The mechanism is direct brain-computer interaction: when the patient's Beta-rhythm activity crosses the training threshold, the rocket floats above a dashed line on screen; when Beta activity falls short, the rocket sinks below it. The player is literally regulating their own neural activity to play.
- Each session runs 6 to 10 seconds and starts with a 2-second baseline phase, which standardizes the patient's resting neural pattern for comparison.
- An audio cue marks the start of a session — the moment the patient should focus on a triangle at the center of the screen.
- During the run, the rocket's position reflects how current brain activity compares to the baseline state, and everything is monitored and logged per session.
- At the end, performance feedback is delivered through a smiley emoticon, deliberately pairing a positive emotion with the attentional state achieved during the game — positive reinforcement for producing the Beta-wave pattern.

What we took away
The work delivers a game whose control loop runs through the player's own brain activity, giving patients immediate, legible feedback about the brain-wave patterns that indicate attention. To ground the design, we also reviewed recent clinical research on PubMed (Attention Deficit Disorder with Hyperactivity + Neurofeedback, last four years, excluding child-only studies) as a counterpoint to the software decisions.
The next step is the obvious one: broader observational replication to evaluate the program's benefits and validate the literature that correlates NFB with reduced persistent attentional deficits in adults with ADHD.
Publication
- Original paper (in Portuguese): Desenvolvimento de software para neurofeedback — modulação cerebral para manejo de déficits atencionais em adultos com TDAH, Anais do XIV CONCCEPAR — Congresso Científico da Região Centro-Ocidental do Paraná, Campo Mourão (PR), 2024. ISSN 1983-7178. Direct PDF.
- Authors: Aline Sviatowski (Medicina, Centro Universitário Integrado), Raquel de Oliveira (Ciências da Computação, UTFPR), João Gouveia Sperandio (Ciências da Computação, UTFPR), Daniella C. Mendes Sehaber (Medicina, Centro Universitário Integrado), Rodrigo Hübner (DACOM, UTFPR), Amanda N. S. Hübner (Medicina, Centro Universitário Integrado).
- Funding: Fundação Araucária, through the PIBIC/PIBITI/PIC scientific initiation program (Edital 6932, Centro Universitário Integrado/FA/CAWB 2023-2).
Key references
- Barth, B. et al. A randomized-controlled neurofeedback trial in adult attention-deficit/hyperactivity disorder. Scientific Reports 11, 16873 (2021).
- Krepel, N. et al. A multicenter effectiveness trial of QEEG-informed neurofeedback in ADHD: replication and treatment prediction. Psychiatry Research: Neuroimaging, v. 335 (2023).
- Mishra, J. et al. Closed-Loop Neurofeedback of Alpha Synchrony during Goal-Directed Attention. Journal of Neuroscience, v. 41 (2021).
- Strehl, U. Slow Cortical Potentials Neurofeedback. Journal of Neurotherapy, v. 13, n. 2 (2009).
- Lab Streaming Layer and Pygame documentation.
Related projects: public writing