L14G2 is an NPN phototransistor. It acts as a photodetector in the sense that it can convert the incident light into electric response. They are commonly used as sensors usually paired with a light source like LED.
These are the bipolar transistors having a transparent case. This transparent case exposes the base collector region of transistor to external light. When light incidents on this junction, electrons are generated by the photons. These electrons are injected in the base of phototransistor. The current gain of the transistor amplifies the resulting photocurrent at the base collector junction. Thus a phototransistor conducts in the presence of light and remains in off mode in absence of light. The maximum dark current is 100nA; while in light its current is 500µA.
A phototransistor is different from a simple transistor in the way that in the latter, voltage applied to the base is replaced by light striking it. Simply put, a phototransistor amplifies variations in the light striking it.
*Phototransistors may or may not have a base terminal. If a base terminal is available, it is used to bias its light response.
Photodiodes can also be used for similar function as phototransistors, but they have much lower gain and thus lower photocurrent. Phototransistors cannot detect low intensities of light but are more responsive to the exposed light. Also, the transistor response lasts for a longer period as compared to a photodiode.
The required light source is a gallium arsenide LED with peak wavelength is 940 nm. The emitter lead is indicated by a protruding edge in the transistor case. The base is nearest to the emitter. The collector is at the other extreme side of the casing.