Here’s a hands-free, blink-controlled project — The EOG Keystroke Emulator!
With just a blink, you can emulate a keystroke like the spacebar. Whether you’re playing a game, scrolling through a document, or exploring hands-free computing, this project opens doors for accessibility and futuristic control.
In this tutorial, you'll learn to use EOG (Electrooculography) signals to trigger keystrokes using Neuro PlayGround Lite and Chords Python.
But before moving forward, let's understand about EOG signals and Neuro PlayGround Lite.
What is Electrooculography (EOG)?EOG is a method for measuring eye movements using the electrical potential generated by the eye. It typically involves placing electrodes around the eyes to detect these small voltage changes when you blink or move your eyes.
What is Neuro PlayGround Lite?Neuro PlayGround (NPG) Lite is a compact Adafruit Feather form factor, 3-channel wireless biopotential signal amplifier designed for EMG, ECG, EOG, and EEG recording.
It offers Wi-Fi, Bluetooth, Zigbee, and Thread connectivity, along with patient protection, LEDs (User LED, charging LED, 6 addressable RGB LEDs), buttons (Reset and user button), LiPo battery charging, and USB-C with ESD protection. Its lightweight and user-friendly design makes it perfect for research, education, and wearable applications.
Neuro PlayGround Lite will be launched soon on CrowdSupply. Subscribe now to never miss out on any updates.
https://www.crowdsupply.com/upside-down-labs/neuro-playground-lite
How Does This Project Work?
Each eye blink is treated as an input signal. This eye blink is detected to trigger a keystroke — in our case, the Spacebar.
Want to control a different key? Just tweak one line in the code and you’re good to go! We will be talking about code customization at the end of this tutorial.
Note: This project is made by Payal Lakra
Step 1: Skin PreparationBefore detecting the EOG signals, it's essential to prepare your skin to ensure you get accurate EOG data.
Start by applying Nuprep Skin Preparation Gel to the areas where you'll place the electrodes. This gel gently exfoliates the top layer of the skin, removing dead cells and oils that can interfere with signal transmission.
After rubbing the gel in a circular motion for a few seconds, clean the area using an alcohol swab or wet wipe. This step ensures that your skin is ready for the best possible electrode contact—think of it as polishing the lens before taking a photo!
What is Nuprep Gel?
Nuprep is a mildly abrasive, highly conductive gel that improves electrode contact by reducing skin impedance. It's safe, effective, and causes minimal skin irritation.
Once your skin is prepared, it’s time to connect BioAmp Snap Cables.
Connect 3 BioAmp Snap Cables to
- Positive of Channel 1 (A0P)
- Negative of Channel 1 (A0N)
- Refernece (REF)
Correct electrode placement is a crucial step when recording EOG (Electrooculography) signals. The goal is to detect your eye blinks, so you will be placing the electrodes in the position mentioned below:
- Negative (A0N) goes above the eye.
- Positive (A0P) goes below the same eye.
- Reference (REF) goes on a bony area. So bony part behind the earlobe is a perfect spot for this.
Download the GitHub Repository of Chords Python: https://github.com/upsidedownlabs/Chords-Python
Extract the folder after downloading.
Step 5: Upload the FirmwareTo get your NPG Lite ready for action, follow the steps below to upload the latest firmware using Arduino IDE:
- Power up the Neuro PlayGround Lite (NPG Lite) by flipping the ON/OFF switch and connecting your NPG device to your laptop with a Type-C Cable.
- Open the Chords Arduino Firmware folder on Github:https://raw.githubusercontent.com/upsidedownlabs/Chords-Arduino-Firmware/refs/heads/main/NPG-LITE-BLE/NPG-LITE-BLE.ino
- Copy your board's firmware sketch from the GitHub folder. This ensures you're always working with the latest version, as updates roll out frequently.
- Launch the Arduino IDE and directly paste it into a new Arduino sketch window.
- Install the ESP32 board from the boards' menu. Note: You don’t need to install Arduino-ESP32, just install ESP32.
- Install the required libraries, such as Adafruit NeoPixel. The Arduino IDE usually prompts you to install any missing libraries — just click “Install” when prompted.
- In the Arduino IDE, Go to Tools → Board and select ESP32 → ESP32C6 Dev Module
Once your board is selected and libraries are installed, click the Upload button.
After the upload completes, remove the cable as your NPG Lite is ready to send EOG and other biopotential data wirelessly.
Step 6: Running Chords PythonOpen the extracted Chords-Python folder in VS Code or any other code editor of your choice.
Create Virtual Environment by command:
python -m venv venv
Activate Virtual Environment
(For Windows)
.\venv\Scripts\activate
(For Linux/macOS)
source venv/bin/activate
Install the required Python packages:
pip install -r chords_requirements.txt
pip install -r app_requirements.txt
Launch the flask-server:
python app.py
Click the generated link in the terminal to open the web-based interface.
NOTE: Turn on your Bluetooth.
- Click Start NPG Stream on the web interface and click on the Scan button to scan for available devices.
- Select your NPG device → Click Connect → Button turns green and shows “NPG Stream Running”.
- Then, click on EOG Keystroke Emulator.
- A compact floating window appears on the top left corner and stays on top of all screens.
This project maps your eye blinks to trigger the Spacebar which is perfect to play the Chrome Dino Game!
Controls & Gameplay:- Connect/Start: Click on connect. Once connected, the button changes to Start, and clicking on it will begin detecting eye blinks.
- Eye Icon: When an eye blink is detected it changes color to confirm the blink detection.
- Quit: Click on it to exit the application.
Now open Google Chrome and click on this link to launch the Chrome Dino game: https://chromedino.com/
The Chrome Dino is now blink-controlled!
Step 8: Conclusion
This project can be your stepping stone in the world of neuroscience and electrophysiology.
The possibilities are endless. What are you going to make using EOG signals?
Drop your feedback in the comments.
Need help? Reach out at support@upsidedownlabs.tech
Step 9: TroubleshootingIf you face any problems while starting the EOG Keystroke Emulator,
- Skip creating and activating the virtual Environment. Directly, install all the dependencies by commands
pip install -r chords_requirements.txt
pip install -r app_requirements.txt
Then, Run
python app.py
- Make sure to turn on the Bluetooth while starting the Stream.
- Getting an accurate EOG signal is very crucial for this project to work properly. Please check the link below for the tips for best signal acquisition: https://docs.upsidedownlabs.tech/guides/troubleshoot/tips/index.html
Comments
Please log in or sign up to comment.