A simplified, open-source behavioural recording platform focusing on robust mouse locomotion tracking as the first step towards scalable behavioural phenotyping.
The Mini Behaviour Box is an open-source, standardised behavioural recording platform for automated mouse locomotion tracking. The system combines video acquisition with rotary encoder-based locomotion measurement and is built around the Harp ecosystem using Bonsai for hardware control, data synchronisation, and data acquisition. The long-term objective of this project is to establish a scalable behavioural phenotyping pipeline that can be used to pre-screen experimental animals before downstream experiments. By identifying behavioural differences at an early stage, the platform aims to improve experimental efficiency, reduce unnecessary resource use, and support the principles of animal welfare by helping minimise the number of animals required for subsequent studies.
Standardised behavioural acquisition Reproducible recording of spontaneous mouse behaviour across experiments.
Video-based tracking Continuous camera capture for behavioural observation and offline analysis.
Rotary encoder locomotion measurement High-temporal-resolution quantification of voluntary wheel movement.
Harp ecosystem integration Reliable hardware communication and synchronised timestamping.
Bonsai-based acquisition workflows Open, modular, and easily customisable data acquisition pipelines.
Designed for behavioural pre-screening Supports early identification of behavioural phenotypes before downstream experimental procedures.
Open-source and extensible Built to facilitate community development and future integration of additional behavioural measurements.
| # | Part | Qty | Supplier | Cost | Notes |
|---|---|---|---|---|---|
| 1 | 3D Print Filament | 2 | Bambu Lab | 18*2 | PLA |
| 2 | FLIR cameras | 1 | FLIR | 277 | BFS-U3-16S2M-CS |
| 3 | Rotary Encoder | 1 | Ali-Express | 18 | |
| 4 | HARP Behaviour Board | 1 | HARP | 415 | |
| 5 | locking USB 3.0 Micro-B cable | 1 | Amazon | 18 | |
| 6 | GPIO cable | 1 | Digikey | 33 | For Camera Trigger |
Approximate total: £800
- Print and Assemble — STL files in (assembly/). Print settings: 15% infill, enable support when needed.
- Follow the assembly guide.
- Wire — See wiring .
- Software — See Software
Brief instructions to go from assembled box to running a first session:
The Software section explains how to configure the camera and experiment settings. Once the hardware has been assembled and configured, follow the steps below to perform a behavioural recording.
-
Clean the behaviour box using dehydrated ethanol (or another suitable disinfectant), then wipe all surfaces thoroughly to ensure the box is completely dry.
-
Place the mouse into the behaviour box.
-
Install the lid with the camera attached.
Note: If area measurements (e.g. mouse area per frame) are required, ensure that the camera orientation matches the predefined crop region. See the Software section for further details.
-
Connect all required hardware:
- 12 V power supply to the Harp Behaviour Board
- Rotary encoder to the Harp Behaviour Board (default Port P0)
- IR LED strip power supply
- Camera USB cable to the computer
- Camera GPIO trigger cable to the Harp Behaviour Board
-
Minimise external lighting by either:
- Turning off the room lights, or
- Covering the behaviour box with black fabric (recommended).
-
Open the Bonsai workflow and verify that the live camera preview is updating correctly.
-
Configure the experiment settings (e.g. save directory, subject ID, session ID and trial length), then click Start.
-
Recording will stop automatically once the specified trial length has been reached. Both a video recording and a CSV file containing the behavioural data will be saved automatically.
-
Remove the mouse from the behaviour box and return it to its home cage.
-
Clean the behaviour box before the next recording. Carefully inspect all corners of the box, as mouse faeces can be difficult to spot.
-
No live camera preview
- Check that the camera is connected via the Locking USB 3.0 cable.
- Verify that the correct version of the Spinnaker SDK is installed.
- Ensure the camera serial number matches the connected device.
-
Rotary encoder not responding
- Check the RJ45 connection to the Harp Behaviour Board.
- Verify that the encoder is connected to the correct input pins.
If the camera preview and CSV output windows do not appear after starting the workflow, they can be reopened manually.
- Right-click the Logging node and select Show Default Editor...
- In the editor window, right-click the LogVideo node and select Show Default Editor...
- Right-click the VideoWriter node and select:
- Show Visualizer
- *Bonsai.ImageVisualizer
- Right-click the CSVWriter node.
- Select:
- Show Visualizer
- *Bonsai.TextVisualizer
Tip
Avoid closing these visualizer windows manually. When the workflow is stopped, Bonsai will close them automatically. If they remain open during normal operation, they will automatically reappear the next time the workflow is started.