SiLab-Bonn / basil

A data acquisition framework in Python and Verilog.
BSD 3-Clause "New" or "Revised" License
40 stars 29 forks source link

ADD: Arduino environment/analog readout hardware layer #211

Closed mjmucha closed 5 months ago

mjmucha commented 9 months ago

An Arduino firmware based on the NTC readout firmware has been added to read out the pure analog values. This firmware helps to standardize experimental setups with multiple Arduino readout boards by moving the temperature/humidity/pressure calculation to the 'EnvironmentReadout' class instances in the hardware drivers list. It can also reduce the number of different Arduino firmwares required for larger setups to one. This step was also necessary for temperature-corrected humidity measurements in more extreme measurement ranges.

The EnvironmentReadout class has readout functions for temperature, humidity and pressure. The calibration/conversion parameters can be set as init parameters of the corresponding hardware driver, as follows:

hw_drivers:
  - name      : ReadoutEnvHumPres
    type      : arduino_env_readout
    interface : ArduinoBoardEnv
    init :
      ntc_limits : [-55, 70]
      resistors: 51100
      pressure_pin: 7
      humidity_pin: 6
      humidity_params:
        slope: 0.031483
        offset: 0.826
      humidity_temp_correction_params:
        slope: -0.00216
        offset: 1.0546
      pressure_params:
        slope: 27.6
        offset: 33.45

TL;DR: These changes simplify the readout of multiple Arduino "Environment" boards by moving the hardware-dependent calibration constants to the hardware driver configuration as an init parameter. The conversion from analog readout to temperature/humidity/pressure measurement is done by the hardware driver.

Optional improvements:

YannickDieter commented 5 months ago

Please rebase to check if pipeline is now working.

YannickDieter commented 5 months ago

ping