Simple optical switch? I have built a conveyor belt for my son out of Lego Technic. Now, I would like to add a simple optical switch, so that the belt stops when an object arrives at the end of the belt... However, I am not sure about which part I should use for that.
I'm assuming from your question that you are currently using Power Functions parts to control your conveyor. In order to achieve the sort of electrical automation that you are talking about, you'll need something like LEGO Mindstorms. The current line is called EV3. You'll need at minimum the Intelligent Brick, a light sensor, a motor, and a few cables. You can also buy the complete EV3 kit.

If that seems too pricey for you, you could try searching for used NXT (previous version), or even RCX (first version) Mindstorms kits.

Once you have the Mindstorms parts that you need, you'll just need to program the brick to do what you want using software on your computer.