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

High-precision, hardware-clocked olfactometer control system for behavioral neuroscience
SerialValveController 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 72.2 × 50.8 mm with 25 parts on 23 nets, routed with 193 tracks and 3 vias.
It is built around the TPIC6595N and 1N4757A. Its parts include 6 resistors, 5 connectors, 3 capacitors, 2 diodes and 1 IC. 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 |
|---|---|---|---|
| 5 | 33Ω | Resistor_SMD:R_0603_1608Metric | R3, R4, R5, R6, R7 |
| 4 | TestPoint | TestPoint:TestPoint_Pad_2.0x2.0mm | TP1, TP2, TP3, TP4 |
| 2 | 10uf | Capacitor_SMD:C_0603_1608Metric | C3, C4 |
| 2 | 1N4005 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D1, D2 |
| 2 | 1N4757A | 1N4757:DIODE_AFL-W2Y1.8D_MOT | CR1, CR2 |
| 2 | MountingHole | MountingHole:MountingHole_3.2mm_M3_DIN965_Pad | H1, H2 |
| 2 | Screw_Terminal_01x02 | 1935310:PHOENIX_1935310 | J1, J2 |
| 2 | TST-105-01-X-D | TST-105-01-G-D:SAMTEC_TST-105-01-X-D | J18, J19 |
| 1 | 0.1u | Capacitor_SMD:C_0603_1608Metric | C2 |
| 1 | 10k | Resistor_SMD:R_0603_1608Metric | R1 |
| 1 | Conn_01x05_Socket | Connector_PinSocket_2.54mm:PinSocket_1x05_P2.54mm_Vertical | J17 |
| 1 | TPIC6595 | TPIC6B595N:DIP254P762X508-20 | U1 |
It measures 72.2 × 50.8 mm and has 2 copper layers, 1.6 mm thick.
25 parts, built around the TPIC6595N and 1N4757A. 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/SerialValveController/SerialValveController.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).

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

alextousss/3d_ultrasonic_scanner
An ultrasonic 3D scanner

atomic14/supersise-seven-segment
The code, schematics and PCB layout are offered here without any support. It's fun project but it's also a learning experience.

SamWarmuth/SWSplitFlap
3D printable split flap display (software/pcb/STLs), for a more detailed split flap project see https://github.com/scottbez1/splitflap



pascalscheffers/signalex
Code and PCB for driving Signalex 7 Segment Displays.

petengenhariabiomedica/Teclado-de-leitura-em-braile
Projeto de tecnologia assistiva voltado para pessoas cegas, consiste em um teclado que reproduzirá palavras da tela de um computador em letras em braile.
