Skip to main content

Design and implementation of a simple and inexpensive respiratory synchronization control platform

Abstract

Background

In a number of clinical and research settings, it is desirable to have an individual breathe in a particular fixed pattern (respiratory synchronized breathing). The purpose of this brief technical report is to show how a control system for this purpose can be easily and inexpensively developed using an Arduino UNO microcontroller platform.

Results

We programmed an Arduino UNO microcontroller to develop a respiratory timing system with selectable respiratory rate and inspiratory to expiratory ratio. Test subjects are instructed to breathe in when the light-emitting diode (LED) is illuminated and breathe out when the LED is dark. Both the duration of inspiration and that of expiration can be easily adjusted by the user to meet various requirements. The system was tested and found to function satisfactorily.

Conclusions

An Arduino UNO microcontroller was used to develop a respiratory timing system. This platform is likely to be of value to clinicians and investigators looking for a simple and inexpensive system for respiratory synchronized breathing.

Background

Typically, most adults breathe between 12 and 20 cycles per minute (0.2–0.3 Hz). In some clinical and research settings, it is desirable to have the test subject or patient breathe in a particular fixed pattern (respiratory synchronized breathing, paced breathing). For example, paced breathing has been advocated as a nonpharmacological means of reducing stress and anxiety (Clark and Hirschman 1990; Blumenstein et al. 1995; Laborde et al. 2017), as a behavioral adjunct in the treatment of hypertension (Hateren et al. 2015; Schein et al. 2009; Elliott and Izzo 2006; Cernes and Zimlichman 2017; Brenner et al. 2020; Adler et al. 2019; Viskoper et al. 2003), as a treatment for overactive bladders (Huang et al. 2019) as well as a treatment for menopausal hot flushes (Huang et al. 2015), as a means to improve sleep (Tsai et al. 2015), and as a means to manage food craving (Meule and Kübler 2017). Mechanistically, it has been hypothesized that synchronized breathing techniques producing slow breathing patterns at a frequency near 0.1 Hz (6 breaths per minute) “promotes behavioral relaxation and baroreflex resonance effects that maximize heart rate variability” and serve to “elicit resonant and coherent features in neuro-mechanical interactions that optimize physiological function” (Noble and Hochman 2019).

Another important application of paced breathing is as a research tool to better understand the effect of breathing on heart rhythm patterns (Wilhelm et al. 2004; Sin et al. 2010). Paced breathing studies can be particularly valuable in this instance because respiration changes the heart position due to movement of the diaphragm, affecting obtained cardiac waveforms such as the electrocardiogram, the blood pressure wave and the photoplethysmograph waveform. Additionally, changes in conductivity in thoracic tissues and changes in thoracic blood volume caused by lung inflation will similarly influence cardiac waveforms.

Two approaches have been proposed to deal with this issue. The earliest proposed method to control respiratory-induced variations in cardiac events was to require that the tested individual remains apneic (hold his or her breath) during the data recording interval. Unfortunately, the limitations of this approach are strikingly obvious.

