Raspberry Pi integration opens a host of advanced functionality to Bpod users.
It is always difficult to anticipate what hardware neuroscientists may need to hack into their behavior rigs - because the range of possible behaviors and task contingencies is unfathomably large. We designed Bpod with this in mind - via its 'Module' interface, the state machine can exchange very low latency byte codes with other embedded devices that support UART - most notably, the Arduino and Teensy development board ecosystems. We designed an array of Bpod modules powered by Arduino and Teensy boards to encapsulate common tasks, and provided interface "Shields" to simplify user hardware integration with both platforms.
A conspicuous gap in Bpod's compatibility profile has been the Raspberry Pi family of single board Linux computers and "Hat" expansion boards. To harness the power of the pi, we developed the Bpod Raspberry Pi Shim, now available in our web shop. The shim connects the state machine's RS-485 bus to Raspberry Pi's UART interface, via pins on Raspberry Pi's GPIO header. Additional raspberry pi "Hats" can be stacked on top of the shim, to add functionality. Example Python code for Raspberry Pi is available in the development branch of the Bpod_Gen2 repository here (until the next stable Bpod_Gen2 release).
We anticipate a broad range of Bpod extensions powered by Raspberry Pi. Microcontrollers excel in cases where timing precision is critical, but lack memory and specialized hardware for high bandwidth data streams (e.g. HD audio + video capture and playback). Raspberry Pi 4 has sufficient processing bandwidth that with a minimal operating system (e.g. Raspberry Pi OS Lite) and careful programming, event latencies and jitter can approach the sub-millisecond range desirable for most Neurophysiology and imaging experiments.
In the coming months we will release additional Raspberry pi demo code, to create useful starting points for module development. As always, we encourage early adopters to keep us informed about your applications and progress!