3D Printed Spirometer
Introduction: 3D Printed Spirometer
Spirometers are the classical instrument to perform the parsing of air as it is blown out of your mouth. They consist of a tube that you blow into that records the volume and speed of one breath which are then compared to a set of normal values based on height, wt and sex and are used to follow lung function. The instrument I designed, although tested for accuracy with a flowmeter is not in any way a certified medical device, but in a pinch it certainly could pass for one--giving relative reproducible and accurate accounts of the standard FEV1, FEVC and graphs of volume output and speed over time. I designed it so that the electronics with the expensive tethered sensor were confined to one piece and the easily disposable blow tube with associated virus laden channels was in another. This appears to be one of the drawbacks of standard machines used clinically -- replaceable cardboard mouthpieces don't really eliminate all risks when viruses are airborne and you're asked to blow long and hard into a very expensive apparatus. The cost of the device is under $40 and anyone with a 3D printer can turn out as many as they want. The software Wifi tethers it to a Blynk app on your smartphone for visualization and allows you to download any data you want.
Step 1: Buy Stuff
Essentially we are building an analog sensor with a great screen/microcontroller combo. The importance is in choosing the right sensor. Several other designs for these devices have used sensors that lack the sensitivity necessary to provide the data to compute these breathing elements. The ESP32 has well known issues with nonlinearity of its ADC but this doesn't seem to be significant in the range of this unit.
1. TTGO T-Display ESP32 CP2104 WiFi bluetooth Module 1.14 Inch LCD Development Board $8 Bangood
2. SDP816-125PA Pressure Sensor, CMOSens®, 125 Pa, Analogue, Differential $30 Newark, Digikey
3. Lipo Battery -- 600mah $2
4. On/Off Switch -- On-Off Power Button / Pushbutton Toggle Switch Adafruit
Step 2: 3D Print
Fusion 360 was used to design the two nesting elements of the Spirometer. The Venturi tube (blow tube) has a variety of designs. To use the <PERSON> equation for the calculation of flow you must have some reduction in volume of flow in the measuring tube. This principle is used in a variety of flow sensors for all kinds of laminar flow fluids. 152
The dimensions I used in the Venturi tube were from no particular source but they just seemed to work. The sensor uses the differential pressure across the narrow and wide tube areas to calculate flow volume. I wanted the sensor to be able to easily and reversibly engage the Venturi tube for quick change and removal so I designed the pressure sensor tubes to lead out of the model and end at its base where they would engage the tips of the sensor tube heads. There is a high/low polarity to the sensor that has to be maintained from the high/low pressure areas of the Venturi tube. The high pressure is in the straight section and the low pressure is over the curve of the restriction--just like over an airplane wing. The body of the Spirometer is carefully designed to provide screw mounts to hold the sensor in place with M3 (20 mm) screws. These are placed in heat-set M3x4x5mm inserts. The remainder of the design provides for the anchoring of the TTGO in a slot at the bottom and a window for the screen. The button and button cover are both printed twice and allow for threw-case access to the the two buttons on the TTGO board. The cover is the last piece to print and is designed to give access for the power/charging plug to the top of the TTGO board. All pieces are printed in PLA with no supports.
Step 3: Wire It
There is not much to the wiring of the sensor and the ESP32. The sensor has four leads and you should download the data sheet for the sensor just to make sure you have the leads correct: http://www.farnell.com/datasheets/2611777.pdf The power goes to the 3.3 Volt output of the ESP32 and the ground and OCS are both connected to ground. The analog output of the sensor is connected to pin 33 on the ESP. Since these connections snake through a narrow opening in the shell don't connect them prior to the assembly of the unit. The Lipo battery fits posterior in the case so get one that is appropriately sized for the mAh. The TTGO has a charging circuit with a tiny JST connector on the back. Connect the battery to this with the on/off switch breaking the pos line.
Step 4: Assembly
Post 3D printing modification is done to the blow tube. 832