Raspberry-Pi experiment controller for insect electroreception assays: three colour-coded GPIO-driven current lines, a startle shaker, a light, and synchronised video or image capture.
Originally written in 2017 (Python 2) for a single experiment; refactored in 2026 into a small Python 3.11+ package with a mock GPIO backend so the scheduling and analysis pieces can be developed and tested off-Pi.
| Channel | Default GPIO (BCM) | Purpose |
|---|---|---|
| red | 18 | current line A |
| blue | 24 | current line B |
| yellow | 8 | current line C |
| light | 14 | illumination for camera frames |
| shaker | 13 | mechanical startle stimulus |
Pin assignments live in currentsensation.constants and can be overridden
per deployment.
# off-Pi development (mock GPIO backend, no RPi.GPIO needed)
pip install -e ".[dev]"
# on a Raspberry Pi
pip install -e ".[pi]"currentsensation run \
--save-dir /mnt/data/expt-2026-05-15 \
--reps 3 \
--stim-dur 1800 \
--peri-stim-dur 30 \
--shake-dur 30 \
--lines red,blue,yellow \
--capture videoIf you use this software, please cite via the metadata in
CITATION.cff.