How to Make an Accurate Air Flow Rate Sensor With Arduino for Under £20 COVID-19 Ventilator

by Darren Lewis in Circuits > Sensors

31767 Views, 34 Favorites, 0 Comments

How to Make an Accurate Air Flow Rate Sensor With Arduino for Under £20 COVID-19 Ventilator

Capture6.JPG
ac5b5f2d-9da8-4dfd-9f2b-b3b505e5c511 (1).JPG
image0 (5).jpeg
image1 (6).jpeg

Please see this report for most recent design of this orifice flow sensor: https://drive.google.com/file/d/1TB7rhnxQ6q6C1cNb...

This instructables shows how to build an air flow rate sensor using a low cost differential pressure sensor and readily available materials. The design is for an orifice type flow sensor, the orifice (in our case a washer) provides a restriction and we can calculate the flow by measuring the pressure difference across the orifice.

Originally we designed and build this sensor for our project called OpenVent-Bristol which is an open source design of rapid manufacture ventilator for treatment of COVID-19. However this sensor can be used in just about any air flow sensing application.

This initial version of our design is made entirely using off-the-shelf parts, no 3D printing or laser cutting is needed.

The attached drawing shows a cross section drawing of the design. It is very simply 2 lengths of plumbing pipe with a washer superglued in between, measuring differential pressure across the orifice to calculate the flow rate.

Enjoy!! and give us a comment if you make your own.

Buy Parts

These are the parts you will need:

You may wish to buy 1 or 2 plumbing connectors if you want to fit the flow sensor piping onto another 22mm pipe : https://www.screwfix.com/p/hep2o-plastic-push-fit-...

Note: The materials chosen do not meet medical product regulations, particularly the PVC.

Cut Plumbing Tube

IMG_8278.JPG
IMG_8279.JPG

Cut 2 lengths from the plumbing tube. We used 15cm length but it may work just fine a bit shorter. I made the cuts using a mitre saw as it's important to get a nice square cut. Use sand paper to smooth any burs

Assemble Plumbing Tubes

IMG_8288.JPG
IMG_8290.JPG

  • Superglue your washer to the end of one tube, make sure the washer is concentric with the tube and be sure to make a continuous bead of glue all the way around the circumference of the washer to ensure no air pressure will leak out.
  • Then superglue the other length of tube to the other side of the washer. Again, make sure to glue all the way around so no air will leak out

Add Pressure Taps

089161b6-1d35-4299-b87b-3a3debd20887 (1).JPG
IMG_8291.JPG
IMG_8289.JPG
IMG_8358.JPG
IMG_8357.JPG
Capture.JPG
  1. Drill 2 holes at the distances from the washer according to the attached image
  2. Push the 2mm OD rods into the holes, make sure it's a tight fit (my tube was 2.2 OD but my drill bit was 2mm, so I just waggled the drill a little until the tube fit tightly)
  3. Superglue the tube into the hole, making sure it is sealed all the way around
  4. Wrap insulation tape around your pressure tap until the silicon tube fits on nice and tight

Test and Calibrate

F6CFDI6K8LRONBQ.LARGE.jpg
Capture3.JPG
Capture4.JPG
Capture5.JPG
image2 (5).jpeg
image1 (6).jpeg
calibration.png

Connect the pressure sensor up to your Arduino and connect the pressure taps to the ports of the pressure sensor. Make sure that the sensor's physical analogue pin matches up with the pin the software.

Test it using the attached code. Note, the following libraries are needed:

Ideally you want to calibrate your sensor, we used a Sensirion SFM3300 connected in series with the home made sensor. Connections for the SFM3300 are:

Ideally your air source for the calibration test should give out a constant flow and be controllable to give out a controlled sweep of flow rates. We used an air bed pump hacked to be powered via an electronic brushed DC speed controller controlled using a potentiometer. If you have a DC power supply that will work just fine as well.

The code as well as being capable of reading the pressure and flow from our sensor, it can also read from the Sensirion SFM3300 via i2c, which is the sensor we used for calibration.You will need to adapt the code accordingly if you have a different calibration sensor. (Fairly amazingly the DIY sensor gave steadier more consistent readings than the SFM3300)

The 1st version of the code uses a calibrated lookup table to output flow rate readings. We made this by

  • logging the pressure over a full sweep from our air source (as .csv file)
  • taking the data into excel
  • passing it through an equation to work out the flow rate
  • then creating a comma separated lookup table that was copy/pasted into an Arduino integer array

The excel doc with equation is stored...

The second version of the code will use an equation in the code for the following reasons:

  • to take into account temperature (which will affect the flow rate readings)
  • to take into account a change in downstream restriction, this will be sensed with a separate downstream pressure sensor

Proper Janky Calibration Method Option

IMG_8301.JPG
IMG_8300.JPG
IMG_8298.JPG
IMG_8299.JPG

If you don't have an off-the-shelf flow sensor to calibrate it with such as a Sensirion SFM3300 then this is one way to get a SUPER rough idea of the flow output. However this will only work with a high pressure flow source (even the air bed pump might struggle to inflate a balloon) and will only work if you can repeatably turn on an off your air supply

  • Attach a balloon to the output of the system and measure the diameter it inflates to on each inflation
  • Fill a measuring jug with water (maybe about half way)
  • Reinflate your balloon to that same diameter then completely submerge it in your jug of water and record the difference in the water level before and after the balloon is inserted
  • Next you will need to measure the volume per balloon inflation in your code, this is done by integrating the flow over time. I can't give you exact code for doing this because it will have to be different depending on your flow source and how your code will sense a start and stop of the flow but I have attached a function in a text file that will out put volume, you will just need to tell it when to start and stop calculating the volume (i.e. for our test this was at the start and stop of each breath), this is indicated to the function via the boolean variable called "breathStatus". Remember to pass the flow rate in ml/s to that function when you call it.

Integrate Into Your System

image1 (6).jpeg
image0 (5).jpeg
Flow verification orifice.JPG
IMG_8272.JPG
IMG_8274.JPG

Plug it into your setup whatever it may be and enjoy measuring flow rate for under £15 :)

Attached is an example image of some flows, pressures and volumes from our ventilator application.

Plumbing straight coupling joints are great for joining this sensor to another 22mm OD tube.