LungElast—an open-source, flexible, low-cost, microprocessor-controlled mouse lung elastometer

The study of mouse lung mechanics provides essential insights into the physiological mechanisms of pulmonary disease. Consequently, investigators assemble custom systems comprising infusion-withdrawal syringe pumps and analog pressure sensors to investigate the lung function of these animals. But these systems are expensive and require ongoing regulation, making them challenging to use. Here I introduce LungElast, an open-source, inexpensive, and self-contained instrument that can experimentally determine lung elasticity and volumes even in immature mice. It is assembled using custom 3D printed parts and readily available or easily constructed components. In this device, a microprocessor-controlled stepper motor automatically regulates lung volume by precisely driving a syringe piston whose position is determined using time-of-flight LIDAR technology. The airway pressures associated with the lung volumes are determined using compact sensor-on-chip technology, retrieved in a digital format, and stored by the microcontroller. The instrument software is modular, which eases device testing, calibration, and use. Data are also provided here that specify the accuracy and precision of the elastometer’s sensors and volume delivery and demonstrate its use with lung models and mouse pups. This instrument has excellent potential for research and educational work.


Supplementary Information
SI page Fig. S1 2 Fig. S2 3 Fig. S3 4 Fig. S4 5 Table S1 6 Table S2 8 Table S3 10 Table S4 12  Figure S2. Flow diagram of the DistVolCal script. After a communications link with LungElast is established and it initializes the sensor objects, the user is given the option to calibrate the syringe plunger movements, its volume delivery, or to stop the script. For the position calibration, the user enters estimates of the maximum and minimum lead nut -ToF sensor target positions for the system that they constructed. The 5mm markers printed on one of the lead nut guides can aid in these measurements. Then, the script instructs LungElast to move the syringe plunger to the indicated distances and asks the user to confirm that the positions are satisfactory or whether they need to be revised. For the volume delivery calibration, the syringe is emptied by its plunger being moved to the maximum location set above. The user is then asked to attach flexible tubing to the syringe and immerse its free end in water. Then the syringe plunger is moved to the minimum location while filling with water. After the device purges air remaining in the syringe, the user is asked to move the free end of the tubing to an empty receptacle and then the motor moves a predetermined number of steps and empties water into the container. After the user determines the extruded volume gravimetrically, they can calculate the volume delivery. The calibrated positions and volume delivery results are then updated for the device using the customizations script. The user can the repeat these calibrations or stop the DistVolCal script. Figure S3. P-V validation data using elastomeric lungs. The pressures resulting from LungElast sequentially injected volumes of gas (black circles) into latex model lungs with soft (left) and stiff (right) elasticity until a maximum pressure of 35 cmH 2 O was quantified. Subsequently, the pressures resulting from removing volumes of air (red circles) were measured until atmospheric pressure was achieved. The individual measurements from seven separate experiments are shown, with the lines connecting average values. In most cases, the variability in the individual P-V results was too small to allow the individual data points to be discerned. The P-V relationships for deflation pressures ≤ 10 cmH 2 O were modeled using linear regression (green line) and the change in pressure associated with volume was calculate yielding the model lung elastance (C 0-10 , in ml/cmH 2 O). The residual standard error (RSE), R-squared, and P-value are shown.  Figure S4. P-V validation data using P21 mouse pup lungs. A. The pressures resulting from sequentially injecting 35 µl volumes of air until a pressure of 35 cmH 2 O was detected (black circles) and then incrementally removing the same volume of gas (red circles) from a representative P21 mouse lung in situ. B. The deflation P-V curves of 5 P21 mouse pups; each symbol represents data derived from a different mouse pup. The P-V relationships for deflation pressures ≤ 10 cmH 2 O were modeled using linear regression (green line), the slope yielding the compliance (C 0-10 , ml/cmH 2 O); shown are the estimate ± the standard error. The R 2 , P-value, and residual standard error (RSE) are shown. The box plots represent the residual volume (RV) and total lung capacity (TLC 35 ) of the 5 mouse pups, as indicated.  Table S1: Common lung mechanics parameters extracted from V-P data. Total lung capacity  (TLC or TLCx, where  x is the pressure  chosen to define  TLC) The lung volume associated with its maximum inflation. Data suggest that adult mouse lung does not exhibit a plateau that is indicative of maximum inflation during the inspiratory portion of the V-P curve [1]. Moreover, the airway pressure that corresponds with maximum lung volume appears to vary with the strain of the mouse [2]. Residual volume (RV)

