About

This tool provides a simple way to measure a patient’s respiratory rate (RR) using either a keyboard or a touch device. It was developed as a personal project to support quick RR assessment in triage situations in the Emergency Department and is released as open-source software. Please note that this tool is not a medical device. Its results should not be used as the sole basis for clinical decisions.

Usage

On a Computer with Keyboard, press the SPACEBAR with the first breath to start measuring. Each subsequent press counts as another breath. Press ESC to reset the measurement.

On Touch-Devices, tap the Start button with the first breath to start measuring. Each subsequent tap counts as another breath. It resets automaticly if you start a new measurement.

Algorithm

The respiratory rate is determined by measuring the time intervals between consecutive breath inputs. To minimize the effect of irregular breathing or imperfect tapping, the algorithm calculates the breaths per minute (BPM) using the median of the last four intervals, which is more robust than a simple average. To ensure the measurement is reliable, the BPM is only displayed once four intervals are available and their Maximum Individual Error (ThC), the largest deviation from the median, is below 13%. This sliding-window approach follows the method described by Karlen et al., which has been shown to improve accuracy and reduce the influence of outliers.

Karlen W, Gan H, Chiu M, Dunsmuir D, Zhou G, Dumont GA, Ansermino JM. Improving the accuracy and efficiency of respiratory rate measurements in children using mobile devices. PLoS One. 2014 Jun 11;9(6):e99266. doi: 10.1371/journal.pone.0099266. Erratum in: PLoS One. 2015 Feb 06;10(2):e0118260. doi: 10.1371/journal.pone.0118260. PMID: 24919062; PMCID: PMC4053345. open

Backup: If the respiratory rate cannot be reliably determined within 30 seconds, the measurement stops automatically and calculates the rate based on the total number of breaths over the measured time. The Coefficient of Variation (CV) of all breathing intervals provides a quality indicator: CV below 10% indicates very good quality, 10-20% indicates moderate quality, and above 20% indicates poor quality.

CAVE: The chosen parameters, a set size of 4 intervals and a consistency threshold (ThC) below 13%, were originally evaluated in children. The study data consisted of children aged 0–5 years, who typically breathe much faster than adults. At higher breathing frequencies, the time between breaths becomes shorter, which makes manual tapping more challenging and increases the impact of user-induced timing errors. When applying these child-validated parameters to adults, measurement times may be longer due to their lower respiratory rate. However, since longer intervals between breaths reduce the relative effect of tapping inaccuracies, the method is expected to remain robust at normal adult respiratory rates.

Source Code

The source code is available on GitHub.