EEG headband and aga voice speaker: where they stand · Gor Berlian · diadem.fun
← Gor Berlian
ReportNov 18, 20266 min read

EEG headband and aga voice speaker: where they stand

Contents

Two projects are being built together. Entrain A0 is an open, two-channel EEG headband for neurofeedback and brain-state entrainment. aga is a voice-first smart-speaker app for Android phones and the web, in English, Russian and Indonesian. This report covers what exists, what has been proven to work and how, and what is not done.

Entrain A0: the EEG headband#

What it is: a headband with titanium skin contacts and two EEG channels. It uses a TI ADS1292R analog front end and a Nordic nRF52840 Bluetooth module (Raytac MDBT50Q). It streams 250 samples per second per channel to a phone or browser.

Status: designed and simulated, not yet built. The board is not safe to wear until measured fault currents pass on real hardware.

Decided and checked#

  • Parts: 92 of 93 parts list lines have an orderable part number; the custom battery pack needs a quote.
  • Electrode safety: every electrode path has two 1 MΩ pulse-rated resistors in series. If one shorts, the current stays near 4 µA, against a 10 µA benchmark. The front end gets low-leakage ESD protection, USB charging is physically impossible while the electrodes are attached, and a hardware interlock cuts power when USB is plugged in.
  • Circuit simulation in ngspice:
Question Result
Is the right-leg drive (the loop that cancels mains hum on the body) stable? Yes, in all 486 simulated combinations of electrode contact, amplifier speed and skin capacitance: phase margin of 90° or more
How much mains hum does it remove? 18 dB, after changing two parts (it was 8 dB)
Does plugging in USB cut power to the headband? Yes, within 0.46 ms
A battery connected backwards? Only picoamps of current flow
Does charging stop when the battery is hot? Yes, by 43.6 °C even with worst-case part tolerances (battery limit 45 °C)

Software that already runs#

  • Firmware (nRF Connect SDK) with the ADS1292R driver and a 70-byte Bluetooth frame format, plus a shared set of test frames. The firmware, the browser decoder and the Python bench tool decode the same test frames byte for byte.
  • A live viewer in the browser. It connects over Web Bluetooth, or to a built-in simulated headband. It shows filtered traces, spectrograms, the five brain-wave bands, electrode contact, battery and link quality, and records to CSV and EDF+.

The viewer with the simulated headband, eyes closed: the 10 Hz alpha rhythm dominates

  • Session mode: alpha and SMR neurofeedback, theta/alpha, and 10 Hz audio-visual entrainment, with before/after reports. The flashing light stays off unless consent is given for that session, and Esc stops all sound and light.

A neurofeedback session running on the simulator

  • A bench-test kit in Python. It checks a real board's sample rate, packet loss, noise, hum rejection, lead-off detection and battery, and writes a pass/fail report. It runs against the simulator today.

How it was tested#

Test Result
Viewer unit tests 350 pass
Viewer driven in Chrome by a script 10 of 10 checks pass: 25 frames/s, alpha rises from 2 % to 70 % of the signal with eyes closed, CSV and EDF downloads, flicker refused without consent, Esc closes the audio
EDF file read by an independent library (pyedflib) 2 channels at 250 Hz, spectral peak at 10.00 Hz
Bench kit tests 119 pass
Circuit calculation and simulation tests 67 pass, 35 of them running ngspice

Next for the headband#

  • the schematic and board layout;
  • firmware v2: power management, battery level, over-the-air updates and a factory self-test;
  • the first boards, and the electrical safety tests before anyone wears one.

aga: a voice speaker app#

What it is: a phone on a stand becomes a smart speaker. Its home screen is a clock with result cards. It handles timers, alarms, reminders, lists, weather, calculations, unit conversion, internet radio by genre and a spoken conversation mode. Everything is in English, Russian and Indonesian.

English

Russian: "convert 10 kilometres to miles"

Indonesian

Voice that works without any cloud account#

  • Wake word on the device, using openWakeWord. It runs inside the Android app itself, so listening doesn't depend on the screen being on.
  • Speech recognition on the device, with Whisper Base, used when no cloud service is configured. On this PC, one spoken command takes 0.4–0.7 s on the CPU, or 1.9–3.1 s inside the browser.
  • Commands resolved by a fast local grammar in the three languages, then by the skills.

How it was tested#

Unit tests prove little about a voice app, so most of the work went into tools that run the real thing:

  • An end-to-end checker drives the real app in Chrome. It types commands in all three languages, and it speaks commands: Windows voices play "Hey Jarvis, set a timer for five minutes" into a simulated microphone. It then checks the card that appears. It now passes 30 of 30.
  • On its first run it passed 18 of 27 typed commands and 0 of 3 spoken ones. It found, among other things, that the wake word could never have fired: the wake models were being fed audio at the wrong scale. A small score meter showed the app's pipeline scoring 0.05 on a clear "Hey Jarvis", where the reference scored 0.998.
  • The Android wake word code was run on the real models in a desktop Java test. It scored 0.998 at the right moment and woke exactly once, at about 1.7 ms of computation per 80 ms of audio.
  • 240 multi-turn scenarios, 80 per language, run through the app's real command pipeline with recorded network responses. On the first run 163 passed; after the fixes, all 240 do. Examples of what failed: adding time to a timer, deleting reminders, follow-ups such as "and in Paris?", shuffle and repeat, routines.
  • Speech recognition benchmark: on eight commands spoken by Windows voices, the smaller Whisper Tiny got 3 right and Whisper Base got 8. That is why Base is used.
Test Result
App test suite 1,523 pass, 0 fail
Scenarios through the real pipeline 240 of 240
End-to-end in Chrome, typed and spoken, 3 languages 30 of 30
Android plugin tests (Java), including real models 61 pass

Not done yet#

  • The wake word is still "Hey Jarvis", a stock model. A "Hey aga" model trained on synthetic speech now catches 9 of 10 commands from voices it never heard. But it still wakes falsely too often on long speech (about 30 times an hour), so it stays off until that is near zero.
  • Indonesian speech recognition is weak, and has only been tested with a robotic synthetic voice.
  • Nothing has been tested on a real phone yet, only builds, desktop tests and an emulator.
  • Conversation mode needs an OpenAI key; everything else works without accounts.
Gor Berlian

One person, many companies, one coin. Every project I build sends a share of its revenue back to buy $BERLIAN on the open market, and every buy is published with its transaction.

See the page

More from Gor Berlian