To use the software, in the root directory, run
uv run --group brainslosher_group brainslosher --simulated Note that this package is intended to run on a Raspberry Pi with a particular hardware configuration.
See the hardware configuration for the device's wiring configuration.
Enable I2C interface via Raspi-Config under Interface Options.
sudo raspi-configEnsure virtual environments can be created
sudo apt install python3-venvRecommended(!!): Create a new environment.
python3 -m venv brainwasherEnter the environment.
source ~/brainwasher/bin/activateTo use the software, in the root directory, run
pip install -e .To develop the code, run
pip install -e .[dev]If Python drivers were not installed automatically with the first command, you can install them manually from their respective repositories here:
There are two strategies for editing code on the Raspberry Pi.
Since the Raspberry Pi doesn't have all the text editing bells-and-whistles of your PC, you can develop all the code on your PC and synchronize the code folder with the Pi to execute the result.
To do so, in Linux, use the rsync command
rsync -a /path/to/brainwasher/ pi@raspberrypi.local:/path/to/destination_folder --exclude=".*"
Note that the slash at the end of the source directory path is required.
Then run
uv sync
Now you can avoid installing Github credentials to push code from the device itself, and simply develop entirely on your PC!
The Raspberry Pi 4 and 5 are fast enough that you can develop code on the Pi itself if needed. To do so, login to the Pi, setup Git, and edit files on the device itself.
TODO: systemd setup.
A job file is a sequence of wash steps along with some metadata.
A sample job file looks like the following:
history:
events: []
name: test_thf_and_dcm
protocol:
- duration_s: 3.0
mix_speed_rpm: 1200.0
solution:
deionized_water: 7000.0
thf: 3000.0
- duration_s: 3.0
mix_speed_rpm: 1200.0
solution:
deionized_water: 1000.0
thf: 9000.0
- duration_s: 3.0
mix_speed_rpm: 1200.0
solution:
thf: 10000.0
- duration_s: 3.0
mix_speed_rpm: 1200.0
solution:
dcm: 10000.0
- duration_s: 3.0
mix_speed_rpm: 1200.0
solution:
dcm: 10000.0
- duration_s: 0.0
mix_speed_rpm: 0.0
solution:
deionized_water: 10000.0
source_protocol:
path: /home/brainwasher/protocols/demo_protocol.csv # This value is ignored right now.
starting_solution:
pbs: 10000.0
A step in the protocol has the following required steps:
- duration_s: 60 # [seconds]. How long to remain in this step.
mix_speed_rpm: 0.0 # [rpm]. 0 for "no mixing." Minimum on-speed: 360; max: 6000.
solution: # a dictionary, keyed by solution name, of volumes in microliters.
deionized_water: 10000.0These additional steps are optional:
start_empty: true # If true, empty the reaction vessel before filling with solution for this step. Default is true.
end_empty: false # If true, empty the reaction vessel before exiting this step. Default is false.
intermittent_mixing_on_time: None # Float. If specified, duty cycle of leaving the motor on at the specified RPM.
intermittent_mixing_off_time: None # Float. If specified, duty cycle of of leaving the motor off at the specified RPM.Once the job file is executed, extra (computed) fields will be added afterwards. These fields are not required will be recomputed if the required fields change.
To create a new job, you can simply copy the following skeleton of required fields and then add a list of protocol steps.
history:
events: []
name: <sample name here>
protocol:
- # Add steps here!
- # Step 0
- # Step 1 ...
source_protocol:
path: /dev/null # This value is ignored right now.
starting_solution:
pbs: 10000.0 # This is what the reaction vessel is first filled with.
- If the job was created elsewhere, load the job onto the machine via USB stick or
scp. - Load the reaction vessel with brain along with starting liquid (most likely PBS).
- Ensure reagents are fresh and topped off.
- Ensure waste bottles are empty or have sufficient empty volume.
- Launch the console by running
main.pyin the projectbinfolder. - From the console, type in
run /path/to/job_file.yamland press