This article is from the Pyrotechnics FAQ, by Hans Josef Wagemueller email@example.com with numerous contributions by others.
Nitrogen Tri-Iodide is a very unstable compound that decomposes
explosively with the slightest provocation. It is too unstable to have
any practical uses, but is often made for its novelty value. Some books
describe uses for it in practical jokes etc. but in my experience it has
been far too unstable for this to be a feasible idea. Despite its common
name, the explosive compound is actually a complex between nitrogen
tri-iodide and ammonia, NI3.NH3 (nitrogen tri-iodide monoammine).
Solid Iodine (I2)
Ammonia solution (NH4OH) - Use only pure, clear ammonia. Other solutions,
such as supermarket 'cloudy' ammonia, will not
give the desired product.
Place a few fine crystals of iodine in a filter paper. The best way to
make fine iodine crystals is to dissolve the iodine in a small quantity
of hot methanol (care: methanol is toxic and flammable. Heat on a steam
bath away from open flame. Use in a well-ventilated area.), and then pour
the solution into a container of ice-cold water. This will cause
extremely fine iodine crystals to precipitate out. Drain off the liquid
and wash the crystals with cold water. If this method is not possible,
crush the iodine as finely as possible.
Then filter ammonia through the iodine crystals. Use a small amount of
ammonia and refilter it, to reduce wastage. The smaller the pieces of
iodine the better the result, as more iodine will react if it has a
greater surface area. You will be able to recognise the NI3.NH3 by its
black colour, as opposed to the metallic purple of the iodine.
Reaction: 3I + 5NH OH ---> 3NH I + NI .NH + 5H O 2(s) 4 (aq) 4 (aq) 3 3(s) 2 (l)