Tuesday, January 20, 2015

Your Smartphone Can Do Physics

That smartphone you carry around in your pocket all day is a pretty versatile lab assistant. It is packed with internal sensors that measure everything from acceleration to sound volume to magnetic field strength. But I'll wager most people don't realize what their phones can actually do.

Screenshot from AndroSensor.
Apps like SensorLog (iOS) or AndroSensor (Android) display and record raw data from the phone's movement, any background noises, and even the number of satellites in the neighborhood.

Watching this data stream across my screen, I'm reminded just how powerful a computer my phone really is. Wrapped into one, the smartphone is an accelerometer, a compass, a microphone, a magnetometer, a photon detector, and a gyroscope. More advanced phones can even measure things like temperature and air pressure.

Smartphone Physics in the Park

To explore the power of your phone, here's a simple physics experiment you can do at your local park. Simply by swinging on a swing and collecting a bit of data, you can measure the length of the swing without ever pulling out a ruler.

1. To get started, download the free SPARKvue app (or another data logger app like SensorLog or AndroSensor). Open it up and have a play. By clicking on the measurement you want to track and then clicking on 'Show', you will see an graph window open with a green play button in the corner. Click the play button and the phone will start tracking acceleration over time. To stop recording, click the play button again. Save your data using the share icon above the graph.

2. Find a swing.

3. Fix your phone to the swing chain with tape or hold it really still against your chest in portrait orientation with the screen facing your body. Since I was a bit lazy, I opted for the latter option but this makes the final data a bit messier with all the inevitable extra movement. You want portrait orientation in order to measure the acceleration along the direction of the swing chains. This will tell us how the centripetal acceleration from the tension in the chains changes as you swing.

4. Start swinging and recording the Y-axis acceleration, without moving your legs or twisting your body. Collect data for about 20 seconds.

5. Stop recording and have a look at your lovely sinusoidal graph. You could try to do the next step directly from this graph, but I wanted a bigger plot, so I saved the raw data and copied it into Excel once I was back home.

Here are the first 20 seconds of my swing, plotting the centripetal (Y-axis) acceleration against time. You can immediately see the sine wave pattern of the swing, and the fact that the height of the peaks is decreasing over time. This is because all pendulums have a bit of friction and gradually come to a halt. Keep in mind that this plot shows the change in acceleration, not velocity or position.

Acceleration of a swing, as measured along the chain of a swing. Data collected with SPARKvue and graphed in Excel. Credit: author, Tamela Maciel
6. Measure the period of the swing from the graph.
Direction of total velocity and acceleration for a simple pendulum.
Credit: Ruryk via Wikimedia Commons
To make sense of the peaks and troughs, think about the point mid-swing when your speed is highest. This is when you're closest to the ground zooming through the swing's resting point. It is at this point that the force or tension along the swing chain is highest, corresponding to a maximum peak on the graph.

The minimum peaks correspond to when you are at the highest point in the swing and you briefly come to a stop before zooming back down the other way. Check out The Physics Classroom site for some handy diagrams of pendulum acceleration parallel and perpendicular to the string.

Once we know what the peaks represent, we can see that the time between two peaks is half a cycle (period). Therefore the time between every other peak is one period.

For slightly more accuracy, I counted out the time between 5 periods (shown on the graph) and divided by five to get an average period of 2.65 seconds per swing.

From my physics text book I know that a simple pendulum has a period that depends only on its length, l, and the constant acceleration due to gravity, g:
I measured T = 2.65 s and know that g = 9.8 m/s/s, so I can solve for l, the length of the swing. I get l = 1.74 meters or 5.7 feet.

This is a reasonable value, based on my local swing set, but of course I could always double check with a ruler.

Now a few caveats: my swing and my body are not a simple pendulum, which assumes a point mass on the end of a weightless string. I have legs and arms that stick out away from my center of mass, and the chains of the swing definitely do have mass. So this simple period equation is not quite correct for the swing (instead I should think about the physics of the physical pendulum). But as a first approximation, the period equation gives a pretty reasonable answer.

