Polyaniline
Polyaniline (PANI) is a conducting polymer of the semi-flexible rod polymer family. It was discovered in 1934 as anilin black. Polyaniline also exists naturally as part of a mixed copolymer with polyacetylene and polypyrrole in some melanins.

# Oxidation states
Polymerized from the aniline monomer, polyaniline can be found in one of five distinct oxidation states :
- leucoemeraldine
- protoemeralsine
- emeraldine
- nigraniline
- pernigraniline
In figure 1 x equals half the degree of polymerization (DP). Leucoemeraldine with n = 1, m = 0 is the fully reduced state. Pernigraniline is the fully oxidized state (n = 0, m = 1) with imine links instead of amine links. The emeraldine (n = m = 0.5) form of polyaniline, often referred to as emeraldine base (EB), is either neutral or only partially reduced or oxidized. Emeraldine base is regarded as the most useful form of polyaniline due to its high stability at room temperature, compared to the easily oxidized leucoemeraldine and the easily degraded pernigraniline. Additionally, the emeraldine base polyaniline can function as a semiconductor when doped by a protic acid.

# Synthesis
A tried and tested method for the synthesis of polyaniline is by oxidative polymerization with ammonium peroxydisulfate as an oxidant. The components are both dissolved in 1 M hydrochloric acid and slowly (the reaction is very exothermic) added to each other. The polymer precipitates as small particles and the reaction product is a dispersion. 
The electrochemical method was discovered in 1862 as a test for the determination of small quantities of aniline.
A two stage model for the formation of emeraldine base is proposed. In the first stage of the reaction the pernigraniline PS salt oxidation state is formed. In the second stage pernigraniline is reduced to the emeraldine salt as aniline monomer gets oxidized to the radical cation. In the third stage this radical cation couples with ES salt. This process can be followed by light scattering analysis which allows the determination of the absolute molar mass. According to one study  in the first step a DP of 265 is reached with the DP of the final polymer at 319. 19% of the final polymer is made up of in situ form aniline radical cation.

# Properties
Polyaniline exists as bulk films or as dispersions. A recurring problem with these dispersions is particle aggregation which limits possible applications. A 2006 study  proposes a strategy to prevent aggregation based on a model for nucleation and aggregate formation.
The model identifies two nucleation modes for particle formation,  one by so-called homogeneous nucleation forming long elongated nanofibers and very stable dispersions that can last for months. The other nucleation mode is by heterogeneous nucleation taking place on any alien body available in the reactor such as the surface of the reactor wall forming not elongated fiber but granular coral-like material. With polyaniline, formation by secondary nucleation also takes place on the nanofibers itself. In the study, heterogeneous nucleation is predominant when the reaction medium is stirred or when the reaction temperature is lowered. With both reaction conditions SEM imagery display nanofibers covered in a layer of coral like granules. The granules act as contact points for a nanoscale glue to link the particles together, causing aggregation. The explanation offered for the suppression of homogeneous nucleation is that this requires a local concentration gradient prior to the onset of nucleation which is destroyed by stirring or by low temperature.
An important property of polyaniline is its electric conductivity, which makes is suitable, e.g., for manufacture of electrically conducting yarns.