HUMANNODEBajie Developer GuideProduct page →

6 · Brain control with the NeuroNode EEG

Goal: control Bajie by looking at one of four flickering tiles: 💧 Water · 🧸 Tidy up · 🆘 Help · ⏹ STOP. This uses SSVEP (steady-state visual evoked potentials): when you look at a light flickering at 12 Hz, your visual cortex produces a 12 Hz signal the EEG can detect. No training is needed.

Included in the Brain-Control Bundle. It works with the 8-, 16- or 32-channel NeuroNode EEG kit.

⚠️ Photosensitivity warning. Flickering lights can trigger seizures in people with photosensitive epilepsy. Don't use this app with anyone who has epilepsy or a history of seizures. Stop immediately if you feel unwell.

Step 1: Try the simulator (no EEG, no robot)

git clone https://github.com/nonameisready/hnbot.git && cd hnbot
pip install -e ".[bci]"       # adds numpy, scipy, brainflow
hnbot bci

Open http://127.0.0.1:8765 in a browser. Clicking a tile pretends you are looking at it. Watch the scores rise until a command fires in the simulator.

Step 2: Place the electrodes

SSVEP comes from the visual cortex at the back of the head.

Electrode Position
O1, Oz, O2 main signal: the back of the head, just above the bump of the skull
PO3, POz, PO4 optional extras, slightly higher
Reference / bias an earlobe or the mastoid (bone behind the ear)

Wet or flexible electrodes give a cleaner signal than dry ones on hair. Part the hair under each electrode.

Note which amplifier channel each electrode is plugged into. hnbot counts channels from 0. For example, if O1/Oz/O2 are in channels 6, 7 and 8 on the amplifier, use --channels 5,6,7.

Step 3: Connect the EEG

Check the signal in OpenBCI GUI first, then close it. Only one program can use the amplifier at a time. Use the same board type in hnbot:

Kit / connection --eeg value Also pass
8-ch, USB dongle cyton --serial-port /dev/ttyUSB0 (Windows: COM3)
16-ch, USB dongle cyton_daisy --serial-port …
8-ch, Wi-Fi cyton_wifi --ip-address 192.168.4.1
16-ch, Wi-Fi cyton_daisy_wifi --ip-address 192.168.4.1

Pick the type that matches how your kit connects. If unsure, use the board type that works in OpenBCI GUI.

Step 4: Set up the screen

  • Use a 60 Hz monitor at about 60 cm from the user, full screen, in a dimly lit room.
  • The tiles flicker at 7.5, 8.57, 12 and 15 Hz, exact fractions of 60 Hz. These avoid the 10 Hz alpha rhythm.
  • On a 120/144 Hz monitor, set the refresh rate to 60 Hz.

Step 5: Run it with the real robot

Run on the robot, or on a laptop on the same network with ROS 2 set up:

hnbot --robot bajie bci --eeg cyton --serial-port /dev/ttyUSB0 --channels 5,6,7 --notify
  • Open the page and read the safety notice and press I understand · start.
  • The user looks at a tile for 2–3 seconds:
    • A command fires only after the same tile wins 3 analysis windows in a row with a clear margin.
    • Then there is a 3-second cooldown, and the user must look away before the same tile can fire again.
  • STOP works even while the robot is busy. Other commands are ignored until the current task ends.
  • --notify sends Help alerts and task results to the Telegram owners from tutorial 4. It needs TELEGRAM_ROBOT_TOKEN and TELEGRAM_OWNER_IDS.

Step 6: Tune it

Problem Try
Commands fire too easily --threshold 0.45 or --hold 4
Commands never fire check the electrode contact; --threshold 0.3; --window 3 (slower but stronger)
One tile always wins that channel is noisy: re-seat its electrode or leave it out of --channels

Scores on the page show the decoder's confidence for each tile in real time. With good contact, the tile you look at should clearly lead within 2 seconds.

Change the commands

The four tiles are defined in hnbot/bci/bridge.py (DEFAULT_COMMANDS). Any task can be a tile, including your own skills from tutorial 5. Keep STOP as one of the four.

How it works (for researchers)

  • Decoder. Canonical correlation analysis (CCA) between the EEG window and sine/cosine references at each frequency and its first 3 harmonics. 2 s window, 0.25 s step.
  • Decision. The Decider adds a threshold, a margin over the runner-up, N consecutive wins, a refractory period and a look-away requirement. Together these keep false triggers near zero when the user isn't looking at any tile.
  • Code. Everything is plain Python (hnbot/bci/ssvep.py) and easy to swap for FBCCA, TRCA or your own model.

✅ Done. You have a brain-controlled assistive robot.

Questions? Email contact@humannode.dev. Developer Platform customers get 3 months of direct technical support.