Introduction: Mind-Controlled Gaming: Build Your Own BCI
What if you could play video games without even touching a controller? No buttons, no joysticks—just your focus and your eye blinks. In this guide, we will show you how to build a Brain-Computer Interface (BCI) using the DIY Neuroscience Kit to translate EEG (brain) and EOG (eye) signals into keyboard commands.
Supplies
You just need a DIY Neuroscience kit which includes:
Hardware
- 1 x BioAmp EXG Pill
- 1 x BioAmp Cable v3
- 3 x Gel Electrodes
- 3 x Jumper Cables
- 1 x Arduino UNO EK R4 Minima
- 1 x Nuprep Skin Preparation Gel
- 1 x Wet wipe or Alcohol swab
- 1 x Laptop (not included)
Software
- Arduino IDE
- Arduino CMSIS-DSP Library
You can purchase any of the kit mentioned below from our online stores (Shipping Worldwide)
- DIY Neuroscience Kit - Pro (2025 Edition) ( | Tindie | Robu | Upside Down Labs Store)
- DIY Neuroscience Kit - Basic ( Tindie | Robu | Amazon India | Upside Down Labs Store)
Step 1: How It Works
Before we build this project, let's understand the signals we are capturing:
- EEG (Electroencephalogram): When you focus, your brain produces Beta waves (13 to 30 Hz). The BioAmp EXG Pill is designed to detect and amplify these brainwaves.
- EOG (Electrooculogram): Moving or blinking your eyes creates biopotential signals which we will use to detect double and triple blinks.
The Arduino processes these raw signals. We programmed it as follows:
| Action / Biological Signal | Keyboard Command | In-Game Result (e.g., Vector) |
|---|---|---|
| High Focus (Beta Waves) | Right Arrow Key | Move Forward / Accelerate |
| Double Blink (EOG Spike) | Up Arrow Key | Jump |
| Triple Blink (EOG Spike) | Down Arrow Key | Slide |
Step 2: Assembling BioAmp EXG Pill
If in case you received an unassembled BioAmp EXG Pill from a marketplace/distributor, then you may have to assemble it for this project by soldering the header pins and JST PH 2.0 connector, as shown in the diagram.
Step 3: Connecting BioAmp Cable
Connect BioAmp Cables to BioAmp EXG Pill as shown.
Step 4: Skin Preparation
Apply Nuprep Skin Preparation Gel on the skin surface where electrodes would be placed to remove dead skin cells and clean the dirt from the skin surface. After rubbing the skin surface thoroughly, clean it with a wet wipe or an alcohol swab.
About Nuprep Gel:
Nuprep skin preparation gel is a mildly abrasive, highly conductive gel that should be applied before placing the electrodes on the skin to improve measurements. When applied gently, it strips away the top layer of skin and moistens the underlying skin layer, which reduces the skin impedance with minimal skin irritation and discomfort.
Complete guide on Skin Preparation: https://docs.upsidedownlabs.tech/guides/usage-guides/skin-preparation/
Step 5: Electrode Placements
Let's understand the electrode placements before moving forward in this project. For recording EEG from the prefrontal cortex part of the brain, you have to place the electrodes on your forehead.
Measuring EEG using Gel electrodes:
- Connect the BioAmp Cable to gel electrodes,
- Peel the plastic backing from the electrodes.
- Place the IN+ cable of the BioAmp EXG Pill on your forehead.
- Place IN- on the bony part behind the earlobe of one ear.
- Place REF on the bony part behind the earlobe of the other ear.
Step 6: Connecting Arduino UNO EK R4 Minima
Connect the BioAmp EXG Pill to Arduino Uno R4 Minima as directed below:
- VCC to 5V
- GND to GND
- OUT to A0
Now connect Arduino UNO EK R4 Minima to the laptop using a USB cable.
⚠️Caution:
Always follow the above diagram while making the connections between your BioAmp EXG Pill & Arduino Uno R4 Minima, especially the GND and VCC, or else it may damage the sensor.
Step 7: Install Arduino UNO R4 Boards
- Install Arduino IDE (https://www.arduino.cc/en/software) and launch it.
- Install Arduino UNO R4 Boards from Boards Manager. Make sure to click on YES when prompted to install
Step 8: Install Arduino CMSIS-DSP Library
- Install Arduino CMSIS-DSP Library from the Library Manager.
Step 9: Uploading Firmware
- Open the project link.
- Open a new sketch in arduino IDE and replace the existing code with this by pressing Ctrl + A and Ctrl + V
- Select the correct board and upload the code.
Now, test the functionality of all three controls by focus, double blinks and triple blinks. If you notice any inaccuracies or if a control isn't working, proceed to the debug steps.
Step 10: DEBUGGING
Brainwaves vary from person to person, so the program is designed to be customizable.
To enable debug mode, Uncomment the #Define Debug by clicking on it and pressing CTRL + / or by removing the two slashes at the beginning of the line. Then, upload the code.
- Now, open the Serial monitor where you can see the Beta values and EOG envelope values.
- Now, focus at one point and notice your max beta value reached, set the BETA_THRESHOLD to less than half of the maximum value reached.
- Now, try blinking 2-3 times and monitor the maximum EOG envelope value reached. Set the BLINK_UPPER_THRESHOLD to the max envelope value noticed, and set BLINK_LOWER_THRESHOLD to 50% of the max value.
- Now, comment out the #define Debug line by pressing CTRL + / or by adding two forward slashes at the beginning of the line. Then, upload the code again.
- Now, test the controls again. If you’re still not satisfied, do the debugging steps again.
Step 11: Game Play
Once, the detection is good we can move on to controlling games
Testing your controls:
| Action | Required Motion | Resulting Key Press |
|---|---|---|
| Focus Detection | Focus your gaze on a single point. | The "Focus" key will be pressed and held. |
| Double Blink | Blink two times rapidly. | The "Double Blink" key will be pressed. |
| Triple Blink | Blink three times quickly. | The "Triple Blink" key will be pressed. |
Open any game in your browser, click on the game window, and start playing using your mind and blinks.
- To change the key mappings, set the FOCUS_KEY, DOUBLE_BLINK_KEY and TRIPLE_BLINK_KEY in the code to any keyboard key.
- For alphabets, just change the value to any alphabet like this:
- For any other keys visit this link to find the KEY names and change it accordingly like this:
Note: Your laptop should not be connected to the charger as it can induce 50/60 Hz AC interference noise. While recording/visualizing the signals, it is recommended to maintain 5m distance from any AC appliances.
Whenever you blink, the beta‑wave reading dips sharply as eye movement artifacts momentarily overshadow the true beta signal.
Step 12: Troubleshooting
If you experience issues with signal quality, then check the below link for tips for best signal acquisition:
https://docs.upsidedownlabs.tech/guides/troubleshoot/tips/index.html
Step 13: Conclusion
What we've built isn't just a tech demo but it's a glimpse into a future of neurotechnology.
The possibilities are endless. What are you doing to make with it?
Let us know what you think about this project in the comment section below.
You can also mail us at support@upsidedownlabs.tech for any queries or issues while you make this project.





