Paul Nicholas Worsey, professor of mining engineering at the University of Missouri at Rolla, teaches the only course in pyrotechnics for college credit in the U.S. He provides the following answer:
Fireworks, which are also known as pyrotechnics, are basically devices that contain burning compounds. The most common type of display firework is the aerial shell, which is fired from a mortar tube. These fireworks typically have four components: a lift charge, a time-delay fuse, a breaking charge and a light/effect generator. The lift charge is generally black powder, a compound that burns rapidly and propels the shell from its tube. The lift charge also ignites the delay fuse when it fires. The delay fuse is usually a black powder fuse with a delay of a few seconds, and it is designed to ignite the break charge when the shell reaches the appropriate height. The purpose of the break charge, which sits at the center of the lofted shell, is to explode, thereby igniting and scattering the shell's contents. This break charge is generally finer-grained black powder than the lift charge and more highly confined, which causes the shell to explode. The payload of the shell usually comprises small spherical pellets of pyrotechnic composition designed to generate light. These capsules burn from the outside inward, and color changes are obtained by layering different compositions on top of one another.
The metal or metals within the pyrotechnic mixture and the burning temperature dictate the color and intensity of the light. Basically, when certain metals are heated to the right temperature, electrons momentarily jump between so-called electron shells, or energy levels within the atoms. When they fall back to a lower state a photon is emitted, and the wavelength of the photon determines the color. The easiest firework colors to achieve are red (using strontium), green (barium), yellow (sodium) and white (titanium). Blues are more difficult because the temperature of the reaction has to be just right. Sparks, in contrast, are made using slower-burning mixtures, and shapes such as rings, hearts and smiley faces are made by precise placement of the pellets inside the shell.
All pyrotechnic mixtures are made up of a fuel and an oxidizer. Like black powder, the mixture usually comprises a metal nitrate and a carbon-based fuel. When the blend ignites it turns from a solid into what is predominantly gases. The reaction also gives out a lot of heat--usually in excess of 2,000 degrees Celsius for brilliant colors. A number of factors determine the speed of a firework reaction. These include the composition of the shell and other physical characteristics, such as the grain size (smaller means faster), the presence of accelerators (sulphur and sugars, for example) or retarders (salt, for instance), high pressure or confinement (which increases the reaction rate), packing density (which reduces the reaction rate) and moisture content.
Answer originally published December 1, 2003.