Parameter Definition
The residual air trapped in the distal lung structures at maximum expiration. During V-P studies, this represents the volume of gas residing in the lung at the end of the first deflation curve [3]. Indexed lung volume (%Vx, where x is the lung volume) The % lung volume at x cmH2O pressure. Johnson and coworkers determined that %V15 correlates with the minimum surface tension in adult dogs [4]. Later studies indicated that %V10 correlates with an improvement in alveolar stability in adult mice [5] and premature monkeys [6]. Although %V10 varies considerably among animal species in comparison with %V20, it does not appear to correlate with alveolar sizes (mean linear intercepts) [7]. %V10 has been determined to be influenced by lung injury in adult mouse models [3]. E, Eresp, and C, Cresp. These can also be indexed according to the pressure range used to determine the value.
Elastance and compliance of the respiratory system. The elastance is derived from the change in airway pressure that results from a change in lung volume. Compliance in the inverse of elastance. These values are derived from the slope of a linear model of a relatively flat portion of the deflation limb of the V-P curve, as the lung approaches the RV. When these metrics are generated using V-P data obtained during discontinuous deflation of the lung, they are referred to as static or quasi-static elastance and compliance. These parameters reflect, in part, the intrinsic elasticity of the entire respiratory system if it is measured in situ with an open thorax or ex vivo with isolated lungs. Accordingly, they are altered in lungs with parenchymal disease [3]. Historically, compliance is reported although elastance more accurately reflects the relationship between the independent (volume) and dependent (pressure) variables obtained during most lung mechanics studies. Eaw Caw This represents the elastance and compliance of the conducting airways. If performed using degassed lungs, it is thought that the first inflation arm of the V-P curve contains a portion where pressures generated by the lung distension reflect the distention of the conducting airways before the collapsed distal airways are recruited (Pop, [8]).

Hysteresis area
Area of the V-P curve bordered by the inflation and deflation limbs [2,9]. • Used to obtain data that is employed by LungElast to compensate for pressure-dependent compression of the gas volume during a V-P experiment. After the LungElast system is built and the stopcock that would connect to the animal airway is closed, this script prompts the user to perform an experiment that allows the determination of how the change in system pressure changes the delivered volume. After the user determines the pressure-dependent volume compression, they enter the value into the system defaults using the Customizer script. The LungElast script then uses this factor to compensate for the pressuredependent volume compression during a V-P experiment. This volume compression factor only needs to be redetermined when the syringe and conducting tubing of the system is changed. Customizer.mpy • Initially, prompts the user to adopt or customize LungElast control and V-P experiment options that are in defaults.py. The customizations are then stored in the customizations.json file. • Subsequently, allows the user to edit the previous customizations saved in the customizations.json file or revert them to the ones in the default.py file. • Gives the user the option to export the customizations in the json file to a file that is stamped with the date and experiment number and can be downloaded from LungElast. Required files used to set up the microprocessor boot.py • Turns off operating function debugging.
• Starts WebREPL, but note that WebREPL needs to be setup with its own password using the WebREPL_setup.py script that is encoded within MicroPython. main.py • Sets up device as Wi-Fi access point (AP) with ID 'LungElast' • Uses secrets.py to set AP password • Instantiates HUZZAH32-ESP32 Feather Board red LED, pressure sensor board, and time of flight (ToF) sensor control GPIO pins • Sets pins to low value so that they don't float. Required files containing data that are used by other scripts defaults.mpy • This file contains default parameters that drive LungElast and their definitions • It also has flags that control: compression compensation output of instructions provision of parameter definitions. config.py • Contains GPIO and analog pin mappings for HUZZAH32-ESP32 Feather Board. They can be changed if another ESP32 breakout board is used. secrets.py • If the Wi-Fi is used, this file is used to contain the AP password that is employed by main.py to set up this feature.

