Spectrum of discharge of air Where do the various colors in electrical discharge of air with a high voltage originate from? Are these transitions in ionized nitrogen gas or unionized gas? Are chemical reactions involved? I assume the violet color is corona discharge. What are the transitions involved?
When I connected 2 nails to a $15\,\rm kV$ AC and kept them close enough, there is yellow plasma visible. But, when separated a little more, no visible spectrum visible. I assume electrons get enough energy to cause yellow transition in $\mathrm{N_2}$ in the first case, but infrared occurs in second. I don't know if discharge fails to occur altogether in second case, and if only corona is occurring. Are these the electronic transitions in $\mathrm{N_2}$ or the ionised $\mathrm{N_2^+}$.
I also want to know, up to what distance would the plasma be formed, and after that, only corona discharge would occur?
 A: You do not many details of the setup, but I assume it an electrical discharge in air inside a closed ball, like in some museums? If such is the case, different elements mixed with the air will get the atoms either ionized or some electrons exited to exited to a higher energy level. When these decay back to their original energy they emitting light of a specific frequency during the process, because each element has a specific energy structure for its orbitals. For instance sodium usually emits in yellow. Other elements in other colors, but I don't remember which ones, so you might need to do  a search if you want more details.
A: There are two main mechanisms which can be involved.
For a discharge to occur, atoms in the air must become ionised. When the electrons and ions recombine, they release a characteristic energy which corresponds to a specific colour for that ion. This "corona discharge" can sometimes be quite faint and invisible in daylight, but if it is really not there then there can be no discharge happening. The discharge creates a faint hiss, which you can sometimes hear.
There can be secondary effects. Ions may be eroded from one of the electrodes, or chemical reactions may produce substances such as ozone and nitrogen oxides. These can affect the colour mix of the corona discharge, though usually you have to get the conditions just right.
At higher energies the discharge may suddenly avalanche, building up a fat spark. This heats the air causing it to glow incandescently with black body radiation, just the same as anything that gets very hot. The discharge creates a harder and typically louder crackling and/or (if AC) buzzing sound.
