Showing posts with label smartphone. Show all posts
Showing posts with label smartphone. Show all posts

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.





Thursday, May 11, 2017


--- Computer equipment ---

2016

I'm a packrat when it comes to collecting equipment for my lab. I look for inexpensive but reliable sources, both online and in my  neighborhood and travels. For instance, I can easily walk to several local WalMarts, a Home Depot, or The Science Company.

I've acquired a nice array of small accessories for both my computer and my smartphone. Here are a few items.

My computer equipment is kept in two computer bags.

My Dell N5040 laptop. I've had it for years and have no desire to replace it.

A couple of gigabyte flash drives is necessary because I'm always passing files to people when I carry my laptop out.

A few extra recordable CD's for the same reason.

A USB hub. That gives me four USB ports off one of the two on my laptop.

A dust brush to clean off the display.

A CD drive cleaner, because it tends to need it at the most inopportune times.

And, of course, all those cables, half of which I have no idea why they're still there.

The other computer case has the interesting stuff in it.

Trackball. I'm used to a mouse and would probably never switch to a trackball, but it comes in handy when you're doing psychological experiments dealing with coordination and such.

2 extra webcams. There's one built into the laptop, but it's nice to be able to switch between viewpoints and these tiny webcams are much easier to point at things.

A USB thermometer sensor.

A lamp that can be plugged into the computer's USB port. Those things are amazingly useful to be so simple.

My sensor hub is a Sinometer VA18B multimeter. It has all the cables including a USB link that will connect to my laptop. I can measure just about anything that I might want to measure with that, and the software allows me to either display a instantaneous value or track measurements over time as a graph or table of values.

(Note: Over time, the multimeter has stopped working with my computer and I have switched to a Dataq DI-145 data logger. For the price - much less than $100 - it does a great job.)

If I want to keep track of faster changing quantities, I have a Sainsmart computer oscilloscope in my bag.

A portable Adesso EZScan 2000 document scanner. Once I got used to feeding pages into it, operation has been pretty much flawless.

Intuos drawing tablet with the pen. It works very nicely as a computer blackboard.

The smartphone equipment is kept in a waist pack.

Very good smartphone cases are very inexpensive. Mine is a three piece LK case that has a silicon shock absorbing inner shell (which is important since I drop my phone from heights as parts of physics demonstrations), a hard outer case, and a cover that all that slides into. The cover and hard case has easel stands that slide out and the cover has a belt clip.

I also have an armband mount that keeps the phone where I can get to it - on my arm. Since I use it as a field instrument, that is one of the best purchases I've made for my phone.

The waist pack carries a couple of flashlights (one red, for night vision).

A clip on microscope lens with LED light. I got it from American Science and Surplus and they're right - it has no business working as well as it does. It gives me up to 30X, and that's about perfect for most field work.

A Carson 6X telephoto lens that has a clip on phone mount. I find smartphone telephoto lenses hard to aim, but once you have the target in sight, they're fantastic. One thing is certain - a tripod is necessary. I have a table tripod in the pack. If I need a full size camera tripod, I have a Bower professional rig I can sling over my shoulder (the carrying bag has a shoulder strap). It's not heavy but tends to swing in all the wrong directions.

I also keep a lens cloth in the pack.

A Edmund Scientific pen microscope/telescope (remember those? Mine still works fine and they still sell them).

A laser pointer.

A tape measure/minidriver tool set I picked up at a conference somewhere.

A tripod clamp mount that allows me to clamp a variety of things to my tripods.

And I have an iStabilizer smartphone tripod mount that has standard size tripod sockets on two sides. With the 1/4" x 20 threads per inch hardware I keep with me, I can mount my smartphone to just about anything. The mount will even clamp onto my Arduino microcomputer.