C is the output terminal, but you can use E as the output terminal. The diode of photoelectric switch is light-emitting diode, and the output is phototransistor. C is the collector and e is the emitter. Generally, when a triode is used as a switch, the collector is usually used as the output terminal. General connection: the diode is the input terminal, e is grounded, c is connected to the load, and the other end of the load needs to be connected to a positive power supply. This connection has a wide range of applications. Special connection: the diode is the input end, C is connected to the positive power supply, E is connected to the load, and the other end of the load needs to be grounded. This connection is only applicable to the case where the equivalent resistance of the load is very small (within several tens of ohms). If the equivalent resistance of the load is relatively large, the working point of the switching transistor may be abnormal, resulting in unreliable switching operation. ? A current-limiting resistor is connected in series with a voltage of 5v, which can be used as emission. The signal output needs shaping and filtering, because it is photosensitive, and the unstable output voltage is an analog signal, which needs to be processed into ttl level by an operational amplifier (in fact, the voltage is relatively strong, and it is judged as 0 or 1) and connected to a single chip microcomputer. The diagram below is the circuit diagram of photoelectric sensor.