# Calibration

{% hint style="info" %}
For GUI calibration *guides* see [here](/evolver/getting-started/calibrations.md).
{% endhint %}

## Procedure

{% hint style="info" %}
Communication between the computer and the server is done via [websockets](/evolver/software/server-raspberry-pi.md#websockets-communications).

For more about commands and microcontroller - server communication via serial see [here](/evolver/software/server-raspberry-pi.md#server-serial-communication).
{% endhint %}

### Temperature calibration example:

1. GUI connects to the server via [websockets](/evolver/software/server-raspberry-pi.md#websockets-communications)
2. The user has the GUI sends a temperature off command: `tempi,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,_!`
3. The server passes this to the Arduinos and the temperature Arduino enacts that command
4. The server receives temperature data broadcast from the server
5. The user waits for temperatures to equilibrate in the vials
6. The user measures values from an independent temperature probe for each vial and records these in the GUI
7. The user has the GUI record 3 values at this temperature from the server
8. Steps 2 - 7 are repeated for two higher temperature values
9. When 3 values for 3 different temperatures have been collected, the GUI saves the raw sensor data and the temperature probe data on the server in [calibrations.json](https://github.com/FYNCH-BIO/evolver/blob/master/evolver/calibrations.json)

<figure><img src="/files/Ka6bkd08OcB91EBf31wI" alt=""><figcaption><p>A new calibration save in calibrations.json before fit is performed (no data under fits).</p></figcaption></figure>

10. The GUI uses [calibrate.py](https://github.com/FYNCH-BIO/dpu/blob/master/calibration/calibrate.py) (guide [here](/evolver/getting-started/calibrations/manual-calibration-calibrate.py.md)) to fit raw sensor data from the eVOLVER to experimental temperature probe values (in this case a linear regression)
    1. calibrate.py uses websockets to fetch the sensor and experimental data from the server for a previously run calibration, then does the fit according to the users specifications
    2. The GUI will automatically run this script upon completion of a calibration, but it is also possible to run [manually ](/evolver/getting-started/calibrations/manual-calibration-calibrate.py.md)via the command line to fetch .png files for the calibrations if desired.
11. The GUI adds the calibration fit values to calibrations.json
12. The user can now select this calibration as the active one via the GUI Setup page


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://khalil-lab.gitbook.io/evolver/software/dpu/calibration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
