Lab 1: Pressure vs. Height

PHYS 37100 - Fall 2021

Due: Sep 20th, 4 pm

The goal: use your phone's built in barometer to measure the height of something. Like a hill, or a building.


  1. Use the Science Journal App to record the pressure as you change your elevation. Available here: Arduino Science Journal
  2. Export the data as a CSV file.
  3. Use a program (please not excel) to plot your raw data
  4. Use the relation between height and air pressure to calculate the final change in height, $\Delta h$. (see below)
  5. Convert your plot so that it shows height vs. time, instead of pressure vs. time.
  6. Prepare a short document that has both plots of (P(t) and h(t)), and code you used to process your data. Compare your results to known elevation/altitude information.

Useful physics

The barometric pressure equation relates the atmostpheric pressure to height and other variables (like temperature, $g$, etc): \begin{equation} P=P_{b}\cdot \exp \left[{\frac {-g_{0}\cdot M\cdot (h-h_{b})}{R^{*}\cdot T_{b}}}\right] \end{equation} where:


An example trial involved recording the pressure as I rode the elevator from the 13th floor of Marshak to the ground floor. Here is the data plotted. (The steps in the data likely are artifacts of the phone sensor's acquisition rate, i.e. it take a few seconds to record each point. If we could make the elevator go slower, then the steps would be less visible.)

Science Journal Measurement of Pressure

Mathematica Plot of the data

An example python script for viewing the data is here: Python (Goodle Colab)

Make sure you take a look at the tutorials on this page as well: Data Tutorials

Or you can try a Mathematica notebook [pdf] - though, I don't recommend Mathematica for data related work, it's a little awkward I find. It's great for numerical methods, and solving nasty functions, but it's not so smooth for data.

  1. First: import the data:
    pressureData1 = Import[""]
  2. Next, plot it: