Fun with IR Sensors
erco
Posts: 20,257
(Didn't there used to be a sensor forum...?)
I just ordered some I2C hand gesture sensors to play with, 3 cost $7.58. China... yeah, I know...
https://www.ebay.com/itm/183447396095 says:
"This is the RGB and Gesture Sensor, a small breakout board with a built in APDS-9960 sensor that offers ambient light and color measuring, proximity detection, and touchless gesture sensing. With this RGB and Gesture Sensor you will be able to control a computer , Microcontroller, and more with a simple swipe of your hand! This is, in fact, the same sensor that the Samsung Galaxy S5 uses and is probably one of the best gesture sensors on the market for the price."
Much less high-tech are these simple IR reflective sensors, just an LED and phototransistor in a housing, model TCRT5000. https://www.ebay.com/itm/20Pcs-TCRT5000-Reflective-Photoelectric-Switch-Infrared-nw/254476633129 20 pcs for $4 shipped. I've had some for a while, never used 'em until now. I needed a simple cliff sensor so a robot hopefully won't fall off a table. As always, I want the simplest, minimum part solution, so some experimentation with analog circuitry was in order. I came up with the hastily-scribbled two-resistor circuit, saved here for future reference and anyone who might want it. Those are 1K and a 100K resistors. This 5V circuit is adjusted to output logic-level signals that can be read directly by an input pin, transitioning from low to high at ~1.4 (BASIC Stamp!). Sensor positioned ~3/16 to 1/4" above the floor, looking downward. LED draws 7mA. Nothing sensed (looking over the table edge) gives ~0.5V output (LOW). Anything sensed gives much higher voltage (HIGH). White surface=5V, black plastic or electrical tape =1.65V. Simple 2-resistor circuit works for me.
I just ordered some I2C hand gesture sensors to play with, 3 cost $7.58. China... yeah, I know...
https://www.ebay.com/itm/183447396095 says:
"This is the RGB and Gesture Sensor, a small breakout board with a built in APDS-9960 sensor that offers ambient light and color measuring, proximity detection, and touchless gesture sensing. With this RGB and Gesture Sensor you will be able to control a computer , Microcontroller, and more with a simple swipe of your hand! This is, in fact, the same sensor that the Samsung Galaxy S5 uses and is probably one of the best gesture sensors on the market for the price."
Much less high-tech are these simple IR reflective sensors, just an LED and phototransistor in a housing, model TCRT5000. https://www.ebay.com/itm/20Pcs-TCRT5000-Reflective-Photoelectric-Switch-Infrared-nw/254476633129 20 pcs for $4 shipped. I've had some for a while, never used 'em until now. I needed a simple cliff sensor so a robot hopefully won't fall off a table. As always, I want the simplest, minimum part solution, so some experimentation with analog circuitry was in order. I came up with the hastily-scribbled two-resistor circuit, saved here for future reference and anyone who might want it. Those are 1K and a 100K resistors. This 5V circuit is adjusted to output logic-level signals that can be read directly by an input pin, transitioning from low to high at ~1.4 (BASIC Stamp!). Sensor positioned ~3/16 to 1/4" above the floor, looking downward. LED draws 7mA. Nothing sensed (looking over the table edge) gives ~0.5V output (LOW). Anything sensed gives much higher voltage (HIGH). White surface=5V, black plastic or electrical tape =1.65V. Simple 2-resistor circuit works for me.
Comments
But nothing was happening. Went crazy for a bit until I reached for my old Android phone, which saw the IR straightaway.
Turns out my iphone 5 CAN'T see IR. A bit of Googling confirms that Apple adds an IR filter. https://www.instructables.com/id/See-Infrared-LED-Light-with-an-iPhone-4/
Live & learn.
Ban IR filters and power only USB cables!
Or just ban iPhones with such useless "features" (and proprietary cables).
Having been exclusively an Android user until recently, I am loath to admit that iPhones are actually superior in many ways. Photo quality, security, GUI, etc, even on an old iphone 5.
My biggest surprise is that when used with various Wifi video cameras, there is almost zero lag even on iphone 5/6, compared to nearly a second on my newer Androids. A second of delay makes it nearly impossible to fly an FPV drone. OK for a slow-moving robot though.
It could be that my Android phones ((LG Aristo 2) are low-end units, the freebies that phone companies give with contracts.
My daughter got an iphone 11 for Christmas, that is a whole different animal with a ridiculous amount of processing power.