When I was lying in hospital and suffered from a rather spontaneous case of pneumothorax, the only thing that crossed my mind was how conditions like these could be diagnosed better. The whole treatment cost my insurance a whopping $208,000! More about that in another article
Diagnosis in some way or another starts at home. Prospective patients generally use internet (webMd) to shortlist the exact diagnosis for their symptoms.
It’s Important because…..
The availability of good health care and insurance is a luxury for most of the developing countries. Most conditions are diagnosed only after they have progressed to stages where little could be done reverse the health of a grieving patient.
And! There are some solutions too!
There is enough evidence to highlight the use of diagnostic equipment (aided by Internet of Things) connected to smartphones for affordable ad near accurate diagnostics. This article delves into the one of the ways to diagnose most common lung and respiratory conditions such as chronic obstructive pulmonary disease (COPD) and Emphysema.
So let’s begin: Smart phone based Low Cost Spirometer: This article describes several instances where alow cost spirometer prototype has been created and tested.
What is a Spirometer?
According to Wikipedia, A spirometer is an apparatus for measuring the volume of air inspired and expired by the lungs. A spirometer measures ventilation, the movement of air into and out of the lungs. The spirogram will identify two different types of abnormal ventilation patterns, obstructive and restrictive. There are various types of spirometers which use a number of different methods for measurement (pressure transducers, ultrasonic, water gauge).
The most common spirometer is the Incentive spirometer which is what is provided to increase the lung volume once you are discharged for a hospital. here’s mine on the right
Spirometer Operation: (A bit of Physics – Venturi meter Principle)
The venturi meter consists of two conical pipes connected as shown in the figure. The minimum cross section diameter is called throat. The angles of the conical pipes are established to limit the energy losses due to flow separation. The flow obstruction produced by the venturi meter produces a local loss that is proportional to the flow discharge. Pressure taps are located upstream and downstream of the venturi meter, immediately outside the variable diameter areas, to measure the losses produced through the meter.
Flow rate measurements are obtained using Bernoulli equation and the continuity equation. An experimental coefficient is used to account for the losses occurring in the meter (Va and Vb are the upstream and downstream velocities and is the density. (Aa and Ab are the cross sectional areas).
Spirometer as Venturimeter: (Maya Varma’s research paper)
A spirometer measures the air flow rate in liters/second by making the expelled air pass through a constriction, which results in a change in its pressure, as illustrated in Figure 1. If the flow through the constriction is laminar, the flow rate is proportional to the difference in pressure on each side of the constriction. Thus, by measuring the differential pressure on both sides of the constriction, it is possible to measure the flow rate. The flow volume (amount of air expelled) over any interval can be determined by integrating the flow rate over the interval.
There are two common designs for a spirometer. In the Lilly spirometer, the resistance to the flow comes from a fine wire mesh inserted in the path of the air flow. This reduces the effective area for the flow, thus causing a change in pressure. In the Fleisch spirometer, the constriction is created by a network of capillary tubes. Varma chose the Lilly design for spirometer as it was more suitable for 3D printing, and is also easier to clean and sanitize.
Common Spirometry terms and metric ranges for COPD
The system consists of three parts: (i) the spirometer body, (ii) the pressure sensor and electronics, and (iii) the visualization device. The spirometer body contains no electronic components and is connected to the pressure sensor through aquarium tubing, which can easily be removed for cleaning. The pressure sensor and electronics are housed in a separate enclosure, which includes a microcontroller and Bluetooth transmitter. The visualization device can be any smartphone, tablet or PC equipped with a Bluetooth 4.0 receiver.
The Spirometer Body
i. Spirometer Housing
The spirometer body was designed using Autodesk Inventor and printed in a MakerBot Replicator-2 3D printer. The wire mesh was implemented with stainless steel woven wire cloth from Belleville Wire Cloth Company. The spirometer has two pressure sensor ports, one on each side of the wire mesh, which were attached to the pressure sensor using aquarium tubing.
ii.The pressure sensor and electronics
3. System Design
My system consists of three parts: (i) the spirometer body, (ii) the pressure sensor and electronics, and (iii) the visualization device. The spirometer body contains no electronic components and is connected to the pressure sensor through aquarium tubing, which can easily be removed for cleaning. The pressure sensor and electronics are housed in a separate enclosure, which includes a microcontroller and Bluetooth transmitter. The visualization device can be any smartphone, tablet or PC equipped with a Bluetooth 4.0 receiver.
ii Pressure Sensor and Electronics
When the patient blows into the spirometer, the resulting pressure difference is measured by a pressure sensor. Varma evaluated several pressure sensors for this application.
Varma chose the Freescale MPX5010DP because of its low cost, fast response time, and ease of interfacing.
Range: The sensor should have adequate range to measure the pressure. Although the human lung can exert a pressure as high as up to 1000 mm of H2O, the sensor is not measuring the absolute pressure, but the pressure difference between the two sides of the screen in the spirometer, which does not exceed a few mm of H2O. This is a function of how much resistance is offered by the screen to the air flow. In Varma’s design, the maximum observed pressure difference was around 12 mm of H2O. All the sensors have the range needed for the application.
Sensitivity: Sensitivity defines how much the output voltage of the sensor will vary when the input pressure changes by 1 mm of H2O. The MPX5010 sensor has approximately 10 times the sensitivity of the Honeywell, making the former a more attractive choice. However, the lower sensitivity of the Honeywell sensor can be compensated by a higher-gain amplifier. The Omron sensor has a built-in ADC with 12 bits of resolution, so its sensitivity is calculated by dividing its pressure range by 4096.
Output and Interface: All the sensors can be operated from a 5V supply. The Omron sensor provides a digital I2C interface, thus eliminating the need for analog-to-digital conversion.
Response Time: The response time is important because the sensor must support a sampling rate of 100 samples per second (a sample every 10 ms). Both the MPX5010 and the Honewell sensor are fast enough to support this rate (even counting the conversion time of the external ADC). The Omron sensor has a response time of 50 ms, so its sampling rate is limited to 20 samples per second.
Power: All the sensors have low power consumption, but the Honeywell sensor has the lowest power of 10 mW at 5 Volts, almost one-fifth of the power of the other two. This is important to achieve a long battery life.
Accuracy and Price: The MPX5010 has the lowest price, but is also the least accurate. The Honeywell sensor has the highest accuracy, but costs almost 10 times the MPX5010.
When the patient blows into the spirometer, the resulting pressure difference is measured by the MPX5010 pressure sensor. The pressure sensor has two ducted ports labeled P1 and P2. Varma used aquarium tubing to connect these ports to the spirometer body. The tube at P1 is connected to the left side of the constriction, and the tube at P2 is connected to the right side. The MPX5010 sensor measures the difference in pressure between P1 and P2. Its output is an analog voltage proportional to the difference in pressure, with a range between 0 and 5 Volts.
The first step in processing the pressure sensor output is to convert the analog output to a digital value so that it can be processed by the microcontroller and transmitted. This conversion can be achieved by an Analog-to-Digital Converter (ADC). Varma used an Arduino Pro Mini Microcontroller board to sense the voltage from the pressure sensor and send the data to the wireless transmitter. Arduino microcontroller chips have internal built-in ADC blocks, so that they can directly accept the analog output of the pressure sensor and convert it to a digital value internally. However, the internal ADCs of different Arduino boards have varying capabilities. One of the problems I faced in converting the pressure difference to a digital value was that the measurement values were very small compared to the range of the sensor output. The output of the MPX5010 changed only by less than 50 mV in response to blowing into the spirometer. This is less than 1% of the full range of 5V.
The ADCs in the Ardunio Pro Mini microcontroller have a resolution of 10 bits, meaning that 50mV would correspond to a digital output of about 10. This is too small a resolution to perform calculations. To solve the problem with the low-resolution ADCs, Varma used an external high-resolution ADC, the ADS1115 device from Texas Instruments (A breakout board for this chip is available from Adafruit). This ADC has a 16-bit resolution, and its reference voltage can be programmed as low as ±0.256V. Varma programmed the reference voltage as ±2.048V. This means that an input variation of 50mV translates into a range of which provides adequate resolution for measuring the pressure values.
Wireless Transmitter connected to Arduino Microcontroller
The second part of my electronics is the wireless transmitter connected to the Arduino microcontroller. Varma was faced with three options for implementing the wireless link through which the pressure data can be sent to a smartphone or tablet.
- WiFi: Although WiFi is widely supported in most smartphones and tablets, it has two disadvantages: (i) It requires an Access Point (Hot Spot) to communicate with the smartphone or tablet, and (ii) it has relatively high power requirements.
- Bluetooth Classic: This is the Bluetooth version used in most smartphones and tablets. It has the advantage that it is widely supported, but requires a pairing step to connect the spirometer to the display device. In addition, although its power requirements are lower than WiFi, they are still much higher than Bluetooth 4.0 devices.
- Bluetooth 4.0 (also known as Bluetooth Low Energy (BLE) and Bluetooth Smart): This is a newer version of Bluetooth that has much lower power requirements compared to Bluetooth Classic. It is also simpler to use (does not require the “paring” step to connect). The only disadvantage is that it is a new specification and is therefore available only in the latest models of smartphones and tablets.
Varma selected the Bluetooth Low Energy (BLE) standard for my wireless link because of its very low power requirements (which means that I could use a small battery and still provide an entire day of use for the spirometer with a single charge). I used the nRF8001 Bluetooth Low Energy Connectivity IC from Nordic Semiconductor, mounted on an Adafruit breakout board, to implement the wireless link. Adafruit provides a software library for Arduino, but unfortunately does not have a reference application for Android, so I had to develop the Android Application from scratch.
Android-based Visualization Tool
The third component of the system is the visualization device. The pressure data transmitted on the Bluetooth link can be received by any device (smartphone, tablet, PC, etc.) equipped with a Bluetooth 4.0 receiver. I used a Google Nexus 7” tablet to display the data. Varma developed an Android application to receive the data, graph it, and compute performance metrics from it. Screenshots from my application are shown below:
Computing Expected Values of Lung Performance
Spirometers are traditionally calibrated using a 3-liter calibration syringe. Varma calibrated my system using a two-step process. In the first step, Varma determined the initial values for the conductance distribution (conductance is the ratio of the flow rate to the measured sensor output) using a programmable flow generator and comparing to a Vernier calibrated flow head. Varma built a programmable air flow generator with cheap blowers, 3D-printed tubes and an Arduino microcontroller for this purpose (Figure 8). In the second step, Varma used an algorithm based on Yeh, et al.’s paper  to successively refine the conductance values. Varma used a total of 100 strokes of the syringe, which has been shown to reduce the error within ±0.5%.
Varma performed accuracy tests on my system using the ALS 5000 Breathing Simulator manufactured by IngMar Medical. This breathing simulator is capable of simulating breathing patterns by individuals with varied pulmonary illnesses. Varma placed my spirometer in the device and controlled the breathing patterns through a software application. Varma also compared my results to the data from a Vitalograph commercial spirometer to ensure that her results were accurate. The results showed that my system could accurately diagnose various pulmonary illnesses.
All other system results are provided in Varma’s Research Paper
Varma has successfully developed a prototype of the pulmonary function analyzer using a 3D-printed shell and an Arduino microcontroller. After experimenting with various designs based on Fleisch and Lilly spirometers, Varma settled on a simple Lilly design with a stainless steel mesh that is easy to clean and sanitize. Varma has verified that her device is able to achieve laminar flow through the resistive mesh. The results show that her hypothesis of being able to match the functionality of a commercial spirometer with a cheap smartphone-based device is valid. The estimated costs of the components for a commercial version of the pulmonary function analyzer are shown below. The total cost is within $35.
- This article discusses Varma, Maya’s research paper: https://docs.google.com/document/d/1xQh1gWQIlUdOfhWZLxXMtdzqx-xpbh3kh3SJfzm8w4g/edit#
- Instructables. com for ideas https://www.instructables.com/id/Venturi-Tube-Spirometer/