I'm starting a new project about a kind of "magic box" that says things aloud when the user puts his hand inside the opening.
I have never used proximity sensors before, so I'm uncertain about the one best suited to the project.
My first choice would be a PIR sensor (such as this one or this one) since I only need on/off human motion detection. But those PIR modules seem to have long-range lenses, made for motion detection inside a room. Will they work in a narrow opening such as a box?
Another choice is using a reflective IR sensor and painting the inside of the box black. Will it work? This would also give me an on/off signal.
Finally, I could use an ultrasound sensor and detect when the distance goes below a configurable threshold. This would be more difficult to use, but it could possibly work better.
What is your advice?
Will a simple room-grade PIR module work well inside a box? Am I correct in thinking that it would be less power-hungry than the other two, active sensors? Should I just buy them all and experiment?
In a small closed box I would recommend infrared. As you mentioned, PIR seems to be mostly long-range, and ultrasound is hard to handle in close quarters and suffers from sound reflection issues from corners and such (though the module you picked says its range goes down to 2cm....I'm still skeptical).
--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons
Hi,
Is the box small? Does the user's hand position "mean" anything?
If it's small all you need is an IR LED pointed across the gap at a Phototransistor (Preferably an IR filtered one) connected to an Arduino input with a pullup resistor. Try 10K but experiment for sensitivity. (The LED needs maybe 220 ohms current limiting resistor)..
You COULD use 10K pullup and go into Analog input and test the received values and pick best trigger level...