Hi. I have a vending machine which dispenses vending cups. I noticed sensors which look like LEDS on either side of the cup holder. How do these sensors work, as I would like to use them in a project later on.
More than likley one is an LED the other is a photo transistor or a photo diode.
If the detector can't see the light coming from the LED it knows there's something blocking the space between which it assumes is the cup. Pretty basic.