How to sense that an object is in place

The short of it is that I have a machine that needs to know when a cup, or other drinking vessel, has been placed into a chamber. The chamber is about 6 inches square and cups are placed into the middle. What kind of sensor would be best for this sort of thing? I was thinking some sort of "electric eye" that can tell when a light has been interrupted but I don't know what kind of sensor does this. Any guidance is appreciated!

A photoresistor (also called LDR or light dependent resistor) would probably work, although you may need to provide a light beam that the cup interrupts. There are also photodiodes and phototransistors, with lots of tutorials for each.

I would use capaciency if i were you. I believe there is a library for this here

Here is a project using it that I pulled up really quick.

Depending on the weight of the cups/drinking vessels, why not use good old non latching switches?
Something similar to the attached diagram.
I have drawn the chamber as a square (simply because it’s easier to draw it like that) but a tubular shape would work even better.
Anyhow it’s simply to illustrate the idea.

I like that switch idea a lot. I need something with super minimal coding required, there isn't a lot of room left.

ncivitello: I like that switch idea a lot.

As long as the containers are heavy enough to reliably push down the switch, it will work nicely. The small pcb mount switches need very little force to work.

I need something with super minimal coding required, there isn't a lot of room left.

You can't get simpler than reading switches. Just remember to do a bit of debouncing, either via a capacitor and resistor or in software. Unless you have other bits of code that can't tolerate blocking code, the software debounce could be as simple as waiting (or polling) for a switch to be triggered, wait another 100mS or so and check it's state again.