Tag Archives: sensors

Rocket Science in my Pocket

by Shane L. Larson

When I was growing up, the end-all toy of toys was a Remco utility belt.  In accordance with my secret personas and the innermost inscrutable desires of my soul, I had two: a Batman utility belt, and a Star Trek utility belt.

(L, upper) A Remco Batman Utility Belt. (L, lower) A Remco Star Trek Utility Belt. (R) A modern tricorder toy.

(L, upper) A Remco Batman Utility Belt. (L, lower) A Remco Star Trek Utility Belt. (R) A modern tricorder toy.

I’ve always been a Trekker at heart, so the Star Trek utility belt was my favorite, mostly for the tricorder.  Today, I have replicas of all the classic elements of this old Remco belt — phaser, communicator, and tricorder — but the tricorder is still my favorite.  I love the tricorder because it is a small device, easily carried, connected to all the knowledge of the world, and able to probe the world around you with a suite of sensors and gizmos — a tricorder can do anything. At the time Star Trek was created, and even up through the most recent Star Trek series on television, tricorders were science fiction.

My iPhone 4S --- a modern day tricorder.

My iPhone 4S — a modern day tricorder.

But tricorders are no longer science fiction.  There is an X-Prize competition to make a working medical tricorder a reality. More importantly, many of us are walking around with tricorders in our pockets right at this very moment (are you reading this blog on one?); we call them smartphones. Smartphones are awesome devices. They are smaller than the tricorders of Star Trek, but they have built into them the capabilities of communicators, and they can connect to the worldwide digital library of human knowledge that we call “the Internet.” Most importantly they are outfitted with a suite of physical sensors that can be used to understand the world: a camera, a light sensor, microphones, a magnetometer, and an accelerometer.

It may be easy to ignore these little gadgets, dismiss the sensor suite as features (toys) for complete uber-nerds.  The data they produce may seem somewhat esoteric, and obtuse, far removed from the things you care about in everyday life. But these sensors provide you — an average citizen of the Cosmos — with a remarkable and astonishing power. YOU can use these sensors to illuminate the secrets of Nature, to probe the laws of physics in your immediate environment. These are the same laws of physics that govern distant galaxies, shape avalanches in the Rocky Mountains, explain the inner workings of your Kitchen-aid Mixer, drive the biorhythms of your cardiopulmonary system, and produce exploding garbage trucks on movie sets.  You live in a magical time in history, when the tricorder in your pocket lets you see the world around you anew, to ask questions like: how is my voice different from Barry White’s? Why is this light yellowish looking and this light is bluish looking? How high of a shelf can an egg fall off of without serious damage occurring? There are a variety of apps for your phone that will let you probe the various sensors.  Let’s look at some awesome capabilities that those apps enable.

ACCELERATION. Acceleration is the rate at which your motion is changing — if you are changing direction or speeding up or slowing down, you are accelerating.  Our perception of motion naturally has three possible directions: up/down, left/right, and forward/back, and your phone has 3 sensors (“accelerometers”), one for each of these directions. If I put my phone in my pocket, and start walking, sometimes the phone is moving up, but then changes direction and is moving down.  The gait of my walk means my hips twist and turn, so sometimes the phone is moving left and sometimes right.  The lines shown here represent the three changing motions of the phone as I walk across the room.  I can also find out what happens to my phone when I drop it on the (carpeted) floor.  The sudden sharp accelerations are the phone suddenly going from moving very fast to moving hardly at all (read: SMACK! Yes, I dropped my phone on the floor, just for you.).

(L) Acceleration profile of me walking across the room, phone in my pocket. (R) Acceleration of my phone hitting the carpeted floor, having been dropped from waist height.

(L) Acceleration profile of me walking across the room, phone in my pocket. (R) Acceleration of my phone hitting the carpeted floor, having been dropped from waist height.

Vibrations are easy to capture; if I lay my phone on a table, then sharply pound on it, the phone can sense the small bouncing motions, shown in the video here.  There are many uses for being able to measure acceleration.  You can capture other interesting graphs by running the sensors when you are a passenger in a car, when you ollie on your board, or by setting your phone on the washing machine when it is running.

Screen capture using Soundbeam app of a speaking voice. Video with audio here.

Screen capture using Soundbeam app of a speaking voice. Video with audio here.

SOUND. Sounds are a form of wave. Different sounds have different wave shapes. The shapes of those waves entering your ear is what allows you to distinguish different sounds from one another. It’s why your voice and my voice sound different from one another. The microphone on your phone captures sounds, and what it senses can be plotted to show you the wave shapes.  Sounds like the human voice have many different waves all added together, so the wave plots are jagged and non-uniform, rising and falling as we make words, change pitch and tone, and shape sound.

Screen shot using Soundbeam app of a whistle, a pure wave tone. Video of whistling different tones here.

Screen shot using Soundbeam app of a whistle, a pure wave tone. Video of whistling different tones here.

By contrast, some sounds are pure tones — a single wave that has a smooth repeating wave shape when plotted. A whistle is a good example (to the extent that one can maintain even pitch and tone when whistling).  Here is a movie of the waveforms when I am (attempting) whistling at different constant tones.  Low pitched sounds have wider wave shapes; high pitched sounds have narrower wave shapes.  When you hear a low pitch sound, fewer little wave bumps are entering your ear and impinging on your eardrums. When you hear a high pitched sound, lots of little wave bumps are entering your ear.

