You should set the photoelectric sensor's temperature to -10°C~50°C for reliable performance. Electronic components should be connected to a circuit or system by 10V~30V voltage. You've got to connect the 4 pins to the photoelectric sensor for it to work.