Electronics and Control
We have implemented two modes of operation. The first mode is volume-controlled (VC) ventilation mode and should only be used on patients who are chemically paralyzed. Tidal volume is set mechanically (see Mechanical), and the device is configured to deliver steady, repeatable breaths at BPM and I/E settings as determined by the physician. The second mode is BiPAP/Breath-Assist mode. In this mode, the device is configured to assist patients who are having trouble breathing on their own. The two modes are described in detail below.Ventilation Control Scheme
The first and primary function of our device is as a positive-pressure mechanical ventilator to facilitate respiration in patients who are unable to breathe on their own. This entails being able to deliver steady, repeatable breaths for long periods of time, with breath rates ranging from 5-55 BPM, and inspiration/expiration ratios ranging from 1:1 and 1:4 (as determined by our clinical collaborators). Breathing Cycle, Timing, and Open-Loop Control: Windshield wiper motors run in open loop. While optical encoders could be used to close the position loop, these would add cost and complexity to the system. To rectify this, we have implemented a pseudo-closed-loop paradigm, wherein we sense the position of the motor at the two most important points in the respiratory cycle (full inspiration and full expiration). Once we know these positions, we assume that the motor speed is constant between these two positions for a fixed voltage (which is a good assumption so long as the motor has sufficient torque to reject disturbances presented by the Ambu® bag’s compression sequence and the back pressure generated from the lung inflation process). Therefore, if we know exactly when the motor was at full inspiration/expiration, and we assume a constant speed in between, we have a good idea of the motor’s position within the breathing cycle at any time. Further, this scheme allows us to sense absolute position at these locations, meaning we do not need to worry about position drift over time due to missed encoder counts. To realize this motion control scheme, we have two limit switches at the extremes of travel which are mechanically triggered when the ventilator is at full inspiration and full expiration. In a single breathing cycle, the motor is driven at a constant speed (inspiration speed) to compress the Ambu® bag until the inspiration limit switch is tripped (the inspiration cycle). Once this switch is triggered, the actuator is driven backwards at a different speed (expiration speed) to relieve pressure in the Ambu® bag until the expiration limit switch is tripped (the expiration cycle). The ratio of inspiration to expiration speed comprises the I/E ratio. The sum of the inspiration and expiration cycle times equate to a full breathing cycle. The actual inspiration and expiration cycles are recorded, and the motor speed is adjusted if need be. The physician may adjust both the breathing rate and the I/E ratio independently via two potentiometers, as described in the following section. The consistency of our open-loop control paradigm is demonstrated in the following figure, which shows the commanded vs. actual BPM and IE recorded during our 4-hour live swine experiment.
BiPAP Control Scheme
Through consultation with our clinical collaborators at VUMC, it became clear that implementing BiPAP (Bilevel Positive Airway Pressure) capabilities could potentially open up our device for use with less at-risk patients who simply need breathing assistance, thereby freeing up clinically-approved ventilators for those who are most at risk. This would also alleviate the requirement for patient to be chemically paralyzed. In BiPAP mode, our device simply monitors the pressure sensor, and as soon as the pressure reading goes negative (indicating an attempt by the patient to inspirate), the device triggers an inspiration assist maneuver to compress the Ambu® bag and deliver air to the patient. The tidal volume of air delivered is set by the physician. However, the system also monitors inspiratory pressure, and if this pressure exceeds a barotraumatic limit (40 cm H20), the direction of travel is immediately reversed and the cycle enters the expiratory state while sounding an alarm.Electronics Fabrication
The wiring diagram for the control electronics is shown below. The system is powered by a 12VDC, 3A wall transformer, coupled to the Arduino’s input barrel jack through a power switch. The Arduino Uno MCU (or equivalent) is responsible for executing the controller, processing sensor/user interface data, and issuing motor commands. Various user interface features (potentiometers, buttons, switches, and an LCD screen) allow the physician to interact with the ventilator and monitor the patient. The LCD screen displays the current BPM and I/E settings, and provides a real-time reading of the output pressure as measured by A MEMS pressure sensor (assuming Option 1 from Pressure Sensing is used). An alarm is sounded (via a piezoelectric buzzer) if the pressure rises above or falls below pre-defined pressure limits. To actuate the motor, the MCU sends PWM signals to a high-power motor driver circuit (based on the BTS7960B half-bridge driver) which sources the voltage (12V) and the current (>2A) that the motor requires. All logic inputs (switches and pushbuttons) short their respective digital pins to ground when pressed, relying on the Arduino’s built-in pull-up resistors which are activated in software, to minimize the overall number of external components. The LCD screen is updated every 1000 control cycles via I2C protocol.
- Arduino Uno (or equivalent)
- Potentiometers (10k) (x2)
- Limit Switches (x2)
- Momentary Pushbutton (Off-Mom)
- Power Switch (rocker variety)
- Enable switch (rocker variety)
- Motor Driver (BTS7960B)
- LCD Display for Feedback (with i2c backpack)
- Piezoelectric Buzzer (5-12V)
- DC Barrel Jack with Screw Terminal (Male)
- DC Barrel Jack with Screw Terminal (Female)
- 12V, 5A Power Supply
- 20-22AWG Speaker Wire
- Various Jumper Wires (24AWG) and Heat-Shrink Tubing
- Solderless Breadboard or CoV Shield (see below)
- Spiral Cable Wrap
- Adhesive-Backed Cable Brackets