MAGNETIC FIELDS.  We are surrounded by magnetic fields. The Earth has a very prominent magnetic field that we have exploited for navigation for a millennium or more. We use magnetic fields to stick lottery tickets and children’s drawings to refrigerators. You’ve probably unknowingly encountered magnetic fields out in the world. Have you ever exited a parking lot, and had an automatic gate open as you approach it? These gates usually sense a magnetic field associated with the metal in your car.

Your phone uses the magnetometer as an electronic compass, but you can use those sensors to probe one of the first discoveries of modern physics — that electricity and magnetism are connected!  In the early 1800’s, physicists thought electricity and magnetism were two completely different things. Then in 1819, Hans Christian Ørsted discovered that electric currents could deflect magnets! This was a watershed discovery that was followed up by many others including Faraday, Ampere, Henry, and Maxwell.  The outcome was the first great unification in physics, of electricity and magnetism into a single theory called (remarkably!) electromagnetism. You can probe the same discovery as Ørsted using your smartphone. I was able to use my phone’s magnetometer to sense the power cord to my laptop, but you get dramatic results by moving your phone around a high power electrical device like your television set!

(L) Magnetometer reading as I push my tricorder toward the power cord to my laptop [which is SO Twentieth Century!]  Video here.  (R) Magnetometer reading as I move my tricorder around the back of my flat screen TV.  What is in there?  Video here.

(L) Magnetometer reading as I push my tricorder toward the power cord to my laptop [which is SO Twentieth Century!] Video here. (R) Magnetometer reading as I move my tricorder around the back of my flat screen TV. What is in there? Video here.

But there is a mystery here — I get a reading even if the television is off. What is in there?! I’ll need a screwdriver to find out… 🙂  What else can you discover in your house with strong magnetic fields?

LIGHT. One of the most important tools in science, particularly in astronomy, is spectroscopy — the study of different colors of light emitted by different materials. Everything that we have ever seen in the Cosmos is comprised of combinations of 92 naturally occurring materials, that we call “elements.”  Each of these elements emits light in a characteristic set of colors, a fingerprint that uniquely identifies one element compared to another.

The visible light fingerprints ("atomic spectra") of all the known chemical elements. Each atom emits and absorbs these unique sets of colors, making it possible to identify them.

The visible light fingerprints (“atomic spectra”) of all the known chemical elements. Each atom emits and absorbs these unique sets of colors, making it possible to identify them.

It was a deep understanding of the spectra of the stars that allowed Cecilia Payne-Gaposchkin to brilliantly deduce in 1925 that the stars were mostly hydrogen and helium in her PhD thesis.

Cecilia Payne Gaposchkin, the first person to understand what the stars are made of.

Cecilia Payne Gaposchkin, the first person to understand what the stars are made of.

When you look at a lightbulb, or a star, you perceive a particular hue, a shade of color that your eye feeds to your brain. But if you pass that light through a prism, the light divides itself into a cacophony of colors that all mixed together to produce the hue you saw. You can break light up by passing it through a prism, or through a diffraction grating (modern diffraction gratings are thin, transparent plastic with hundreds of finely spaced grooves that allow it to behave very similarly to a prism when light passes through it).

My tricorder, Macgyvered into a spectrometer using instructions with the spectraSnapp application.

My tricorder, Macgyvered into a spectrometer using instructions with the spectraSnapp application.

My colleagues at the American Physical Society have just created an awesome and simple modification of your phone that will let you not just take pictures, but capture, measure and identify spectra of different light sources using your phone.  The app is called spectraSnapp.  The app includes instructions on how to MacGyver a simple attachment from construction paper, tape, and a piece of diffraction grating (which could be MacGyvered to any phone, not just an iPhone).  This makes it possible to capture very clean spectra, like those shown below.

Sample spectra taken with my tricorder. (L) The line spectrum from a common compact fluorescent bulb. (R) The continuous spectrum from a traditional incandescent bulb.

Sample spectra taken with my tricorder. (L) The line spectrum from a common compact fluorescent bulb. (R) The continuous spectrum from a traditional incandescent bulb.

If I use the analysis suite built into spectraSnapp, it would seem that I’m looking at the spectrum of a compact fluorescent bulb (but I knew that! 🙂 ), and that the bright lines I captured are the brightest lines in the spectrum of mercury.

The spectraSnapp analysis screen lets you compare your spectrum to reference spectra. It seems my spectrum looks a lot like a compact fluorescent bulb (L), and that there is mercury in it (R).

The spectraSnapp analysis screen lets you compare your spectrum to reference spectra. It seems my spectrum looks a lot like a compact fluorescent bulb (L), and that there is mercury in it (R).

The number of possible experiments and explorations you can do with this technology in your hand is limited only by what you can think to do.  Want to know how loud the neighbor’s ZZ Top Airband party is? There’s a sensor and app for that. Want to know how many g’s you pull in an express elevator to the 67th floor? There’s a sensor and an app for that. Want to know how “do not disturb” that new mattress really is if you jump on it? There’s a sensor and an app for that.

Technology and smartphones have transformed our world in unprecedented ways. Sure they give you something to do when you’re eating lunch at a hot dog stand by yourself, but they also give you ways to better understand the world around you, and through that understanding, to improve your lives.  So pull your tricorder out of your pocket; you’ve been selected to lead an away team, and the world is right outside your door!

NOTES: The apps I used for writing this blog were all used on an iPhone 4S. There are many others that could be used as well.  Similar apps must exist for Droid users.  The apps I used were:

  • Sensor Kinetics (LINK)
  • Soundbeam (LINK)
  • spectraSnapp (LINK)