Op-Amp has wide application one of which is comparator. The potentiometer at the inverting terminal is used to set threshold voltage. The potentiometer connected at non inverting terminal can be used as a photodiode. When Light from LED falls on photodiode its resistance decrease causing the voltage at terminal to increase. If the voltage crosses the threshold limit then the output is high.