## Measure pressure with your micro bit gaston y astrid lima

#

The device allows to perform quantitative air pressure measurements, and to display the results on the micro:bit LED array or on a connected computer, for the later using the serial monitor or serial plotter functions of the Arduino IDE. In addition you have a haptic feedback, as you will push or pull the plunger of the syringe yourself, and hereby feel the required power.

By default, the display allows you to estimate the pressure by the level indicator shown on the LED matrix. The serial plotter of the Arduino IDE allows to do the same, but with much better resolution (see video). More elaborate solutions are also available, e.g. in the Processing language. You also can display the precise measured values of pressure and temperature on the LED matrix after pressing the A or B buttons respectively, but the serial monitor of the Arduino IDE is much faster, allowing to display values in near real time.

Total costs and the technical skills required to build the device are rather low, so it could be a nice classroom project under supervision of a teacher. In addition the device could be a tool for STEM projects with focus on physics or used in other projects where a force or weight shall be transformed into a digital value.

As Pimoroni has developed a MakeCode library for the BMP280 sensor, This gave me the opportunity to develop a script to be used for the device described here. The script and the corresponding HEX-file can be found in the last step of this instructable. To use it, just load the HEX file to your micro:bit. No need for special software, and you may use the online MakeCode editor for editing the script.

This means if you compress a given volume of gas N-fold, i.e. the final volume is 1/N fold of the original, its pressure will go up N-fold, as: P0*V0=P1*V1= const. For more details, please have a look on the Wikipedia article on gas laws. At sea level, the barometric pressure is usually in the range of 1010 hPa (hecto Pascal).

So starting at a resting points of e.g. V0=100 ml and P0=1000 hPa, a compression of the air to about 66 ml (i.e. V1 = 2/3 * V0) will result in a pressure of about 1500 hPa (P1= 3/2 of P0). Pulling the plunger to 125 ml (5/4 fold volume) results in a pressure of about 800 hPa (4/5 pressure). The measurements are astonishingly precise for such a simple device.

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" N, for length "Meter" m, and 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

This can be checked easily using a scale. Push the syringe with the plunger onto the scale, until a pressure of about 1500 hPa is reached, then read the scale. Or push until the scale shows about 6-7 kg, then press the "A" button and read the value displayed on the micro:bit’s LED matrix. As it turned out, the estimation based on the above calculations were not bad. A pressure slightly above 1500 hPa correlated to a displayed "weight" of about 7 kg on a body scale (see images). You also could turn this concept around and use the device to build a simple digital scale based on pressure measurements.

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 hitting 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. Or use it as a game controller.