
SerialOlfactometerController
neurorishika/MultiBiOS
High-precision, hardware-clocked olfactometer control system for behavioral neuroscience

High-precision, hardware-clocked olfactometer control system for behavioral neuroscience
TeensyOpenLoop is an open-source printed circuit board by neurorishika, from the neurorishika/MultiBiOS repository on GitHub, published under the MIT licence. It is a 2-layer board of 111.1 × 86 mm with 25 parts on 95 nets, routed with 179 tracks and 0 vias.
It is built around the SN74AHCT125N, TEENSY 4.1 and SN74LVC245AN, with the PJ-002B, TST-102-01-G-D and TST-103-03-T-D among its other parts. Its parts include 6 capacitors, 6 connectors, 5 ICs and 4 resistors. It belongs with the NXP (LPC, Kinetis, i.MX RT) boards of this library.
High-precision, hardware-clocked olfactometer control system for behavioral neuroscience
📚 Documentation • 🚀 Quick Start • 🔧 Installation • 📖 Examples • 🤝 Contributing
MultiBiOS (Multispecies Bilateral Odor delivery System) is a precision olfactometer control system designed for behavioral neuroscience experiments. It provides sub-millisecond timing control, complete experimental reproducibility, and comprehensive data logging.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ YAML Protocol │───▶│ Python Compiler │───▶│ NI-DAQ USB │
│ Description │ │ & Runner │ │ 6353 │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Teensy 4.1 MCU │
│ (Valve Pattern Preloading) │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ TPIC6B595 Shift Registers │
│ (10MHz SPI Chain) │
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Olfactometer Valve Arrays │
│ (8-valve bilateral control) │
└─────────────────────────────────────┘PySpinfictrac block in config/hardware.yaml# Clone the repository
git clone https://github.com/neurorishika/MultiBiOS.git
cd MultiBiOS
# Create the shared NI-DAQ + Blackfly camera environment
conda env create -f environment.yml
conda activate multibios-blackfly
# Verify the combined stack
python -c "import multibios, nidaqmx, PySpin; print('multibios-blackfly ready')"
# Optional app smoke tests
multibios-explorer --help
multibios-flow-monitor --helpThis environment is intended to run both the MultiBiOS DAQ stack and the Blackfly camera scripts in one place. The rig camera model is Teledyne FLIR Blackfly S BFS-U3-13Y3M.
For live FicTrac on the Blackfly side camera, see docs/fictrac.md. MultiBiOS now prepares the Spinnaker runtime DLL path automatically before launching FicTrac, but you still need a FicTrac binary built with the upstream PGR_USB3 option.
If you are on this workstation and want the same validated build that was used for the Blackfly side camera, run:
cd C:\Rishika\MultiBiOS
.\tools\build_fictrac_spinnaker.ps1 -VcpkgRoot C:\Users\markd\vcpkgThe resulting binary is expected at assets/fictrac-spinnaker/fictrac-spinnaker.exe. The step-by-step build and usage guide lives in docs/fictrac.md.
FicTrac is treated as vendored source in this repo because MultiBiOS carries source-level patches in assets/third_party/FicTrac. The local build directory assets/third_party/FicTrac-build should remain untracked.
Preview a protocol (no hardware required):
python -m multibios.run_protocol \
--yaml protocols/example_protocol.yaml \
--hardware config/hardware.yaml \
--dry-run --interactiveRun on hardware (requires NI-DAQ setup):
python -m multibios.run_protocol \
--yaml protocols/example_protocol.yaml \
--hardware config/hardware.yamlRun with real-time progress monitoring:
python -m multibios.run_protocol \
--yaml protocols/example_protocol.yaml \
--hardware config/hardware.yaml \
--verbose --progressThis displays the expected protocol state during execution:
DO Legend: [0:RCK] [1:LOAD_REQ] [2:S0] [3:S1] [4:S2]
AO Legend: [0:MFC1] [1:MFC2]
[ 5%] 250.0ms | DO:░█░░█ | AO:0:2.50,1:1.20
[ 10%] 500.0ms | DO:█░█░░ | AO:0:3.00,1:1.50(█=HIGH, ░=LOW, shows all channels at once!)
Analyze results:
python -m multibios.viz_protocol data/runs/latest
## 📖 Examples
### Simple Bilateral Odor Delivery
```yaml
protocol:
name: "Bilateral Odor Comparison"
timing:
sample_rate: 1000 # 1 kHz sampling
seed: 42 # Reproducible randomization
sequence:
- phase: "Baseline"
duration: 30000 # 30 seconds
times: 1
actions:
- device: "olfactometer.left"
state: "AIR"
timing: 0
- device: "olfactometer.right"
state: "AIR"
timing: 0
- phase: "Odor Presentation" sequence:
- phase: "Complex Trial"
duration: 45000
times: 10
actions:
# MFC setpoints
- device: "mfc.air_left_setpoint"
value: 2.1 # Volts
timing: 0
# Synchronized valve switching
- device: "olfactometer.left"
state: "ODOR1"
timing: 5000
- device: "switch_valve.left"
state: "ODOR"
timing: 5100 # 100ms later
# Continuous camera triggers
- device: "triggers.camera_continuous"
state: true
timing: 1000
- device: "triggers.camera_continuous"
state: false
timing: 40000| Component | Description | Quantity |
|---|---|---|
| NI USB-6353 | Hardware-clocked DAQ | 1 |
| Teensy 4.1 | Microcontroller for valve control | 1 |
| TPIC6B595 | High-power shift registers | 4 |
| Olfactometer valves | Pneumatic valves (12V) | 8-16 |
| Mass flow controllers | Precision flow control | 2-4 |
NI-DAQ ────┐
├─── LOAD_REQ (Hardware clock)
├─── S-bits (Device selection)
├─── Analog I/O (MFC control)
└─── Triggers (Microscope/Camera)
Teensy ────┐
├─── SPI Chain (10MHz)
├─── Interrupt handling
└─── Safety interlocks
TPIC6B595 ─┼─── Valve Array Left
├─── Valve Array Right
├─── Switch Valve Left
└─── Switch Valve Right📋 Complete wiring diagrams and setup instructions →
MultiBiOS provides comprehensive data logging:
data/runs/2025-08-21_14-07-33/
├── protocol_original.yaml # Original protocol
├── protocol_compiled.yaml # Compiled with timing
├── hardware_config.yaml # Hardware configuration
├── digital_output.npy # DO timing arrays
├── analog_output.npy # AO setpoints
├── analog_input.csv # MFC feedback (if recorded)
├── timing_log.csv # Execution timestamps
└── visualization.html # Interactive plotThe system generates rich interactive plots showing:
MultiBiOS is designed for:
Comprehensive documentation is available at neurorishika.github.io/MultiBiOS
We welcome contributions! MultiBiOS is built for the neuroscience community.
# Fork the repository on GitHub
git clone https://github.com/yourusername/MultiBiOS.git
cd MultiBiOS
# Install development dependencies
poetry install --with dev
# Run tests
poetry run pytest
# Format code
poetry run black multibios/
poetry run ruff check multibios/tests/ is reserved for automated pytest coverage.tools/manual_checks/ is for operator-facing hardware checks, probes, and bench scripts that are meant to be run directly.tests/ and keep live camera, DAQ, MFC, or FicTrac helpers under tools/manual_checks/.For a quick automated smoke pass from the repo root, run:
pytest tests/This project is licensed under the MIT License - see the LICENSE file for details.
MultiBiOS was developed for the neuroscience research community. Special thanks to:
🧠 Built for Neuroscience • 🔬 Made with Science • 🚀 Open Source
| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 0.1u | Capacitor_SMD:C_0603_1608Metric | C1, C2, C3, C4 |
| 4 | 33 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1, R2, R3, R4 |
| 4 | MountingHole_Pad | MountingHole:MountingHole_3.2mm_M3_Pad | H1, H2, H3, H4 |
| 2 | 10u | Capacitor_SMD:C_0603_1608Metric | C5, C6 |
| 2 | PJ-002B | PJ-002B:CUI_PJ-002B | J5, J7 |
| 2 | SN74AHCT125N | SN74AHCT125N:N14 | U3, U4 |
| 2 | SN74LVC245AN | SN74LVC245AN:N20 | U2, U6 |
| 1 | TST-102-01-G-D | TST-102-01-G-D:SAMTEC_TST-102-01-G-D | J3 |
| 1 | TST-103-03-T-D | TST-103-01-G-D:SAMTEC_TST-103-03-T-D | J2 |
| 1 | TST-104-01-G-D | TST-104-01-G-D:SAMTEC_TST-104-01-G-D | J1 |
| 1 | TST-105-01-X-D | TST-105-01-G-D:SAMTEC_TST-105-01-X-D | J6 |
| 1 | Teensy4.1 | Teensy:Teensy41 | U1 |

neurorishika/MultiBiOS
High-precision, hardware-clocked olfactometer control system for behavioral neuroscience

neurorishika/MultiBiOS
High-precision, hardware-clocked olfactometer control system for behavioral neuroscience

neurorishika/MultiBiOS
High-precision, hardware-clocked olfactometer control system for behavioral neuroscience

ekatynski/WCS1700-Calibrator
A board designed to aid in calibrating six Winson WCS1700 hall effect sensors a the same time.

openhwfoundation/core-v-mcu-devkit
This is the CORE-V MCU DevKit project, hosting the open-source artifacts for the CORE-V MCU Development Kit.


FranTerrassa/Ardutester
Aparato a base de arduino para comprobar estado de componentes electrónicos

luispaulomr/alr3000z_firmware
Firmware for ALR3000z (development board based on PIC18F4550).

rhit-bouchemj/AnesthesiaSeniorDesign
The Repo for Senior Design project of creating an Open-Source Anesthesia Pump


MicroCoreLabs/Projects
Ted Fried's MicroCore Labs Projects - FPGA CPU cores and emulators for the 8088, 8086, 8051, 6502, 68000, Z80, Risc-V, and also Typewriter and EPROM Emulator projects.
It measures 111.1 × 86 mm and has 2 copper layers, 1.6 mm thick.
25 parts, built around the SN74AHCT125N, TEENSY 4.1, SN74LVC245AN and PJ-002B. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the neurorishika/MultiBiOS repository on GitHub, at the commit this page was made from: the board is rig/electrical/TeensyOpenLoop/TeensyOpenLoop.kicad_pcb and its schematic rig/electrical/SerialIndicationTerminator/SerialIndicationTerminator.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).