Barcode reader
A barcode reader is an electronic device for reading printed barcode
A barcode is an optical machine-readable representation of data, which shows data about the object to which it attaches. Originally barcodes represented data by varying the widths and spacings of parallel lines, and may be referred to as linear or 1 dimensional . Later they evolved into rectangles,...

s. Like a flatbed scanner, it consists of a light source, a lens and a light sensor translating optical impulses into electrical ones. Additionally, nearly all barcode readers contain decoder circuitry analyzing the barcode's image data provided by the sensor and sending the barcode's content to the scanner's output port.
Pen-type readers consist of a light source and a photodiode
A photodiode is a type of photodetector capable of converting light into either current or voltage, depending upon the mode of operation.The common, traditional solar cell used to generateelectric solar power is a large area photodiode....

 that are placed next to each other in the tip of a pen or wand.