Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD: Arduino environment/analog readout hardware layer #211

Merged
merged 8 commits into from May 15, 2024

Conversation

mjmucha
Copy link
Member

@mjmucha mjmucha commented Jan 15, 2024

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:

  • [ ] Allow multiple humidity/pressure pins

@YannickDieter
Copy link
Contributor

Please rebase to check if pipeline is now working.

konstantinmauer and others added 4 commits April 24, 2024 16:56
* PRJ: Update workflow (verilog version, python version)

---------

Co-authored-by: Yannick Dieter <yannick.manuel.dieter@cern.ch>
Co-authored-by: Christian Bespin <11457592+cbespin@users.noreply.github.com>
Co-authored-by: Christian Bespin <silab@debian-BULLSEYE-live-builder-AMD64>
@mjmucha mjmucha requested a review from cbespin April 29, 2024 11:55
Copy link
Contributor

@cbespin cbespin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not enough experience with arduino to comment on the ino files, but if it works, I trust you. Nicely commented for those who want to contribute!
Only thing is the python-style function naming ;)

basil/HL/arduino_env_readout.py Outdated Show resolved Hide resolved
@YannickDieter
Copy link
Contributor

ping

Copy link
Contributor

@cbespin cbespin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the changes! I will merge this now. The next release is coming closer 🎊

@cbespin cbespin merged commit 417fdd2 into master May 15, 2024
5 checks passed
@cbespin cbespin deleted the arduino_analog_readout branch May 15, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants