Flame testing is an analytical technique where a sample is applied to a flame, and the characteristic emission spectrum is used to identify different elements. When this technique is used to identify metal species, it is called metal flame emission testing. When sufficient energy is applied to some metals through a hot flame, they emit light with a characteristic wavelength or color. You can clearly see this phenomenon when watching a fireworks display.
Different metals emit different colors. Thus, we can use the color of the emitted light to determine the metal present. But before we dive into the technique further, let's take a step back. Atoms have multiple energy levels for their electrons, which are different for each element.
When an electron is at its lowest possible energy level, it is said to be at its ground state. When an atom absorbs energy, it gets excited, and electrons in the atom move from the ground state to a higher energy level. When the electrons relax back down to a lower state, or the ground state, the excess energy gained is released in the form of emitted light.
The wavelength of the emitted light depends on the energy level that the electron was excited to