Package: mmcb-avt
Software support for the ATLAS ITK pixels multi-module cycling boxParticle Physics, University of Liverpool, UKThis repository provides command line tools to monitor and control equipment in theATLAS ITK pixels multi-module cycling boxtest setup, and includes a Python-importable package to read from environmental sensors. It is used in the test setups for a number of other projects for environmental sensing.This project expects to be run on a Raspberry Pi, and has a few dependencies - outlined below - that cannot be automatically installed bypip.Installation (Raspberry Pi OS only)Create a Python virtual environmentmkdir~/dev&&cd~/dev

python3-mvenvpve
.pve/bin/activateAdd. ~/dev/pve/bin/activateto the end of~/.bashrcto activate the Python virtual environment at login.Install package and (most) dependenciespython3 -m pip install --upgrade mmcb-avtThe above installs all the dependencies required except for the MCP9601 and NAU7802.MCP9601 (manual installation)The Adafruit MCP9601 API was broken when last tested, so use the Pimoroni MCP9600 API instead. Since the Pimoroni API is for the MCP9600 rather than the MCP9601, we need to make a small change before installation:gitclonehttps://github.com/pimoroni/mcp9600-pythoncdmcp9600-pythonIn filelibrary/mcp9600/__init__.pymake these changes:Change from:CHIP_ID=0x40I2C_ADDRESSES=list(range(0x60,0x68))I2C_ADDRESS_DEFAULT=0x66I2C_ADDRESS_ALTERNATE=0x67To:CHIP_ID=0x41I2C_ADDRESSES=list(range(0x65,0x68))I2C_ADDRESS_DEFAULT=0x67I2C_ADDRESS_ALTERNATE=0x66Also edit thePYTHON="..."line ininstall.shto point to the correct Python version, which in this case is python3 from the Python virtual environment. Use the full path provided bywhich python3, it'll look something like this:#PYTHON="/usr/bin/python3"PYTHON="/home/ds20k/dev/pve/bin/python3"Then finally:sudo./install.sh--unstableReboot after the above step.NAU7802 (manual installation)cd~/dev
gitclonehttps://github.com/CedarGroveStudios/CircuitPython_NAU7802.git# copy file into the python virtual environment# For 64-bit Raspberry Pi OS (Python virtual environment)cp~/dev/CircuitPython_NAU7802/cedargrove_nau7802.py~/dev/pve/lib/python3.9/site-packages/# For 32-bit Raspberry Pi OS (distribution's Python)sudocp~/dev/CircuitPython_NAU7802/cedargrove_nau7802.py/usr/local/lib/python3.7/dist-packages/# For 32-bit Raspberry Pi OS (Python virtual environment)sudocp~/dev/CircuitPython_NAU7802/cedargrove_nau7802.py~/dev/pve/lib/python3.7/site-packages/NotesThe installation process will make the following new commands available in the shell:Main commandsCommandFunctiondmmReads voltage/current values from the Keithley DMM6500 6.5 digit multimeter.ivConfigurable script to measure IV/IT curves using the Keithley 2410/2614b (RS232). It can operate multiple PSUs concurrently, embed environmental data into log files, and can be easily used in shell scripts to automate tasks such as HV-cycling.peltierQueries and/or sets parameters for the two relay boards that control the polarity of the four Peltier devices, via Raspberry Pi GPIO pins.psusetSets current/voltage parameters for power supplies (RS232: Keithley 2410/2614b, Hameg HMP4040). Works in both constant voltage and constant current modes.senseReads environmental sensors connected to the Raspberry Pi by I2C. Hardware setup is specified in a user defined configuration file. Progressively writes data to a human-readable log file, and streams compressed binary data to anHDF5file. Directly supports the BME680, HYT221, NAU7802, SHTC3 sensors, and various thermocouples via MCP9601. Indirectly supports theSMC ZSE30A-01-F,SMC PFM725S-F01-Fand the ATLAS common hybrid module NTC viaADS1015and PCF8591 ADCs.ult80Queries and/or sets parameters for the ULT80 chiller (RS232).Support commandsCommandFunctiondat2plotFrom the binary data files generated bysense, create two plots featuring all environmental sensors/parameters: the first will contain the raw data acquired vs time, the second contains summary statistics.dat2rootCreates aCERN ROOTfile containing the raw data from binary data files generated bysense, as well as a plot for each parameter.detectDetects equipment attached by RS232, writes a cache file containing identified equipment to~/.cache.json. Runonceafter the RS232 configuration has changed.liveplotCompanion toiv. Displays IV plot in real-time in a graphical window.log2datCreates a.datfile from the log filesensecreates. Principally used with archived legacy data where binary data files are not available.psustatProvides a single-shot view of the status of all power supply channels (RS232: Keithley 2410/2614b, Hameg HMP4040).In addition, once in the Pythonvenv, you will be able to do this:(pve)ds20k@raspberrypi:~$python3Python3.9.2(default,Feb282021,17:03:44)[GCC10.2.120210110]onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>importmmcb.configure_environmentasce>>>testenv=ce.TestEnvironment('config.txt')>>>measurements=testenv.read_all_sensors()>>>measurements{'timestamp':1653844116.1013656,'hyt_M1 °C':21.12342061893426,'hyt_M1 RH%':0.0,'hyt_env °C':21.324848928767622,'hyt_env RH%':0.0,'hyt_M4 °C':21.113349203442596,'hyt_M4 RH%':0.0,'ntc_M1 °C':18.874264620930205,'smc kPa':-95.29101904000001,'ntc_M4 °C':-60.849429204693735,'TC_VC4 °C':20.3125,'TC_VC1 °C':19.375,'TC_N2 °C':20.75,'TC_VC3 °C':21.0,'TC_VC2 °C':21.25,'sht_ambient °C':23.43,'sht_ambient RH%':31.48,'bme_ambient °C':23.924921875,'bme_ambient RH%':26.04732304850249,'bme_ambient hPa':1014.36410289236}>>>measurements.get('hyt_M4 °C',None)21.113349203442596Python interface for the Keithley DMM6500(pve)avt@raspberrypi:~$python3Python3.9.2(default,Feb282021,17:03:44)[GCC10.2.120210110]onlinuxType"help","copyright","credits"or"license"formoreinformation.>>>frommmcbimportdmm_interfacecache:keithleyinstrumentsdmm6500serialnumber04592428on/dev/ttyUSB0>>>dmm=dmm_interface.Dmm6500()>>>dmm.dmm.configure_read_ac_current(dmm.configure_read_dc_voltage(dmm.remove(dmm.configure_read_ac_voltage(dmm.configure_read_resistance(dmm.removeddmm.configure_read_capacitance(dmm.configure_read_temperature(dmm.configure_read_dc_current(dmm.read_value(>>>dmm.configure_read_capacitance()>>>c=dmm.read_value()>>>c1.0465248938e-07>>>frommmcbimportcommon>>>common.si_prefix(v)'104.652n'Check the installed version:(pve)avt@raspberrypi:~ $python3-mpipshowmmcb-avtName: mmcb-avtVersion: 0.0.78Summary: ATLAS ITK Pixels Multi-Module Cycling Box environmental monitoring/control.Home-page: https://gitlab.ph.liv.ac.uk/avt/atlas-itk-pmmcbAuthor: Alan Taylor, Manex OrmazabalAuthor-email: avt@hep.ph.liv.ac.ukLicense: NoneLocation: /home/avt/dev/pve/lib/python3.9/site-packagesRequires: adafruit-circuitpython-shtc3, smbus, adafruit-circuitpython-pcf8591, pandas, zmq, yoctopuce, sparkfun-qwiic-tca9548a, Adafruit-Blinka, adafruit-circuitpython-bme680, tables, matplotlib, numpy, adafruit-circuitpython-ads1x15, pyserialRequired-by: