The effect of a beam of light on a semiconductor is quite different from that of other objects. There are a lot of free electrons in metals, and the change in conductivity caused by light is completely negligible; insulators still cannot excite more electrons to participate in conduction at very high temperatures; and the semiconductor with conductivity between metal and insulator has much less binding force on electrons in the body than insulators. The photon energy of visible light can excite it from the binding to the free conductive state. This is the photoelectric effect of semiconductors. When there is an electric field in a local area of the semiconductor, photogenerated carriers will accumulate, which is very different from when there is no electric field. The two sides of the electric field will generate photoelectric voltage due to the accumulation of charge. This is the photovoltaic effect, referred to as the photovoltaic effect.
When a semiconductor with a PN junction is exposed to light, the number of electrons and holes increases. Under the action of the local electric field of the junction, the electrons in the P area move to the N area, and the holes in the N area move to the P area. In this way, there is charge accumulation at both ends of the junction, forming a potential difference. The formation principle of PN junction is shown in Figure 1.

The battery that uses the photovoltaic effect to directly convert light energy into electrical energy is called solar cell. The so-called photovoltaic effect is a phenomenon in which an electromotive force is generated at both ends of the system after the system absorbs light energy when the light of the appropriate wavelength is irradiated on the semiconductor.
When the PN junction is exposed to light, both the intrinsic absorption and extrinsic absorption of the photon by the sample will produce photo-generated carriers, but only the minority carriers excited by the intrinsic absorption can cause the photovoltaic effect. Because the photo-generated holes produced in the P area and the photo-generated electrons produced in the N area are multitons, they are all blocked by the barrier and cannot pass through the junction, only the photo-generated electrons in the P region and the photo-generated holes in the N region and the electron-hole pairs (minority carriers) in the junction region can drift through the junction under the action of the built-in electric field when they diffuse to the vicinity of the junction electric field. The photo-generated electrons are drawn to the N region, and the photo-generated holes are drawn to the P region, that is, the electron-hole pairs are separated by the built-in electric field. This leads to the accumulation of photogenerated electrons near the boundary of the N zone and the accumulation of photogenerated holes near the boundary of the P zone. They generate a light-generated electric field that is opposite to the direction of the built-in electric field of the thermally balanced PN junction, and its direction is from the P zone to the N zone. This electric field lowers the potential barrier, and the reduction is the photo-generated potential difference. The P terminal is positive and the N terminal is negative. Therefore, the junction current flows from the P area to the N area, and its direction is opposite to the photogenerated current. A schematic diagram of light-excited semiconductors to form “electron-hole” pairs is shown in Figure 2.

In fact, not all photo-generated carriers produced contribute to the photo-generated current. Suppose that the diffusion distance of holes in the N zone during the lifetime τp is Lp, and the diffusion distance of the electrons in the P zone during the lifetime τn is Ln. Ln + LP = L is much larger than the width of the PN junction itself, so it can be considered that the photogenerated carriers generated within the average diffusion distance L near the junction all contribute to the photogenerated current. The electron-hole pairs whose positions are more than L from the junction area will all recombine during the diffusion process and will not contribute to the photoelectric effect of the PN junction.