- Laser-cut enclosure panels (dxf files downloadable here)
- (4x) No.2, ¼” long brass wood screw (McMaster: 98685A220)
- (4x) No. 4, 1-1/4” long slotted flat head screw (McMaster: 90006A117)
- (4x) Nylon unthreaded spacer, 3/16” OD, 0.115” ID, 1” long (McMaster: 90176A125)
- (4x) M12 panel-mounted cable glands, cable diameter 3mm-6mm
- (14x) 4-40, ½” long machine screws (McMaster: 90272A110)
- (14x) Size 3, ½” long slotted wood screw (McMaster: 92407A096)
- (14x) 4-40 square nut (McMaster: 94855A281)



- POWER switch: this switch provides power to the motor and the on-board computer. This switch functions as the device’s emergency-stop switch.
- Alarm LED: this LED blinks when an alarm state is encountered. It is accompanied by an audible tone.
- ENABLE/MODE switch: Before startup, the state of this switch determines whether or not the device boots up in Ventilation mode or BiPAP/Breath Assist mode. When powered on, this switch toggles between ‘NORMAL’ and ‘DISABLED’ states.
- PP/CLEAR button: This button serves three functions:
- When the device is in PROGRAMMING mode, this button loads the current settings into memory and exits PROGRAMMING mode.
- When an alarm is encountered, this button acknowledges and clears the alarm.
- When in NORMAL ventilation mode, this button can be used to perform an inspiratory hold for plateau pressure measurement.
- PROG button: This button toggles between pressure threshold programming, and respiratory parameter (BPM and I/E) programming.
- BPM/Pmax knob: In Ventilation mode, this knob is used to adjust the BPM or maximum pressure threshold settings. In BiPAP mode, this knob is used to adjust the maximum pressure to trigger an expiratory transition.
- IE/Pmin knob: In Ventilation mode, this knob is used to adjust the I/E ratio or minimum pressure threshold settings. In BiPAP mode, this knob is used to adjust the length of the patient timeout alarm.
- LCD Screen: This screen informs the user of the current status of the device, relevant device and patient parameters, and prints any alarms.
Software
The software is written in the Arduino environment, using a language derivative of C/C++. The Arduino IDE can be downloaded from here. After downloading the IDE, you may upload our code on an Arduino-compatible MCU. We have provided the link to a github repository for the controller code on the Downloads page. Note that the software has only been tested on the Arduino UNO model which implements the Atmega328 MCU, and with the BTS7960B motor driver. We cannot guarantee proper operation on any other MCU/motor driver combination.