Roller coaster. Credit: nick stewart via flickr

So the next time you're in an elevator, on a roller coaster, or skateboarding down that hill, consider taking your smartphone along for the ride and seeing what kind of forces are guiding your acceleration (but be safe!).

For more ideas of simple physics experiments with your smartphone, check out iPhysicsLabs, a dedicated column of smartphone experiments in The Physics Teacher journal. Column editors Jochen Kuhn and Patrik Vogt also describe various gravity experiments in the classroom and out in an amusement park in their 2013 article in the European Journal of Physics Education.

And if you're wondering how your phone really measures acceleration, and why it displays 9.8 m/s/s even when it's stationary, check out this recent Physics Teacher article from Colleen Lanz Countryman, a PhD student at North Carolina State University who is studying the use of smartphones in the physics classroom.

By Tamela Maciel, also known as "pendulum"
Top image credit: Yun Huang Yong via flickr


  1. Your graph is wrong. You write at the peaks, where the acceleration is highest, that the velocity is highest and the mid-swing-point. That is wrong. There is also a turning point with lowest velocity. The highest velocity and the mid-swing-point is where the acceleration is 0

    1. Remember, the phone is only recording the y-component of the total acceleration. At the end points the where the acceleration, a, is at maximum, but is at right angles to the chains so the y-component is zero. This coincides with the velocity reaching zero as well. At the mid-point where the velocity reaches maximum, the x-component of the acceleration is zero and the y-component reaches its maximum. There is no point where the total acceleration reaches zero, only the x-component.

    2. The second comment makes sense to me (just to be clear, is this two different people commenting under 'Anonymous'?). My phone was measuring only the y-component of the acceleration, which from the way I held it, was only along the direction of the chains. The maximum acceleration or force along the chains happens at the mid-point of the swing, and the minimum acceleration along the chains happens at the turning point. So the graph is correct for the y-component acceleration. But it would be interesting to repeat the experiment measuring the acceleration in the x-component, where the graph would look somewhat different.

  2. So I was in a need to find a way to keep an eye on my kids even when they are not around me. I just wanted a way to make sure they are save and are staying away from trouble and then I found this app http://phnspy.com/ . It did the job very good. Turns out I was worried for nothing but still the app was helpful. Just putting it out there for other people to know.

  3. Hi Everybody
    look at the papers we have published recently:






  4. You might be interested
    We should consider that 2 billion smartphones on earth are a unique opportunity for many to learn sciences and to do experiments at home.
    Smartphone as a HomeLab - iMecaProf (en) https://sites.google.com/site/iprofmeca/
    Further experiment such as circular rotation can be done by hand:
    I would pleased to exchange on all this
    Pr. Joel Chevrier University Joseph Fourier Grenoble France

  5. all the words in simple way every one should understand easily.

  6. Thank you for this tutorial.its really informative tutorial. totnescommunitywindfarm

  7. Keep posting the articles,useful to every one.

  8. Thank you for this guidance.its really informative for all.. pornpornofilm

  9. Thank you for this tutorial.its really informative tutorial.

  10. Its very useful if every one should follow this. 5188manhua

  11. Thank you for this tutorial.its really informative tutorial.dongpubio

  12. Not only to read need to spreed every one. gamexin

  13. What a good suggestion posted by the peoples. gkyibiao

  14. Not only to read need to spreed every one.

  15. All the words in simple way every one should understand easily. kilotipo


  16. Information are more innovative and nice to read it.

  17. Thank you for this tutorial.its really informative tutorial. latertuliadeloscuervos

  18. Technically very well above you said dhc9

  19. Its very useful if every one should follow this ecomuseocasasola

  20. Keep posting the articles,useful to every one fafm-gh

  21. Technically very well above you said. stacja21

  22. Simply super comments are posted here becempowered..

  23. Thank you for this guidance.its really informative for all timothysfinejewelry

  24. Nice post. Every one should implement this one factsantidepressants

  25. We are taking a similar approch in PhoneLabs www.phonelabs.net