{"id":25166040,"url":"https://github.com/elata-biosciences/elata-eeg","last_synced_at":"2026-03-16T01:38:54.023Z","repository":{"id":275711445,"uuid":"926927213","full_name":"Elata-Biosciences/elata-eeg","owner":"Elata-Biosciences","description":"Open Source EEG","archived":false,"fork":false,"pushed_at":"2025-09-30T06:41:41.000Z","size":75348,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-30T08:35:56.665Z","etag":null,"topics":["digital-signal-processing","eeg","hardware","neuroimaging","neuroimaging-analysis","raspberry-pi","rust","rust-lang","signal-processing","texas-instruments"],"latest_commit_sha":null,"homepage":"https://elata.bio","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Elata-Biosciences.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-02-04T05:10:24.000Z","updated_at":"2025-09-04T02:32:50.000Z","dependencies_parsed_at":"2025-09-19T23:11:17.504Z","dependency_job_id":"800adafd-bce6-4341-a3f7-e1e53ebebf9c","html_url":"https://github.com/Elata-Biosciences/elata-eeg","commit_stats":null,"previous_names":["elata-biosciences/elata-eeg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Elata-Biosciences/elata-eeg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Felata-eeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Felata-eeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Felata-eeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Felata-eeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Elata-Biosciences","download_url":"https://codeload.github.com/Elata-Biosciences/elata-eeg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Felata-eeg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30558209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T23:30:23.986Z","status":"ssl_error","status_checked_at":"2026-03-15T23:28:43.564Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digital-signal-processing","eeg","hardware","neuroimaging","neuroimaging-analysis","raspberry-pi","rust","rust-lang","signal-processing","texas-instruments"],"created_at":"2025-02-09T05:47:33.729Z","updated_at":"2026-03-16T01:38:54.016Z","avatar_url":"https://github.com/Elata-Biosciences.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e This is not FDA approved. For research only.\n\n## Setup Guide\nAfter the product is assembled with the touch screen, clone then start the kiosk application.\n```bash\ngit clone https://github.com/Elata-Biosciences/elata-eeg\ncd elata-eeg\nchmod +x install.sh\nbash install.sh\n```\n\n## Dev Usage\n#### Change Code\n```bash\n# Stop kiosk mode\nbash stop.sh\n\n# Term 1, sensors\ncd crates/sensors; cargo build\n# Term 2, device daemon\ncd crates/daemon; cargo build; cargo run\n# Term 3, kiosk\ncd kiosk; npm run dev\n```\n\n#### Rebuild Production\n```bash\n# Stop\nbash stop.sh\n\n# ...\u003cChange code here\u003e ...\n\n# Rebuild code base and run kiosk mode\nbash rebuild.sh\n```\n\n\n# Open EEG Project\n\n**Table of Contents**\n1. [Overview](#overview)\n2. [Hardware Components](#hardware-components)\n3. [Software Stack](#software-stack)\n4. [System Architecture](#system-architecture)\n5. [Setup \u0026 Installation](#setup--installation)\n6. [Building \u0026 Running](#building--running)\n7. [Usage Instructions](#usage-instructions)\n8. [Development Notes](#development-notes)\n9. [Troubleshooting](#troubleshooting)\n10. [Contributing](#contributing)\n11. [License](#license)\n\n---\n\n\n## Overview\n**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.  \n- **Goal**: Democratize EEG hardware, encourage collaboration, and maintain a fully open, right-to-repair design.  \n- **Status**: In early prototyping. Currently able to read/write registers over SPI; next step is real-time data capture and signal processing.\n\n---\n\n## Hardware Components\n\n1. **Raspberry Pi 5**  \n   - CPU: Quad-core Arm Cortex  \n   - SPI pins on the 40-pin header  \n   - 5-inch or 7-inch HDMI touchscreen (optional but recommended)\n\n2. **ADS1299 EEGFE Board**  \n   - 8-channel, 24-bit analog front-end for EEG  \n   - Connects to Pi via SPI  \n   - TI’s official evaluation module or custom board\n\n3. **EEG Electrodes**  \n   - Wet electrodes (Ag/AgCl or Gold Cup)  \n   - Conductive paste/gel (e.g., Ten20)\n\n4. **Cables \u0026 Adapters**  \n   - Dupont jumper wires (2.54 mm pitch) for SPI and power connections  \n   - Possible use of additional shielding or ferrite beads\n\n---\n\n## Software Stack\n\n- **Operating System**: Raspberry Pi OS (Debian-based)\n- **Rust Toolchain**: Installed via [rustup](https://rustup.rs)\n- **Frontend**: Next.js Kiosk application with WebSocket communication\n- **Backend**: Rust workspace with sensor and device crates\n- **Hardware Interface**: `rppal` crate for Raspberry Pi GPIO/SPI/I2C/Serial\n- **Plugin System**: Modular DSP and UI plugins\n- **Version Control**: Git + GitHub\n- **License**: GPLv3 (Strong Copyleft)\n\n---\n\n## System Architecture (v3.0)\n\nThe 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.\n\n```mermaid\ngraph TD\n    subgraph eeg_types\n        direction LR\n        A[eeg_types]\n    end\n\n    subgraph sensors\n        direction LR\n        B[sensors]\n    end\n\n    subgraph boards\n        direction LR\n        C[boards]\n    end\n\n    subgraph pipeline\n        direction LR\n        D[pipeline]\n    end\n\n    subgraph daemon\n        direction LR\n        E[daemon]\n    end\n\n    A --\u003e B\n    A --\u003e C\n    A --\u003e D\n    B --\u003e C\n    C --\u003e E\n    D --\u003e E\n```\n\n| Layer          | Owns                                                                            | Depends on                        | Notes                                   |\n| -------------- | ------------------------------------------------------------------------------- | --------------------------------- | --------------------------------------- |\n| **eeg\\_types** | `Packet`, `ChannelId`, `AdcConfig`, error enums                                 | —                                 | Pure data; zero hardware.               |\n| **sensors**    | Register maps, low-level SPI/I²C for a single *chip*                            | `eeg_types`                       | Tiny, reusable; feature-gated per chip. |\n| **boards**     | Glue code that unites one or more chips into a *PCB* driver (`impl EegDriver`)  | `sensors`, `eeg_types`            | Where board-specific init lives.        |\n| **pipeline**   | DSP graph, sinks, UI API                                                        | `eeg_types`                       | Hardware-agnostic.                      |\n| **daemon**     | CLI, config parsing, picks one board driver and pumps packets into the pipeline | `boards`, `pipeline`, `eeg_types` | The only binary crate.                  |\n\nThis layered architecture ensures that there are no circular dependencies, making the codebase easier to manage and scale.\n\n---\n\n## Setup \u0026 Installation\n\n1. **Assemble Hardware**\n   - Mount the ADS1299 board so it’s accessible to the Pi’s GPIO pins.\n   - Connect SPI pins:  \n     - `MOSI` (GPIO10) → ADS1299 `SDI`  \n     - `MISO` (GPIO9)  → ADS1299 `SDO`  \n     - `SCLK` (GPIO11) → ADS1299 `SCLK`  \n     - `CS`   (GPIO8)  → ADS1299 `CS`  \n     - `GND`  → ADS1299 `GND`  \n     - `5V`   → ADS1299 `VDD`, etc. (Check board specs)\n   - Attach EEG electrodes to the ADS1299 board inputs.\n\n2. **Install Raspberry Pi OS**\n   - Use [Raspberry Pi Imager](https://www.raspberrypi.com/software/) on your PC/Mac.\n   - Enable SSH in `raspi-config` or via Pi OS Configuration.\n\n3. **Install Rust \u0026 Dependencies**\n   - `sudo apt update \u0026\u0026 sudo apt install build-essential curl`\n   - `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`\n   - `source $HOME/.cargo/env`\n\n4. **Clone This Repo**\n   ```bash\n   git clone git@github.com:\u003cyour-username\u003e/open_eeg.git\n   cd open_eeg\n\n## Building \u0026 Running\n\n1. **Build the workspace**\n   ```bash\n   # Build all crates\n   cargo build\n   \n   # Or build individual crates\n   cd crates/sensors \u0026\u0026 cargo build\n   cd crates/daemon \u0026\u0026 cargo build\n   ```\n\n2. **Run the device daemon**\n   ```bash\n   cd crates/daemon\n   cargo run\n   ```\n\n3. **Run the kiosk (separate terminal)**\n   ```bash\n   cd kiosk\n   npm install\n   npm run dev\n   ```\n\n4. **Expected Behavior**\n   - Device daemon starts and initializes the sensor hardware\n   - Plugin manager loads (currently basic implementation)\n   - Kiosk provides web interface at http://localhost:3000\n   - WebSocket communication between daemon and kiosk\n\n## Usage Instructions\n\n1. Electrode Placement\n   - Place electrodes on the scalp according to your desired montage (e.g., 10-20 system).\n   - Use conductive paste. Ensure good contact and consistent ground/reference electrodes.\n\n2. Real-Time Data Acquisition\n   - Currently, the code is in “demo” mode, reading raw samples and printing them to stdout or logs.\n   - Future versions will include real-time filtering, a ring buffer, and potential streaming to a local GUI or remote client.\n\n3. Data Logging / Output\n   - By default, logs are printed. For CSV logging, we’ll add functionality soon (planned in src/logging.rs).\n\n## Development Notes\n\n- SPI Speed: Currently set to 1_000_000 (1 MHz). You can tweak in src/main.rs if your hardware can handle higher rates.\n- ADS1299 Register Map: See TI’s official datasheet. We plan to implement a dedicated driver module in src/ads1299.rs.\n- Filtering: A basic IIR or FIR filter is planned. We may integrate a DSP crate for advanced filtering (band-pass, notch, etc.).\n\n## Troubleshooting\n\n1. No SPI Response\n   - Check wiring for MOSI/MISO swapped.\n   - Ensure dtparam=spi=on in /boot/config.txt (and reboot).\n\n2. Compile Errors\n   - Update Rust: rustup update.\n   - Confirm Cargo.toml dependencies match in your code.\n\n3. Noise / Poor Signal\n   - Add shielding to electrode cables.\n   - Keep Pi power supply stable, use quality 5 V, 3 A (or more) adapter.\n   - Use short wires for SPI to reduce EMI.\n\n\n## Contributing\n\nWe welcome pull requests, feature suggestions, and bug reports!\n\n- Fork the repository.\n- Create a new branch for your feature or fix.\n- Open a PR against the main branch.\n\n\n## License\n\nThis project is licensed under the GPLv3. By contributing, you agree that your contributions will be licensed under GPLv3 as well.\n\nFor more details, see the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felata-biosciences%2Felata-eeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felata-biosciences%2Felata-eeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felata-biosciences%2Felata-eeg/lists"}