How does a photoelectronic sensor work?