A scanning electron microscope or SEM scans a sample with an electron beam to provide information about the topography and composition of the sample surface. SEM uses an electron gun to generate a negatively charged electron beam attracted downward by a positively charged anode. Electromagnetic lenses then concentrate the electron beam and reduce its diameter. Next, scanning coils deflect this focused electron beam along the x- and y-axis and allow it to scan a rectangular area of the sample surface. The high-energy primary electron beam excites electrons in the atoms of a sample, leading to the release of low-energy secondary electrons. These secondary electrons are read by the detector and used to generate a 3D image of the sample surface. The electron beam-sample interaction also produces characteristic X-rays, which provide information about different elements, such as iron and nickel, present in the sample.