A photoelectric sensor emits a light beam (visible or infrared) from its light-emitting element as an important feature. And outputs from photoelectric sensors are typically either digital or analog. So why do it can do it? In other words, how does a photoelectric sensor work?