This is not FDA approved. For research only.
After the product is assembled with the touch screen, clone then start the kiosk application.
git clone https://github.com/Elata-Biosciences/elata-eeg
cd elata-eeg
chmod +x install.sh
bash install.sh# Stop kiosk mode
bash stop.sh
# Term 1, sensors
cd crates/sensors; cargo build
# Term 2, device daemon
cd crates/daemon; cargo build; cargo run
# Term 3, kiosk
cd kiosk; npm run dev# Stop
bash stop.sh
# ...<Change code here> ...
# Rebuild code base and run kiosk mode
bash rebuild.shTable of Contents
- Overview
- Hardware Components
- Software Stack
- System Architecture
- Setup & Installation
- Building & Running
- Usage Instructions
- Development Notes
- Troubleshooting
- Contributing
- License
Open EEG Project aims to build a low-cost, open-source EEG machine for precision psychiatry and neuroscience research. We use a Raspberry Pi (Model 5 recommended) plus a Texas Instruments ADS1299-based amplifier board to acquire 8 channels (or more) of EEG signals at high resolution.
- Goal: Democratize EEG hardware, encourage collaboration, and maintain a fully open, right-to-repair design.
- Status: In early prototyping. Currently able to read/write registers over SPI; next step is real-time data capture and signal processing.
-
Raspberry Pi 5
- CPU: Quad-core Arm Cortex
- SPI pins on the 40-pin header
- 5-inch or 7-inch HDMI touchscreen (optional but recommended)
-
ADS1299 EEGFE Board
- 8-channel, 24-bit analog front-end for EEG
- Connects to Pi via SPI
- TI’s official evaluation module or custom board
-
EEG Electrodes
- Wet electrodes (Ag/AgCl or Gold Cup)
- Conductive paste/gel (e.g., Ten20)
-
Cables & Adapters
- Dupont jumper wires (2.54 mm pitch) for SPI and power connections
- Possible use of additional shielding or ferrite beads
- Operating System: Raspberry Pi OS (Debian-based)
- Rust Toolchain: Installed via rustup
- Frontend: Next.js Kiosk application with WebSocket communication
- Backend: Rust workspace with sensor and device crates
- Hardware Interface:
rppalcrate for Raspberry Pi GPIO/SPI/I2C/Serial - Plugin System: Modular DSP and UI plugins
- Version Control: Git + GitHub
- License: GPLv3 (Strong Copyleft)
The system is architected as a set of modular crates, each with a distinct responsibility. This separation of concerns ensures the system is extensible, maintainable, and testable.
graph TD
subgraph eeg_types
direction LR
A[eeg_types]
end
subgraph sensors
direction LR
B[sensors]
end
subgraph boards
direction LR
C[boards]
end
subgraph pipeline
direction LR
D[pipeline]
end
subgraph daemon
direction LR
E[daemon]
end
A --> B
A --> C
A --> D
B --> C
C --> E
D --> E
| Layer | Owns | Depends on | Notes |
|---|---|---|---|
| eeg_types | Packet, ChannelId, AdcConfig, error enums |
— | Pure data; zero hardware. |
| sensors | Register maps, low-level SPI/I²C for a single chip | eeg_types |
Tiny, reusable; feature-gated per chip. |
| boards | Glue code that unites one or more chips into a PCB driver (impl EegDriver) |
sensors, eeg_types |
Where board-specific init lives. |
| pipeline | DSP graph, sinks, UI API | eeg_types |
Hardware-agnostic. |
| daemon | CLI, config parsing, picks one board driver and pumps packets into the pipeline | boards, pipeline, eeg_types |
The only binary crate. |
This layered architecture ensures that there are no circular dependencies, making the codebase easier to manage and scale.
-
Assemble Hardware
- Mount the ADS1299 board so it’s accessible to the Pi’s GPIO pins.
- Connect SPI pins:
MOSI(GPIO10) → ADS1299SDIMISO(GPIO9) → ADS1299SDOSCLK(GPIO11) → ADS1299SCLKCS(GPIO8) → ADS1299CSGND→ ADS1299GND5V→ ADS1299VDD, etc. (Check board specs)
- Attach EEG electrodes to the ADS1299 board inputs.
-
Install Raspberry Pi OS
- Use Raspberry Pi Imager on your PC/Mac.
- Enable SSH in
raspi-configor via Pi OS Configuration.
-
Install Rust & Dependencies
sudo apt update && sudo apt install build-essential curlcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource $HOME/.cargo/env
-
Clone This Repo
git clone [email protected]:<your-username>/open_eeg.git cd open_eeg
-
Build the workspace
# Build all crates cargo build # Or build individual crates cd crates/sensors && cargo build cd crates/daemon && cargo build
-
Run the device daemon
cd crates/daemon cargo run -
Run the kiosk (separate terminal)
cd kiosk npm install npm run dev -
Expected Behavior
- Device daemon starts and initializes the sensor hardware
- Plugin manager loads (currently basic implementation)
- Kiosk provides web interface at http://localhost:3000
- WebSocket communication between daemon and kiosk
-
Electrode Placement
- Place electrodes on the scalp according to your desired montage (e.g., 10-20 system).
- Use conductive paste. Ensure good contact and consistent ground/reference electrodes.
-
Real-Time Data Acquisition
- Currently, the code is in “demo” mode, reading raw samples and printing them to stdout or logs.
- Future versions will include real-time filtering, a ring buffer, and potential streaming to a local GUI or remote client.
-
Data Logging / Output
- By default, logs are printed. For CSV logging, we’ll add functionality soon (planned in src/logging.rs).
- SPI Speed: Currently set to 1_000_000 (1 MHz). You can tweak in src/main.rs if your hardware can handle higher rates.
- ADS1299 Register Map: See TI’s official datasheet. We plan to implement a dedicated driver module in src/ads1299.rs.
- Filtering: A basic IIR or FIR filter is planned. We may integrate a DSP crate for advanced filtering (band-pass, notch, etc.).
-
No SPI Response
- Check wiring for MOSI/MISO swapped.
- Ensure dtparam=spi=on in /boot/config.txt (and reboot).
-
Compile Errors
- Update Rust: rustup update.
- Confirm Cargo.toml dependencies match in your code.
-
Noise / Poor Signal
- Add shielding to electrode cables.
- Keep Pi power supply stable, use quality 5 V, 3 A (or more) adapter.
- Use short wires for SPI to reduce EMI.
We welcome pull requests, feature suggestions, and bug reports!
- Fork the repository.
- Create a new branch for your feature or fix.
- Open a PR against the main branch.
This project is licensed under the GPLv3. By contributing, you agree that your contributions will be licensed under GPLv3 as well.
For more details, see the LICENSE file.