Required libraries that permit control of the ToF sensor and stepper motor and simple data analysis
Vl6180_LE_200.py • Module originated by Radomir Dopieralski that was modified to permit the control and retrieval of ToF measurement data from the Vl6180 device via an i2c connection. stepper.py • Module by Tony DiCola / Adafruit that controls the stepper motor movement using the PCA9685 DC Motor and Stepper Driver Board controls via an i2c connection. pca9685.py • Module by Tony DiCola / Adafruit that is imported by stepper.py to and controls the PWM output from pca9685 chip using i2c and the attached stepper motor. stats_LE.py • Custom module that performs simple statistical analysis of data obtained from the pressure and ToF sensors. Files that will be generated by the above scripts Customizations.json • This file is generated by the Customizer script. It contains the user customizations that are used by the software to drive the device and obtain V-P data. The customizations are detailed in Table S3. This file is in json format and not meant to be directly modified or downloaded by the user. V-P data files • The LungElast script generates these files. The file name is formatted as follows: <experiment/subject number>_<date>.csv. The file contains the V-P data in columns with the following headers: subject, date, (V-P) cycle, stepCycles, stepNo, relstepVol, prescompVol, tofDist, and press. The user can download this data file via a hardwired or Wi-Fi link. Customizer data files • The Customizer script generates these files. The file name is formatted as follows: customizations_<date>_<experiment number>.txt The file contains the user-defined parameters that are defined using the Customizer script and that are used to drive LungElast and obtain the V-P data. The user can download the parameters via a hardwired or Wi-Fi link. Table S3: LungElast control parameters. These variables can be defined by the user to control how LungElast obtains V-P data. They are initially supplied in the defaults.py file. But according to their particular device setup and experiment design, the experimentalist can accept or modify each them using the Customizer script. After the parameters are reviewed, they are stored in customizations.json for use by other scripts. By default, a definition of each parameter is provided to the user by the Customizer script at the time that they are reviewed.

Parameter -Definition
Stepper motor movement fstepNo. The number of steps made by the motor between pressure and ToF distance measurements driving the syringe plunger forward and injecting the gas into the lung.
ascstepNo. The number of steps made by the motor near the peak pressure. Adjustment of this variable increases the resolution of the pressure determinations near the peak volume delivery into the lung and the determination of the volume that generates the desired maximum lung airway pressure.
descstepNo. The number of steps made by the motor during the later phase of the deflation limb of the V-P determination. Adjustment of this variable increases the resolution of the pressure determinations near the final withdrawal of gas from the lung. This variable can be adjusted to enhance the modeling of the deflation V-P curve and the determination of the elastance of the lung.
rstepNo. The number of reverse steps made by the motor between pressure and ToF distance measurements.
hstepNo. The number of steps made to the home position between distance measurements.

V-P curve sampling
peakPresSamp. This is the percentage of the upper portion of the inflation curve during which smaller numbers of stepper motor steps are made so higher resolution V-P measurements are made. For example, a value of 10 means that higher resolution V-P measurements will be made within 10% of the maximum pressure defined by the user.
endDeflatSamp. This is the percentage of the lower portion of the deflation curve during which smaller numbers of stepper motor steps are made so higher resolution V-P measurements are made. For example, a value of 30 means that higher resolution V-P measurements will be made during the lower 30% of the deflation curve as defined by (maximum pressure -minimum pressure).

Motor timing
presequalPause. This is the amount of time (in seconds) after the motor makes a train of steps and before the pressure reading is made. It allows the pressures to stabilize in the system.
stepPause. This is a pause (in milliseconds) added after each step to compensate for the inertia of the lead screw nut.

Lead nut target distances
homeLoc. This is the distance (mm) of the lead nut screw target from the ToF sensor. It is related to distance at which the tip of the syringe plunger aligns with the maximum volume mark on its barrel.
minLoc. This is the distance (mm) of the lead nut screw target at the point where the nut is closest to the ToF sensor.
maxLoc. This is the distance (mm) of the lead nut screw target when the syringe plunger has been advanced to the point where it nearly fills the syringe barrel.
Pressure range maxPres. This is the maximum pressure (cmH2O) target.
minPres. This is the minimum pressure (cmH2O) target.

