Below you find building instructions for a very simple and easy to build device to play with pressure measurements. It might be usable for schools or other STEM related Projects on gas laws, but may also be adapted to be integrated into other devices to measure forces or weight.
While there is a large number of sensor breakouts for pressure measurements available these days, I was missing a simple and cheap device to play with these sensors and use them for educational purposes.
My construct basically consists of a large plastic syringe and a sensor breakout placed inside of the syringe. The breakout is connected to a microcontroller by a set of cables going through the outlet of the syringe. The outlet of the syringe is sealed airtight using hot glue, or some other method, resulting in a defined volume of air being trapped inside the syringe.
The sensor is then connected to an Arduino, or another microcontroller. When the plunger of the syringe is moved, volume and pressure will change. The measurements can be displayed in real time using the serial monitor or serial plotter of the Arduino IDE.
Step 1: Materials Used
A 150 or 250 ml plastic catheter syringe - available via internet or at a hardware or garden shop near to you for a few $ or Euro.
A pressure sensor breakout - I used a cheap BMP280 (temperature and pressure) sensor I bought at Banggood. This is a 3V breakout w/o level shifter, for less than 2$ each. The measuring range lies between 650 and about 1580 hPa.
Cables and breadboard: I used long jumper cables to connect the breakout with a breadboard.
The cables should be at least as long as the syringe, otherwise connecting cables and breakout is very difficult.
A bidirectional 5 -> 3 V level shifter: required to connect the above sensor to an Arduino.
Not required if your sensor breakout, e.g. as the Adafruit version, has one already implemented on board, or your microcontroller is working with a 3V logic.
A microcontroller: I used a version of the Arduino Uno, the MonkMakesDuino, but any Arduino compatible should work. Even the Micro:bit works if you follow this instructions from Adafruit. More on this will be discussed in a comming separate instructable.
A holder for the syringe might be helpful for some applications, but is not necessary.
The Arduino IDE.
Step 2: Assembly and Application
Set up all parts on your breadboard. Connect microcontroller and level shifter, if required. In case, define one of the power rails on your breadboard as 5V, the other as 3V and connect them with the microcontroller's 5V, 3V and ground ports respectively, then connect the 3V, 5V and GND ports of the level shifter. Now connect the SDA (A4) and SCL (A5) ports of the Arduino with two non-power ports of the 5V side of the level shifter. Please note that SDA and SDA ports differ between microcontrollers, so please check for yours.
Connect your sensor using the cables you will use later with the level shifter. SDA and SCL of the sensor to the corresponding ports at the 3V side of the level shifter, The Vin and Gnd ports of the sensor to 3V and ground.
If you want to use the provided script, an installation of further libraries to the Arduino IDE are not needed. If you prefer to use the Adafruit BMP280 script, install their BMP280 and sensor libraries.
Load the BMP280 script and upload it to the Arduino.
Use the Serial Monitor to check if you receive reasonable data. If not, check connections.
Now turn off the microcontroller, and unplug the cables connecting sensor and breadboard.
Now put the cables through the outlet of the syringe. If you use jumper cables it might be necessary to widen the outlet, or to shorten it a bit. Make sure to pass the female ends inside, one after another. A I2C breakout needs four cables, preferentially use ones in different colors.
Then reconnect breakout and cables, and check that the connections are working, as above. Now move the breakout to the outlet end of the syringe. Insert the plunger and move it to a center position, a bit further than the planed resting position.
Connect the cables to the breadboard and check if the sensor is working. Turn off the microcontroller and disconnect the sensor.
Add a large drop of hot glue to the end of the outlet. Carefully suck a bit of the material in and make sure that the end is sealed air tight. Let the glue cool and settle, then check again if its air tight. If required, add some more glue to the remaining holes.
Connect the sensor cables to the breadboard and start the microcontroller.
Activate Serial Monitor to check if the sensor sends temperature and pressure values.
By moving the plunger, you are able to change pressure values. But also have a closer look on the temperature values when you push or press the plunger.
Close the Serial Monitor and open the 'Serial Plotter", move the plunger. Play!
If required, you may correct the volume by application of a bit of force to the sides of the syringe near the area of the gasket, letting in or out a bit of air.
Step 3: Results and Outlook
With the device described here, you can demonstrate the correlation of compression and pressure in a simple physics experiment. As the syringe comes with a scale on it, even quantifying experiments are easy to perform.
According to Boyle's law, [Volume * Pressure] is constant for a gas at a given temperature. This means if you compress a given volume of gas N-fold, i.e. the final volume is 1/N, its pressure will go up N-fold as well, as:
For more details, please have a look on the Wikipedia article on gas laws.
So starting at a resting points of e.g. V1=100 ml and P1=1000 hPa, a compression to about 66 ml (i.e. V2=2/3 of V1) will result in a pressure of about 1500 hPa (P2= 3/2 of P1). Pulling the plunger to 125 ml (5/4 fold volume) gives a pressure of about 800 hPa (4/5 pressure). My measurements were astonishingly precise for such a simple device.
In addition you will have a direct haptic impression how much force is required to compress or expand a relatively small amount of air.
But we also can perform some calculations and check them experimentally. Assume we compress the air to 1500 hPa, at a basal barometric pressure of 1000 hPa. So the pressure difference is 500 hPa, or 50,000 Pa. For my syringe, the diameter (d) of the piston is about 4 cm or 0.04 meter.
Now you can calculate the force required to hold the piston in that position. Given P = F/A (Pressure is Force divided by Area), or transformed F = P*A. The SI unit for force is "Newton" or N, for length "Meter" or m, and "Pascal' or Pa for pressure. 1 Pa is 1N per square meter. For a round piston, the area can be calculated using A = ((d/2)^2)*pi , which gives 0.00125 square meters for my syringe. So 50,000 Pa * 0.00125 m^2 = 63 N. On Earth, 1 N correlates to a weight of 100 gr, so 63 N are equal to holding a weight of 6.3 kg.
So it would be easy to build a kind of scale based on pressure measurements.
As the temperature sensor ist extremely sensitive, one can even see the effect of compression on temperature. I assume that if you would use the BME280 sensor, that also can perform humidity measurements, you may even see the effects of pressure on relative humidity.
The serial plotter of the Arduino IDE allows to nicely display the pressure changes in real time, but other, more elaborate solutions are also available, e.g. in the Processing language.
Beside educational purposes, one may also use the system for some real world applications, as it does allow to quantitatively measure forces that are trying to move the plunger one way or the other. So you could measure a weight placed on the plunger or an impact force on the plunger, or build a switch that activates a light or buzzer or plays a sound after a certain threshold value was reached. Or you could build a musical instrument that changes the frequency depending on the strength of force applied to the plunger.
Step 4: The Script
The script I added here is a modification of the BME280 script found on the Banggood website.
I just optimized the Serial.print orders to allow to better display them in the Arduino IDE Serial Plotter.
The Adafruit script looks nicer, but it requires some of their libraries and it does not recognize the Banggood sensor.