A more practical technique is to have the tested individual breathe in a predetermined pattern under the control of an electronic timing apparatus with a light (e.g., light-emitting diode (LED) indicator (or sound source) signaling when to breathe in and when to breathe out. A typical arrangement here might be to have the test subject breathe at 15 breaths per minute (interbreath interval of 4000 ms) with an inspiratory to expiratory (I:E) ratio of 1:2 (i.e., inspiration for 1333 ms and expiration for 2666 ms). In this setting, the start of inspiration and the start of expiration are recorded electronically along with the cardiac signals of interest, possibly with a view to later segment the recorded cardiac signals into inspiratory and expiratory phases.

For slow breathing relaxation protocols requiring breathing at 6 breaths per minute, one option would be an inspiration phase of 3333 ms with an expiration phase of 6666 ms, maintaining the I:E ratio at 1:2.

In this report, we show how such a platform can be easily and inexpensively developed using an Arduino UNO microcontroller platform.

Methods

The Arduino UNO microcontroller (Fig. 1) served as the centerpiece of this project. It is the best-known Arduino microcontroller as it is both popular and very inexpensiveFootnote 1and has been used many biomedical applications (Veldscholte et al. 2021; Wandling et al. 2021; Holovatyy et al. 2020; Hoang et al. 2021; Zuckerberg et al. 2020; Cobo et al. 2020; Vallejo et al. 2020; Chen and Li 2017; Das et al. 2017).

Fig. 1
figure 1

The Arduino UNO is a popular and inexpensive open-source microcontroller board based on the ATmega328P microcontroller. The board features 14 digital pins and 6 analog input pins (featuring 10-bit ADC resolution). Also, 6 of the 14 digital pins can be configured as pseudo-analog output pins, with the analog outputs being simulated using PWM (pulse width modulation). The Arduino UNO can be powered using a USB cable or externally via a 7–20-V source, such as an ordinary 9-V battery. It also features a clock speed of 16 MHz, support for external interrupts, and a built-in LED driven by digital pin 13. Programming the Arduino UNO (and other family members) is usually done via the Arduino integrated development environment (IDE), available as a free download for the Windows, macOS, and Linux operating systems. Image credit: https://commons.wikimedia.org/wiki/File:Arduino_Uno_-_R3.jpg. Image used under the Creative Commons Attribution 2.0 Generic license

This microcontroller is an open-source product based on the ATmega328P chip containing 14 digital input/output pins and 6 analog input pins (featuring 10-bit analog-to-digital (ADC) resolution). The Arduino UNO can be powered using a USB cable or externally via a 7–20-V source, such as an ordinary 9-V battery. It also features a clock speed of 16 MHz, support for external interrupts, and a built-in light-emitting diode (LED) driven by digital pin 13.

Programming the Arduino UNO (and other family members) is usually done via the Arduino integrated development environment (IDE), and available as a free download for the Windows, macOS, and Linux operating systems at www.arduino.cc. Table 1 provides more technical details concerning the Arduino UNO.

Table 1 Synopsis of pinout and other technical characteristics of the Arduino UNO microcontroller

In this technical report, we offer the reader two project designs to consider (Figs. 2 and 3), one design (Fig. 2) being especially simple and the other far more flexible but also more complex (Fig. 3). The first design requires no hardware other than the Arduino UNO microcontroller itself and the host computer, while the more advanced design uses a 16 character by 2-line LCD display and a 4 × 1 push button array to allow the user to select the desired respiratory rate and I:E ratio.

Fig. 2
figure 2

This program makes an Arduino into a respiratory synchronizer / breathing metronome operating at a rate of 15 breaths per minute with an I:E ratio of 1:2

Fig. 3
figure 3

TOP: Enhancement of the program shown in Fig. 2 recorded to additionally produce two electrical digital status outputs, first a 5-V level on Pin 7 during inspiration (and zero volts during expiration) and also a 5-V level on Pin 8 during expiration (with zero volts during inspiration). BOTTOM: Strip chart recording of Arduino UNO Pins 7 and 8 obtained using the DATAQ DI-1100 data acquisition system. The top graph is a plot against time of the inspiratory control signal, while the bottom graph is for the expiratory control signal. The software package supporting the strip chart system is by DATAQ. Known as WinDaq, it is available for free download to users of their data acquisition systems, with some USB-based data acquisition systems priced well under 100 dollars US (e.g., Model DI-1100)

In either the simple design or the advanced design, the subject is asked to breathe in for a specific time span (known as the inspiratory time) and then to breathe out for another specified time (known as the expiratory time).

In the simple design version, an LED connected to Arduino digital pin 13 is used as the breathe in/breathe out control signal. In this instance, one could also connect a second external LED in parallel if desired or use an external LED connected to another digital output pin. In this program version, the respiratory rate and I:E ratio are “hard wired” into the program code itself; changing these parameters requires changing the program itself (not a difficult task, however) and running the program again.

In the more advanced respiratory metronome design featured in Figs. 4 and 5, a multi-color LED is used. Here, GREEN corresponds to a command to breathe in and RED corresponds to a command to breathe out. In addition, a BLUE light is used to indicate that the system has entered a special “setup” mode where the user can select the desired respiratory rate and I:E ratio using assigned control keys.

Fig. 4
figure 4figure 4

(Three panels). Enhancement of the original program shown in Fig. 2 to provide both a 2-line by 16-character LCD display (for displaying the respiratory rate and I:E ratio) as well as a 4 × 1 array of pushbuttons (K1, K2, K3 and K4). These pushbuttons are used to enter (K1) and exit (K4) setup mode as well as to cycle through available selections for respiratory rate (K3) and I:E ratio (K4) when in setup mode

Fig. 5
figure 5

Photograph of the prototype for the advanced system corresponding to the code in Fig. 4. Note the presence of a 2-line by16-character LCD display (for displaying the respiratory rate and I:E ratio) as well as a 4 × 1 array of pushbuttons (K1, K2, K3 and K4) used to setup (initialize) the operation of the unit. Notice also the illuminated green LED

As shown in Fig. 2, the Arduino computer code for the basic application is not complicated. First, we define the variable “InspiratoryTime” as the inspiratory time in milliseconds and the variable “ExpiratoryTime” as the expiratory time in milliseconds. The program is then a loop whereby an LED is repeatedly illuminated for “InspiratoryTime” milliseconds and then turned off for “ExpiratoryTime” milliseconds, with the test subject simply instructed to breathe in when the LED is illuminated and breathe out when the LED becomes dark again.

In the case of the more advanced program illustrated in Fig. 4, the code has been enhanced to provide a 2-line by 16-character LCD display for displaying the respiratory rate and I:E ratio (see Fig. 5) as well as a 4 × 1 array of pushbuttons (K1, K2, K3 and K4). These pushbuttons are used to enter (K1) and exit (K4) setup mode as well as to cycle through available selections for respiratory rate (K3) and I:E ratio (K4) when in setup mode.

Results

The bottom portion of Fig. 3 provides some sample results acquired using the Dataq DI-1100 multichannel data acquisition system, which was configured to record the inspiration/expiration control signals produced by the Arduino microcontroller. These two signals have a 5 V positive voltage corresponding to LED illumination during commands for inspiration (signal 1) and for expiration (signal 2).

Discussion

Several variations in the basic arrangement described can be envisioned. One variation could be to use two LEDs, one for requesting inspiration and the other for requesting expiration. Another variation would be to add an “inspiratory hold” LED signifying that the test subject should hold his or her breath (neither breathe in or breathe out) following inspiration, and to do so until the expiration LED is illuminated. In this last instance, a third variable (let’s call it “InspiratoryHoldTime”) would need to be introduced. In such a case, one might use an inexpensive three-color “GYR” LED assembly with green signifying “breathe in,” yellow signifying “hold your breath” and red signifying “breathe out.”

The use of two p-Channel JFET transistors (e.g., 2SJ177) operating as switches can be used to divide the obtained acoustic signal into separate inspiratory and expiratory channels, i.e., one analog channel containing only inspiratory sounds and another analog channel containing only expiratory sounds (Fig. 6). In this arrangement, each JFET transistor is configured such that the acoustic signal can pass through from source (S) to drain (D) only when the gate (G) is presented with a zero-voltage control voltage from the microcontroller. In the inspiratory channel, the microcontroller outputs a zero-voltage control signal during the time that the LED is illuminated (and a 5-V control signal otherwise), while in the expiratory channel, the microcontroller outputs a zero-voltage control signal during the time that the LED is turned off (and a 5-V control signal otherwise).

Fig. 6
figure 6

If needed, one can use P-Channel JFET transistors (e.g., 2SJ177) operating as switches to divide the obtained acoustic signal into separate inspiratory and expiratory channels. In this arrangement, each of two P-Channel JFET transistors is configured such that the acoustic signal passing through from source (S) to drain (D) is blocked when the gate (G) is presented with a positive control voltage from the microcontroller. In the inspiratory channel, the microcontroller outputs a 5-V (blocking) control signal during the time that the LED is off (i.e., during expiration), while in case of the expiratory channel, the microcontroller outputs a 5-V (blocking) control signal during the time that the LED is turned on (i.e., during inspiration). Note that, the above circuit must be duplicated, once for the inspiratory channel and once again for the expiratory channel

Note that, it is likely that in any research setting, all respiratory timing variables would remain the same across all test subjects, making it more practical to simply define the relevant timing variables as fixed values at the time of program initialization rather than to ask the operator to enter them via a keypad or by other means each time the program is run.

Finally, in many research settings, the state of all control signals would be recorded in real time on a real or virtual strip chart recorded, along with physiological signals such as the electrocardiogram (ECG), phonocardiogram (PCG) or photoplethysmogram (PPG). Digitally recording both respiratory events and cardiac signals together offers the possibility of further exploring the effect of respiration on cardiovascular events. Example exploratory questions one might ask concern the phase of respiration that provides for (Clark and Hirschman 1990) the loudest first heart sound (Blumenstein et al. 1995), the largest photoplethysmographic signal amplitude or (Laborde et al. 2017) the smallest QRS amplitude in the electrocardiogram.

Conclusions

We describe two versions of an inexpensive and easily constructed platform for synchronized breathing applications. Both designs are based on light-emitting diode (LEDs) under the control of an Arduino UNO microcontroller. In the advanced version, both the respiratory rate and I:E ratio can be easily adjusted by the user, while in the simple version, changing the respiratory rate and I:E ratio parameters requires editing the program.

Availability of data and materials

Not applicable.

Code availability

The software code for this project is available from two sources. The first source is from GitHub using the following URL:

https://github.com/djdoylemd/Respiratory-Synchronizer-Project

The second source is from the following box.com download link:

https://app.box.com/s/eiijmjbdw94426av6vzz6r3p59nvl1ul

Notes

  1. Chinese clones of the Arduino UNO are available on eBay for under $10.00, including world-wide shipping.

Abbreviations

ADC:

Analog-to-digital converter

JFET:

Junction-gate field-effect transistor

LCD:

Liquid crystal display

LED:

Light-emitting diode

MHz:

Megahertz

PWM:

Pulse width modulation

USB:

Universal serial bus

References

  • Adler TE, Coovadia Y, Cirone D, Khemakhem ML, Usselman CW (2019) Device-guided slow breathing reduces blood pressure and sympathetic activity in young normotensive individuals of both sexes. J Appl Physiol 127(4):1042–1049

    Article  CAS  Google Scholar 

  • Blumenstein B, Breslav I, Bar-Eli M, Tenenbaum G, Weinstein Y (1995) Regulation of mental states and biofeedback techniques: effects on breathing pattern. Biofeedback Self Regul 20(2):169–183

    Article  CAS  Google Scholar 

  • Brenner J, LeBlang S, Lizotte-Waniewski M, Schmidt B, Espinosa PS, DeMets DL et al (2020) Mindfulness with paced breathing reduces blood pressure. Med Hypotheses 142:109780

    Article  Google Scholar 

  • Cernes R, Zimlichman R (2017) Role of paced breathing for treatment of hypertension. Curr Hypertens Rep 19(6):45

    Article  Google Scholar 

  • Chen X, Li H (2017) ArControl: an arduino-based comprehensive behavioral platform with real-time performance. Front Behav Neurosci 11:244

    Article  Google Scholar 

  • Clark ME, Hirschman R (1990) Effects of paced respiration on anxiety reduction in a clinical population. Biofeedback Self Regul 15(3):273–284

    Article  CAS  Google Scholar 

  • Cobo A, Villalba-Mora E, Hayn D, Ferre X, Pérez-Rodríguez R, Sánchez-Sánchez A et al (2020) Portable ultrasound-based device for detecting older adults’ sit-to-stand transitions in unsupervised 30-second chair-stand tests. Sensors (basel). 20(7):1975

    Article  ADS  Google Scholar 

  • Das S, Pal S, Mitra M (2017) Arduino-based noise robust online heart-rate detection. J Med Eng Technol 41(3):170–178

    Article  Google Scholar 

  • Elliott WJ, Izzo JL (2006) Device-guided breathing to lower blood pressure: case report and clinical overview. MedGenMed 8(3):23

    PubMed  PubMed Central  Google Scholar 

  • Hoang LQ, Chi HBL, Khanh DNN, Vy NTT, Hanh PX, Vu TN et al (2021) Development of a low-cost colorimeter and its application for determination of environmental pollutants. Spectrochim Acta A Mol Biomol Spectrosc 249:119212

    Article  CAS  Google Scholar 

  • Holovatyy A, Teslyuk V, Kryvinska N, Kazarian A (2020) Development of microcontroller-based system for background radiation monitoring. Sensors (basel) 20(24):7322

    Article  ADS  Google Scholar 

  • Huang AJ, Phillips S, Schembri M, Vittinghoff E, Grady D (2015) Device-guided slow-paced respiration for menopausal hot flushes: a randomized controlled trial. Obstet Gynecol 125(5):1130–1138

    Article  Google Scholar 

  • Huang AJ, Grady D, Mendes WB, Hernandez C, Schembri M, Subak LL (2019) A randomized controlled trial of device guided, slow-paced respiration in women with overactive bladder syndrome. J Urol 202(4):787–794

    Article  Google Scholar 

  • Laborde S, Allen MS, Göhring N, Dosseville F (2017) The effect of slow-paced breathing on stress management in adolescents with intellectual disability. J Intellect Disabil Res 61(6):560–567

    Article  CAS  Google Scholar 

  • Meule A, Kübler A (2017) A pilot study on the effects of slow paced breathing on current food craving. Appl Psychophysiol Biofeedback 42(1):59–68

    Article  Google Scholar 

  • Noble DJ, Hochman S (2019) Hypothesis: pulmonary afferent activity patterns during slow, deep breathing contribute to the neural induction of physiological relaxation. Front Physiol 10:1176

    Article  Google Scholar 

  • Schein MH, Gavish B, Baevsky T, Kaufman M, Levine S, Nessing A et al (2009) Treating hypertension in type II diabetic patients with device-guided breathing: a randomized controlled trial. J Hum Hypertens 23(5):325–331

    Article  CAS  Google Scholar 

  • Sin PYW, Galletly DC, Tzeng YC (2010) Influence of breathing frequency on the pattern of respiratory sinus arrhythmia and blood pressure: old questions revisited. Am J Physiol Heart Circ Physiol 298(5):H1588–H1599

    Article  CAS  Google Scholar 

  • Tsai HJ, Kuo TBJ, Lee G-S, Yang CCH (2015) Efficacy of paced breathing for insomnia: enhances vagal activity and improves sleep quality. Psychophysiology 52(3):388–396

    Article  CAS  Google Scholar 

  • Vallejo W, Diaz-Uribe C, Fajardo C (2020) Do-it-yourself methodology for calorimeter construction based in Arduino data acquisition device for introductory chemical laboratories. Heliyon 6(3):e03591

    Article  Google Scholar 

  • van Hateren KJJ, Landman GWD, Kleefstra N (2015) Re: “RESPeRATE: the role of paced breathing in hypertension treatment.” J Am Soc Hypertens 9(8):656–657

    Article  Google Scholar 

  • Veldscholte LB, Horst RJ, de Beer S (2021) Design, construction, and testing of an accurate low-cost humidistat for laboratory-scale applications. Eur Phys J E Soft Matter 44(4):48

    Article  CAS  Google Scholar 

  • Viskoper R, Shapira I, Priluck R, Mindlin R, Chornia L, Laszt A et al (2003) Nonpharmacologic treatment of resistant hypertensives by device-guided slow breathing exercises. Am J Hypertens 16(6):484–487

    Article  Google Scholar 

  • Wandling GD, Lee JI, Talukder MAH, Govindappa PK, Elfar JC (2021) Novel real-time digital pressure sensor reveals wide variations in current nerve crush injury models. Mil Med 186(Suppl 1):473–478

    Article  Google Scholar 

  • Wilhelm FH, Grossman P, Coyle MA (2004) Improving estimation of cardiac vagal tone during spontaneous breathing using a paced breathing calibration. Biomed Sci Instrum 40:317–324

    PubMed  Google Scholar 

  • Zuckerberg J, Shaik M, Widmeier K, Kilbaugh T, Nelin TD (2020) A lung for all: novel mechanical ventilator for emergency and low-resource settings. Life Sci 257:118113

    Article  CAS  Google Scholar 

Download references

Acknowledgements

Not applicable

Funding

This activity was entirely self-funded.

Author information

Authors and Affiliations

Authors

Contributions

The author contributed to all aspects of this project, including design, implementation, testing and documentation. The author read and approved the final manuscript.

Corresponding author

Correspondence to John Doyle.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interests

The author declares that he has no conflicts of interest, financial or otherwise.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Doyle, J. Design and implementation of a simple and inexpensive respiratory synchronization control platform. Bull Natl Res Cent 46, 258 (2022). https://doi.org/10.1186/s42269-022-00946-2

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s42269-022-00946-2

Keywords