Pressure calibration
zero. This is the pressure sensor digital output during the atmospheric pressure calibration.
slope. This value is determined during the pressure sensor calibration. The slope is used to convert the raw digital pressure sensor output to a calibrated pressure in cmH2O.

Volume calibration
volCal. This is the volume of gas that is associated with 1 mm of syringe plunger movement. It is determined during syringe volume calibration. A NEMA 11 stepper motor with Tr5x2 produces 0.01 mm/step. Thus, 100 steps by the motor causes 1 mm of syringe plunger movement and delivers this volume of gas in µl. During the volume calibration of the syringe, water can be used instead of gas and the volume of water delivered by stepper motor-induced syringe plunger movement can be determined gravimetrically.

Compression calibration
slopeCor. This is proportional to the volume (µl) of gas compressed per cmH2O gas pressure in the conducting system of the circuit. This parameter can be determined experimentally using CompCal.mpy.
V-P cycles distpresCycles. This is the number of V-P loop cycles that are desired by the investigator.
Special system testing mode maxTestPres. This is the maximum pressure target that will be achieved by LungElast during the testing of the device.
testCycles. This is the number of V-P cycles that will be executed during the testing of LungElast.

Elastomeric model lung construction
Jesse Roberts Jr. Aug 2, 2022 Introduction: • An elastomeric model lung is useful for testing LungElast and for educational purposes.
• Below I describe how to construct two elastomeric model lungs, one that is stiff and relatively inelastic and another that is soft and relatively elastic. • The elastomeric model lung consists of two parts: the elastomeric lung part made of latex and an adapter portion. • The adapter portion is formed from two parts that are made using fused deposition modeling (FDM) 3D printing and polyactic acid (PLA; see Fig. on right). o The Luer end is the part of the adapter that connects to a male Luer connector on the LungElast device. o The bulb end is the part over which the elastomeric lung is stretched. o After these two parts of the adapter are printed, they are fused together, impregnated with epoxy, adhered to the elastomeric lung, and then attached to the LungElast device.

