photo interrupter sensor can detect the light interruption and often be used as switch device. This project we will use this sensor to detect photo interruption and turn on a LED.
Step 1: connect sensor with Arduino as per following graph:
photo interrupter
Step 2: Download sketch code and load it into Arduino.

Step 3: test the project as per following video: