(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...
"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.