Materials:
• 1. Print and fuse the adapter parts a. Use the stl files to make 3D prints of the Luer and Bulb ends using PLA. b. Clean the orifices using a think wooden applicator. c. Use a syringe with a male Luer end and key the thread of the Luer end of the print i. Be careful not to cross-thread the connector d. In a chemical hood, apply acetone to the mating surfaces of the adapters. i e. Gently press the mating surfaces of the 3D prints together, with a slight twist so that the acetone-softened surfaces adhere well together. The mated parts should be assembled as shown in the Fig. below. f. Sight down the long axis of the prints to confirm that the center bore of the joined adapter pieces is aligned. g. Allow the two pieces to fuse. ii 2. Seal the adapter a. In a chemical hood, mix the two part penetrating epoxy together in a small bowl according to the manufacture's instructions. b. Paint the surface of the Luer connector and allow the epoxy to be adsorbed into the material. Be sure to avoid getting epoxy on the Luer connector threads. c. After about 30 min, wipe off the epoxy that was not adsorbed. d. When the epoxy that is leftover in the mixing bowl hardens, then the Luer connector is ready for the next step. This might take overnight. 3. Apply the elastomeric lung over the bulb end of the adapter a. In a well-ventilated area, spray the bulb end of the adapter with adhesive. b. After the adhesive is tacky, roll the elastomeric lung over the bulb. c. Remove any adhesive that has squeezed out. d. Let the adhesive cure. 4. Use a sealer to join the female Luer of the connector to the male Luer of the 4-way stopcock a. Connect the male Luer part of a syringe to a female Luer port of a 4-way stopcock. b. Using the wooden applicator, smear the bead sealer on the inside of the female Luer of the elastomeric lung adapter. c. Insert the male Luer of the stopcock into the female Luer of the elastomeric lung connector and gently twist the male lock to help smear the sealer on the mating surfaces of the Luer connections. d. Exercise the syringe-gently moving some air into and out of the Luer connector-to make sure that the sealer has not occluded the bore of the connector and stopcock. e. The completed assembly should look like the one shown in the Fig. below. f. Note: do not remove the 4-way stopcock from the elastomeric lung assembly as this will break the seal and likely cause air leakage 5. Test the elastomeric lung a. Attach the elastomeric lung assembly -4-way stopcock to LungElast b. Perform a the leak test as directed by the LungElast script i I did not find that methyl acrylate formed a gas-tight connection between the two parts. ii Note that the PLA might change color where the acetone came into contact with it. This does not affect the function of the connector. General considerations: • The Amphenol pressure sensor is only available in a 6-SMD, gull wing package. To facilitate its integration into a pressure sensor breakout board, below are instructions on how to make a carrier board for the sensor and how to install it in a standard perfboard using through-hole techniques. • The pressure sensor board incorporates a LED in the power pathway so that the LungElast user can confirm the pressure sensor's energization by the sensor control board.
Make pressure sensor carrier board -1. Lay the pressure sensor on copper strip board with 0.1 inch (2.54 mm) hole spacing and trace out an area that encloses one row of holes above and one row of holes that are below its feet, as shown in Fig. 1, below. 2. Remove the sensor, and then mark the traces between the holes in the middle, as illustrated (Fig. 2). 3. Use a rotary tool with a cut off wheel and carefully cut through the copper traces as shown in Fig. 3. Be careful not to cut too much into the board substrate, as this will weaken the carrier board. 4. Using the rotary tool and carefully cut the outlines of the carrier board as shown in Fig. 4. Make the cut in several passes so that the board is not overheated it its remaining copper traces lift. 5. Remove the carrier board from the remainder of the board (Fig. 5). Use the sides of the cut off wheel, an emery board, or fine-grit sandpaper to smooth board's edges. Clean the copper strips using isopropyl alcohol, and then lightly sand it until the copper is bright. 6. Make two 1x3 headers using the breakaway male headers. Install their long legs into a breadboard and then place the carrier board on top of it, orienting the board so that the cooper strips are facing upward. 7. Apply a small amount of liquid flux to the cooper strips, the headers that are protruding through them, and the feet of the pressure sensor. 8. Apply solder to the copper strips and headers, as shown in Fig. 6, and then let it cool. Use a multimeter to confirm that there is electrical continuity between the solder-covered copper strips and the headers. Also, using the meter, make sure that there is no bridging of solder between the strips. If there is bridging, use a solder wick or sucker to remove some of the solder. However, make sure that some solder remains on the copper strips. 9. Carefully align the sensor so that its feet lie directly over the copper strips. Briefly touch the feet of the sensor with the solder iron tip so that the solder reflows and joins the feet to the copper strips, as shown in Fig. 7. Be careful not to heat the sensor feet for too long; this will melt the sensor housing and destroy it. 10. After the solder has cooled, remove the sensor carrier board from the breadboard and use a continuity meter to confirm that the header pins are electrically connected to the sensor feet and that there is no bridging. If bridging is detected, return the sensor carrier board to the breadboard, use a wick to remove the excess solder, and reapply it if needed. 11. Clean the liquid flux from the board as directed by the manufacturer's instructions. 12. The resulting pressure sensor carrier board is shown in Figs. 8 and 9.
Make pressure sensor breakout board -1. Solder the sensor carrier board, LED, resistor, and header to a perfboard as directed by the schematics. 2. Check the connections for electrical continuity using a multimeter. 3. The top of the board should look like what is shown in Fig. 10. Note that I painted the positive pins of the pressure sensor carrier board and the breakout board red to aid in their construction and use.        The surface-mount feet of the Amphenol DLC-L20G-U2 pressure sensor are soldered onto a custom adapter board with two sets of 1x3 connectors. This adapter board is then soldered directly onto the pressure sensor breakout board or joined to 1x3 female connectors that are soldered on the board. The later configuration allows flexibility in changing the sensor if desired. • The J4 1x4 male connector is shown on top side of board, but it could be soldered to bottom side, if more convenient. LungElast cables. Female 2.54mm pitch connectors with ~20cm of 28AWG wire. An easy way to make the custom ribbon cables is to buy premade ones that are of the desired length and terminate in 1x1 housings, remove the extra wires until 4 wire-width cables result, un-plug the 1x1 housings, and then replug the terminals into the 1x6. 1x5, and 1x4 housings as shown above.