# COSMIIC Biopotential Amplifier (BP2)

The BP2 is a dual-channel biopotential recording module for acquiring myoelectric signals (EMG/MES) from voluntary muscles. It captures differential signals from epimysial or intramuscular electrodes, processes them on-board, and places the results on the CANopen network for use by other modules (e.g., to trigger stimulation patterns).

## How it works

The BP2's **Atmel AT90CAN128** processor manages signal acquisition from two differential electrode pairs (1 cm contact spacing). Raw signals are amplified, filtered, and digitized. The processor performs feature extraction (RMS, threshold detection) and broadcasts processed data over CANopen PDOs for real-time closed-loop control.

Designed for extremity placement near the target muscles, minimizing lead length and maximizing signal quality.

## Hardware

| Parameter | Value |
|-----------|-------|
| Processor | Atmel AT90CAN128 (8-bit AVR) |
| Channels | 2 independent differential |
| Signal Type | Myoelectric (EMG/MES) |
| Electrode Spacing | 1 cm differential |
| Electrode Types | Epimysial or intramuscular |
| Network | CANopen, 4 ports (1 in + 3 out) |
| Power | Network-powered from PM |
| PCB | 4-layer with laser micro-vias |
| Case | Titanium with epoxy header |
| Placement | Extremities (near target muscles) |

## Signal Processing

The BP2 supports multiple recording modes accessible via the NNP-API:
- **Raw mode** (`enterTestRaw`) — stream raw myoelectric signals
- **Feature extraction mode** (`enterTestFeatures`) — on-board RMS/threshold processing
- **Patient mode** (`enterPatient`) — closed-loop EMG-triggered stimulation

## MATLAB Control

```matlab
nnp.networkOn;
nnp.setBPGains(node, ch1_gain, ch2_gain);  % set bandpass filter gains
nnp.enterTestRaw(node, ch);                 % raw EMG streaming
emgRecordRaw(nnp);                          % GUI for EMG visualization
```

## Build

**Source:** [COSMIIC-Community/Implantables-BP2-Hardware](https://github.com/COSMIIC-Community/Implantables-BP2-Hardware) (Apr 2025)

**EDA:** Altium Designer (PcbDoc + SchDoc format)

**Firmware:** [COSMIIC-Community/Implantables-BP2-App](https://github.com/COSMIIC-Community/Implantables-BP2-App) (C, AVR toolchain)

## Source

All design files are open source under CERN-OHL-P-2.0 (hardware) and MIT (firmware).

## Files

| File | Description |
|------|-------------|
| `cosmiic-bp2-altium-project.zip` | Altium project — PcbDoc + 6-page schematic (SchDoc) |
| `cosmiic-bp2-gerbers.zip` | Gerber fabrication files (4-layer with laser micro-vias) |
| `cosmiic-bp2-schematic.pdf` | Full schematic PDF (6 pages) |
| `cosmiic-bp2-assembly.step` | Complete mechanical assembly STEP (titanium case, headers, capthroughs) |
| `cosmiic-bp2-bom-assembly.pdf` | BOM and Assembly Drawing (PDF) |

## Altium Project Structure

The Altium project contains:
- **PCB layout** (`NNP-DWG-165-001-000 BP2 PCB, Unpopulated.PcbDoc`)
- **6-page schematic**: Module overview, System, Microcontroller, Network Interface, Analog-Digital Peripherals, Modular Header

## NSF Relevance

The BP2 module is a dual-channel biopotential amplifier designed for localized myoelectric signal acquisition and processing. Built around an Atmel AT90CAN128 microcontroller, it features differential electrode inputs with 1 cm spacing, low-noise amplification, and on-board preprocessing for EMG and MES analysis. The module includes four network ports for branching topology support, allowing multiple sensor or stimulator modules to operate from a single network.

## Science Drivers

implantable_healthcare

Created by: adonis
Version: v1
Category: sensing
