This C++ project aggregates the code and documentation for all Ataraxis Micro Controllers (AXMCs) used in Sun (NeuroAI) lab data acquisition pipelines.
This library builds on top of the general architecture defined by the ataraxis-micro-controller library to implement the hardware modules used in the Sun lab. This project is explicitly designed and built to work with the hardware made and used in the lab, and will likely not work in other contexts without extensive modification. It is made public to serve as the real-world example of how to use 'Ataraxis' libraries to acquire scientific data.
Note, the rest of this ReadMe assumes familiarity with the procedures, experiments, and tools used in the Sun lab to acquire scientific data. See our publications before reading further, if you are not familiar with the work done in the lab.
Currently, we use three microcontrollers as part of our behavior data acquisition pipeline: AMC-ACTOR, AMC-SENSOR, and AMC-ENCODER. The Actor is used to interface with the hardware modules that control the experiment environment, for example, to deliver water, lock running wheel, and activate Virtual Reality screens. The Sensor is used to monitor most data-acquisition devices, such as torque sensor, lick sensor, and Mesoscope frame timestamp sensor. The Encoder uses hardware interrupt logic to monitor the animal’s movement at a high frequency and resolution, which is necessary to properly update the Virtual Reality world used to facilitate experiments in the lab. Using this combination of microcontrollers maximizes the data acquisition speed while avoiding communication channel overloading.
This project contains both the schematics for assembling the microcontrollers used in the lab and the code that runs on these microcontrollers. The hardware created and programmed as part of this project is designed to be interfaced through the bindings available from the sl-experiment library, which is a core dependency for every Sun lab project.
- Dependencies
- Hardware Assembly
- Software Installation
- Usage
- API Documentation
- Versioning
- Authors
- License
- Acknowledgements
- Platformio IDE to upload the code to each microcontroller.
These dependencies will be automatically resolved whenever the library is installed via Platformio.
To assemble the microcontroller hardware, consult the schematics and instructions reflecting the latest state of our microcontroller hardware.
Note, the provided link only covers the microcontrollers and does not discuss the assembly of other experiment-facilitating devices, such as the treadmill system or visual recording systems. Consult the main sl-experiment library or previous lab publications for details on assembling other data acquisition system components.
- Download this repository to a local PC with direct USB access to the microcontrollers. Use the latest stable release from GitHub, as it always reflects the current state of our data acquisition hardware.
- Open the project in the 'Platformio' IDE.
- Connect a single microcontroller to the host PC and select the microcontroller type by modifying the preprocessor directive on line 26 of the main.cpp. Do NOT connect more than a single controller at a time, as some systems have issues selecting the correct upload target otherwise.
- After uploading the code, disconnect the microcontroller from the host-PC and connect the next microcontroller.
- Repeat steps 3 and 4 until all microcontrollers are configured.
- Connect all microcontrollers to the PC that will manage the data acquisition runtime (in our case, the VRPC).
Once the microcontrollers are assembled, configured, and connected to the VRPC, they can be accessed via the sl-experiment library.
See the API documentation for the detailed description of the methods and classes exposed by components of this library.
We use semantic versioning for this project. For the versions available, see the tags on this repository.
- Ivan Kondratyev (Inkaros)
This project is licensed under the GPL3 License: see the LICENSE file for details.
- All Sun Lab members for providing the inspiration and comments during the development of this library.
- The creators of all other projects used in our development automation pipelines see tox.ini and in our source code see platformio.ini.