Wednesday, September 30, 2020

Get closer: cell phone proximity detector

I like my pocket computer - I'm not crazy about my cellphone (they're the same thing.)

For one thing, I'm old and it still bothers me to overhear people's intimate conversations. It's not like tv that I can turn off. And often there's no telephone in sight. They're wearing a tiny headset. Who are they talking to? Are they talking to me? - an imaginary friend (I hear they're never unkind) - a voice in their head?

But the designers of cell phones have improved some irritating issues. When you are using your cell phone as a phone, it puts all the other apps to sleep so you aren't punching buttons on the desktop while you're talking. It senses when your face is near the faceplate.

The problem with my last phone is that, when I took my face away, it didn't wake up, so I couldn't enter numbers from the keyboard or use other apps to get information. I downloaded an app to disable the sleep mode while I talked on the phone. It was quite unreliable.

My new phone doesn't have that problem. When I get close, the apps go to sleep, and when I take my face away from the phone, the apps wake up.

But how does a cell phone know that your face is close? The answer is "proximeter". All cellphones have them. Usually the proximeter is an infrared LED and detector under the faceplate. You can find it if you have a sensor app like Physics Toolbox or Examobile's Sensors. Both access the proximeter so that you can see when it toggles on and off. Just waggle your finger around in front of the phone until you see the proximeter flip.

I can see the IR LED under the faceplate at the upper left of my phone. The LED constantly shines infrared light out and when an object moves close enough, it reflects the invisible light back to the detector which triggers the proximeter on.

I'll be using my proximeter later to measure periodic events like pendulum swings, so I wanted a more precise idea what to expect from it. It was pretty easy with an optical bench. Home Science Tools (https://www.homesciencetools.com) has an inexpensive one - basically a stand for a ruler and sliders that will carry lenses, a candle, screens, etc. It also has a sliding object, a metal pointer that can be used to form images with lenses and mirrors, or, in my case, a target that I could move toward and away from my phone. With the optical bench, I could measure the distance between the object and the proximeter. I also stuck a plastic pill bottle on the object for a larger target.

Here's my setup.




I used a gooseneck camera stand to position the phone over the ruler.

I made ten measurements with each target moving it toward the phone until the proximeter toggled on, and then away until it toggled off.

I could take the average of ten distances as the "true" distance and the differences between the measured distances and the averages as the amount of error in the measurements.

I found that, for the small target, I could rely on the proximeter to toggle at 5.5 cm ± 0.8 cm. To get it to toggle off, I had to back off to 6.49 cm ± 1 cm. For the large target, the proximeter would toggle on at 4.63 cm ± 1 cm and would toggle off at 6.62 cm ± 1.6 cm.

I was a little surprised that I had to bring the large target closer to get the proximeter to toggle. I assume that the smaller, metal target reflected the infrared light better than the large, white, plastic target.

The errors in the readings behaved. If I added them up, the sum was 0 which means that they were random and followed a normal (or, at least, symmetrical) distribution. So, I can reduce errors in measurements with the proximeter by taking multiple readings and averaging them.

Notice that I had to back off further than I had to approach to make the proximeter toggle. Many control systems show that kind of behavior; it's called hysteresis. If the heat in your house goes above a certain level, your air conditioner will come on, but to make it stop, the temperature has to fall considerably below that level. If the cutoff and cut-on temperatures were the same, the air conditioner would just flip off and on all day.

You can roughly determine how near and far away from your phone you have to move to trigger the proximeter by just moving your hand in front of it, but if you want to use it as a precise instrument, you need to use a set up similar to mine that allows you to make actual distance measurements.





Sunday, September 27, 2020

play, learning, and risk

I've told a lot of tales here and they're all true (I swear by my tattoo - movie reference there.) I've talked about being in storms, falling off mountains, and walking until I'm near collapse. I'm a lifelong learner and an adventurer and I've put myself at risk to experience new things. 

In my defense, I will say that I thoroughly educate myself about things I do before I do them. I don't take risks just to take risks. And I prepare for accidents.

Learning involves risks - risk of failure, risk that someone will make fun of you, sometimes actual physical risks. When handling chemicals, fire, or electricity, there's dangers. That's why school labs come with lots of safety instructions. Unfortunately at home, people often don't bother to learn safety tips.

I have often lamented the disappearance of "real" chemistry sets and other science kits. But they seem to be coming back. It's true that there were many things in those old kits that would not even be allowed in children's toys today - including mercury and asbestos. I played with arsenic and explosives. But I'm pleased to see that modern kits like the ones produced by Thames and Cosmos, and Elenco provide lots of safety information.

Still, it's up to folks at home to safeguard their homes if they are going to allow risky play and studies...and there is plenty of research that indicates that we can easily err to one side or the other - challenges or safety (Norton, C., J. Nixon, and J. R. Sibert. 2004. Playground Injuries to Children. Archives of Disease in Childhood. http://adc.bmj.com/pages) (Bond, Michael (2020) From Here to There: The Art and Science of Finding and Losing Our Way. The Belknap Press. Cambridge, MA. Esp. Chapter 2: Right to Roam) (Tierney, John (July 18, 2011) Can a Playground Be Too Safe? New York Times Reports.) Many studies seek a happy medium...safe playgrounds that are also challenging.

I want to thank Me. Colleen Stewart for the following safety resources.

https://www.safehome.org/resources/childproofing-guide/

https://www.mortgagecalculator.org/helpful-advice/fire-safety.php

https://www.firstalert.com/community/safety-corner/escape-plan/

https://www.highsecurityhome.org/home-security-measures-that-will-help-people-with-disabilities-stay-safe-at-home/

https://bighappybackyard.com/how-to-make-your-backyard-safe-for-kids/

https://www.verywellfamily.com/what-to-put-on-a-babysitter-checklist-620333

https://www.gspcic.com/learning-center/hurricane-safety/

https://www.belfor.com/en/us/water/staying-safe-during-flood

https://crisisequipped.com/how-to-prepare-for-a-tornado/

https://www.savethechildren.org/us/what-we-do/us-programs/disaster-relief-in-america/earthquake-tips

https://www.ferguson.com/content/emergency-preparedness/wildfire

https://www.almanac.com/news/almanac/musings/power-outages-what-do-when-power-goes-out

And Ms. Stewart's website is:

https://playdatefitness.com/

Part of learning is learning to learn. Learn to be safe in learning. Here is your home safety library.