Refractive index and resonance angle of PPy–CHI film.The refractive index and the thickness of the gold layer were 0.235+3.31i and 49 nm, respectively.
Conducting polymers are a sub-group of organic and inorganic electrical conductors which can be considered as interdisciplinary science and technology. They are in the intersection of three disciplines: physics, chemistry and engineering. These macromolecular materials are unique combination of electronic and optical properties of metals and semiconductors with the processing advantages and mechanical properties of polymers .
Conducting polymers (CPs) such as polyaniline, polypyrrole and polythiophen have received great attention to the chemists and physicists during the last decade due to their potential applications in different fields such as mechanical and optical sensors, actuators, light-emitting diodes (LED), transistors, energy storage, supercapacitors. [2-5]. Conducting sensors based on PPy film with different dopant were developed for detecting volatile aromatic hydrocarbons  and volatile organic solvent sensors have been fabricated using PPy films on conducting glass substrates .
Different techniques including electrochemical quartz crystal microbalance , Fourier transform infrared spectroscopy (FTIR) , photoacoustic effect , and electromagnetic interference shielding effectiveness (EMI SE) [10-11] have been used to study the optical and electrical properties of conducting polymers. Surface plasmon resonance (SPR) is one of these methods that provided considerable information about electropolymerization, doping and dedoping processes .
Surface plasmon resonance (SPR) is a quantum optical-electrical phenomenon arising from the interaction of light with a metal surface. Surface plasmons are surface electromagnetic waves that propagate in a direction parallel to the metal/dielectric (or metal/vacuum) interface. The waves are on the boundary of the metal and the external medium (air or water for example); thereby these oscillations are very sensitive to any change of this boundary, such as the adsorption of molecules to the metal surface .
2. Basic of surface plasmon resonance
When a polarized light strikes the area between the glass and air, at a certain angle (θ), a total internal reflection (TIR) is generated. In this case the incident light is equal to the reflective light and an electric field intensity, known as evanescent wave is generated. When a metal is placed at the interface between the glass and air, at a specific angle, the plasmon on the metal surface couples with the energy from the light and cause a reduction in the intensity of the reflected light, achieve the resonance at the given wavelength and angle, where SPR is occurring. Any changes in the chemical composition of the environmental within the metal surface of the plasmon field cause a shift in the angle of the reflected light. Thus the magnitude of this change can be determined by measuring the angle of the reflected light by the metal surface using a sensogram.
SPR is an optical phenomenon related to charge density oscillation at the interface between two materials that their signs of dielectric constant are opposite . The basic of SPR is the propagation of surface plasmon wave (SPW) along the interface of metal and dielectric which behaves like quasii-free electron plasma. The wave number of light should be matched with the wave number of surface plasmon given as:
where, are refractive index of the prism and angle of resonance, while andare the dielectric constants of metal and last medium, respectively . The thickness and dielectric constant of thin films deposited on the gold surface can be measured by this optical technique.
The electrochemical surface plasmon resonance (ESPR) technique is good combination of surface plasmon resonance with electrochemical measurements, which can be used for simultaneous optical characterization and electrochemical polymerization of the electrode–electrolyte interface . In this technique, the real (Δεreal) and imaginary (Δεimaginary) parts of the dielectric constant are parameter of the average thickness of the adsorbed layer, electrode potential modulation (ΔV), as well as changes in the surface charge density (Δδ) as follows [15-16].
where C1, C2, C3 and C4 are constants, Δd is the change of the average thickness of the adsorbed layer, and Δδ represents the effects of the electron density on the surface plasmon resonance angle. Above mentioned formula shows a good combination of surface plasmon resonance with electrochemical measurements, which can be used for simultaneous optical characterization and electrochemical polymerization of the electrode–electrolyte interface .
If the dielectric constant experessed as:
It has been shown that the imaginary part of the dielectric constant can be changed by variation of conductivity of material layer and this relation is monitored as:
where C is the speed of light with wavelength of λ incident on the material with conductivity of σ.
3. Application of SPR in Conducting polymers
In recent years, surface plasmon resonance (SPR) has been widely demonstrated as an effective optical technique for in situ investigation of optical and electrical properties of conducting polymers such as polypyrrole films [5, 15]. Damos and his coworker showed that during electropolymerization and doping/dedoping processes of thin polypyrrole films on flat gold surfaces a significant change in the surface plasmon angle position was produced. These changes in the electrochemical and optical properties of the polypyrrole films were due to the changes in the real and imaginary parts of the complex dielectric constant during doping/dedoping processes .
They prepared PPy films by in situ electropolymerization using potentiostatic, galvanostatic and potential cycling process (potentiodynamic) methods and showed that the shape of the reflectivity curves changed during polymerization process, indicating that the growth processes are also efficient in producing polymer films with high conductivity. In addition, they observed that during polymerization the resonance angle shifted toward higher values which can be related to the changes in the optical properties at the electrode–solution interface when polymer grow at the surface of the metal.
On the other hand, the changes of real and imaginary part of dielectric constant for polypyrrole films polymerized by potentiodynamic method was more identical and reversible compared with those polymerized by potentiostatic or galvanostatic conditions indicating higher ability for the ions exchange of the films prepared by potentiodynamic. It was shown that the real part of the dielectric constant for polypyrrole film shows a small decrease and the imaginary part increased by switching the potential between the reduced and oxidized states of the polypyrrole films. It was rsulted that the changes in the imaginary part of the dielectric constant are associated with changes of the electronic energy states of the polypyrrole according to the polaron/bipolaron model .
During the oxidation and doping process, intermediary energy levels are created between the valance band (VB) and conduction band (CB); causing a decrease in the energy required for the electronic transition. As a result, the polymers with higher conductivity exhibit high values of “εimaginary” which results in a decrease in the real part of the complex dielectric constant. The study on the optical and electrical properties of polypyrrole at different oxidation levels showed that there is a correlation between conductivity and formation of polaron and bipolaron species .
The electrical properties of the PPy-CHI composite films was investigated in our previous work  and it was revealed the enhanced electrical properties of composite films in the presence of a certain amount of CHI. It was observed that the wavelength of electron transition in Uv-vis spectrum increased with the increase in CHI content, indicating a decrease of the band gaps between valance band (VB) and conduction band (CB).
SPR technique was used to detect ochratoxin A (OTA) which is a toxic fungal metabolite and acts as a DNA damaging agent . In this research, Jorn prepared sensing area by in situ electropolymerziation of pyrrole in the presence of chloride dopant. He observed that PPy prepared in the presence higher amount of NaCl presented lower conductivity and so that the SPR angle increased. On the other hand, they believed that adsorption of Cl- on the gold layer affected double-layer charging, resulted in a decrease in SPR angle. The linearity range of 0.1-10 μg/ml (with R2 = 0.9689) was expersed for this ochratoxin A (OTA) sensor.
Guedon et al, , reported a DNA hybridization sensor based on ppy- ODN matrix coupled with SPR imaging. They prepared SPR chip by electrospotting pyrrole and pyrrole linked to an oligonucleotide (ODN). The SPR imaging configuration is closely based on the same configuration with regular SPR, in which the metal surface is imaged on a CCD camera via an imaging lens. This kind of SPR has advantages of sensing on several areas of the gold surface at the same time [21-22]. Electrospotting method is used for the construction of biochips on individually addressable microelectrode arrays. In this work  they optimized hybridization response of the polypyrrole/DNA probes versus spot thickness and density of immobilized probe. The optimal thickness of the spot was found to be close to 11 nm and a surface density of polypyrrole/DNA probes of 130 fmol/ mm2 (590 pg/mm2) was reported to optimize the hybridization signal that can be detected directly.
4. Heavy metals and SPR detection
Heavy metals such as mercury and lead ions have long been recognized as a harmful environmental pollutant. Lower levels of lead can affect on the central nervous system, kidney, and blood cells  and in severe cases can cause convulsions, coma, and even death. Lead interferes with the development of the nervous system and is therefore particularly toxic to children and unborn babies, causing potentially permanent learning and behavior disorders . Overexposure to mercury can damage the central nervous system which can cause memory loss, loss of appetite, personality changes, and lack of coordination, reproductive problems, and possibly death .
There are many techniques for analysis trace metal e.g., atomic absorption, atomic emission, and fluorescence spectrometry , inductively coupled plasma-mass spectrometry, (ICP-MS),  and electrochemical techniques (such as ion-selective potentiometry and anodic stripping voltammetry) . In contrast of their attractive analytical “figures of merit”, each of these techniques suffers of some disadvantages. Applications of all these methods require knowledge of chemistry and instrumentation and need exactitude apparatuses (28-29)
A major disadvantage of ICP-MS is the high capital cost of the instrumentation. In addition, this instrument is bulky and not selective to different charge states of an element. The non linearity of the calibration curves is a disadvantage of the atomic absorption spectroscopy, (AAS), technique (in absorbance range higher than 0.5 to 1). Running and investment costs of inductively coupled plasma atomic emission spectroscopy, (ICP-AES), are high. Another disadvantage of ICP-AES is spectral interferences (many emission lines). Voltammetric methods are simple, inexpensive, and portable but they suffer of interferences inherent in complex sample matrix. Anodic stripping voltammetry can only measure amalgam-forming metal species. Thereby, the complementary methods have developed to overcome some of these shortcomings [29-30].
Surface plasmon resonance (SPR) is an effective optical technique to detect monolayer thicknesses of the material on the conducting surface and has been used to study the optical and electrical properties of conducting polymers such as polypyrrole films. This technique exhibited a good sensitivity, stability, and reproducibility and some times the changes in refractive index of approximately 10−5 can be detected by SPR technique . Usually a thin layer of gold is used as the SPR excitation layer. This technique was used to detect and characterize deposited organic layers and functionalized polymer films on SPReeta sensors, and also in biosensor such as pseudomonas aeruginosa cells . One of the important parameters used for evaluating the quality of biodiesel is copper corrosion and the standard test of copper strip is used for detection this ion. It has been shown  that surface Plasmon resonance based on the self-assembly of squarylium dye containing cystamine can be used as sensing area for determining copper concentration.
In our previous work , we prepared a sensing layer based on a composite of conducting polymer (polypyrrole) and chitosan for the detection of Cu2+. Different corrosion levels classified as class 1a according to the standard copper strip test (CST) could be recognized in the sample using this optical sensor. In this work four types of biodiesel samples were used to detect different levels of corrosion and it was found that the sensor based on polypyyrole-chitosan can measure different levels of corrosion more precisely than the standard CST. In addition, the variation of reflectivity with thickness was studied in this research and it was observed that the reflectivity monotonically increased with increasing thickness of polymer film.
In addition, the refractive index and resonance angle of the composite film were determined by Feresenel theory and the results are presented in table 1. It was found that the real part of the refractive index decreased and the imaginary part increased with increasing thickness, as expected from the Kramers–Kroning relation [36-37].
Yu et al.,  developed a SPReeta sensor for Hg(II) detection using polypyrrole (PPy) and 2-mercaptobenzothiazole (2-MBT). Binding interactions of mercury ion with polypyrrole (PPy) and (2-MBT) was monitored by surface plasmon resonance (SPR) technique. They used 2-MBT as chelating agent to forms complexes with Hg(II) in order to enhance the specificity of Hg2+ determination. The PPy-modified SPReeta surface area was prepared by in situ pyrrole electropolymerization on the gold surface at a constant potential of +0.85V for 100–150 s. A solution of 2-MBT in ethanol/water (1:9 v/v) was employed to serve as a sensitivity enhancement agent for detecting Hg2+ bound on the PPy surface. They reported the detection limit of 0.01 ppm with an increase of SPR angle of 20±10 RU.
angle θR (deg)
5. SPR Detection of Mercury and Lead Ions
5.1. Set up configuration and Formulation
The aim of this research was to fabricate a sensor based on surface plasmon resonance (SPR) using conducting polymer to detect trace amounts of mercury and lead ions. SPR characterisation of the thin films was performed by using a set up assembled according to the Kretschmann’s prism configuration (Figure 1). Data analysis was done by Matlab software using Fresnel formula.The He-Ne laser (with wavelength of 632.8nm) was used as light source and silicon detector (Newport, 818-SL) and Lock-In-Amplifier were used for detection the light. The sensitivity of amplifier was 20 mV and the chopper frequency was 125 Hz.
The values of optical constants were calculated by comparing the experimental SPR data to the theoretical values provided by the Fresnel theory applied to the SPR optical configuration used for our study . The values of the real and imaginary parts of the refractive indexes of PPy and PPy-CHI films were obtained by nonlinear least square fitting using Fresnel equations to the three-layer of SPR system.
In the Fresnel equation for p-polarized light the value of reflection coefficient can be written as:
where Ei and Er are the incident and reflected electrical fields, respectively . At the interfaces between N layers, the reflection coefficient is as follow:
where mij are the matrix layer elements and for single layer with the thickness t, the matrix element is
Where the (the phase shift due to the beam passing through different layer) and τ1 can be written as:
Where λ ε0 μ0 are the wavelength of light used during the measurements, dielectric constants, and permeability. If the refractive index of gold and the sample obey following relation, resonance takes place .
Where θR, np, nm, and nd are the resonance angle, refractive indices of the prism, metal (gold layer) and dielectric medium (sample), respectively and the refractive index of the sample can be determined from:
The angle of incidence at the interface between the prism and the gold layer is obtained from following Equation :
Where A is the angle of the prism, θ1 is the angle of incidence of the light beam directed to the prism, and nair is the refractive index of air.The refractive index and resonance angle of the sample will be found by minimizing the sum 
Where RExp and RTheory are the experimental and theoretical, reflectivity.
In the Fresnel equation the reflectivity is a function of θ (angle of incidence light at the interface between the prism and surface), wavelength of light, refractive index of sample as well as refractive index and thickness of gold layer .
5.2. Pyrrole electropolymerization
A thin layer of gold (49 nm) was deposited onto a glass microscope slide and electrochemical deposition of PPy-CHI and PPy films on the gold substrate were performed potentiostatically imposing a constant potential of 0.85 V (vs SCE) for 150 sec. In order to form a thin film on the gold substrate with a homogeneous surface, electrodeposition should be done at low potential in short time. The sample of PPy-CHI was prepared in a solution containing 0.015 M Pyrrole, 0.005 M P-TS and 0.07% (w/v) chitosan in acetic acid. The results from FT-IR, electrical conductivity, and XRD study confirmed the incorporation of chitosan in PPy structure .
The PPy film was prepared using the same composition of pyrrole and P-TS without chitosan. The surface of the polymer films was washed with distilled deionized water (DDW). The thin slides were attached to the prism with high index glass (ZF52, n=1.85) by using index-matching fluid (n=1.52 new port company). The precision of rotator stage was 0.003. The refractive indexes of PPy and PPy-CHI thin films (in contact with air) by SPR technique were obtained in our previous work . Since they produced a sharp peak of resonance angle, it was shown these polymers are capable for using in sensitive optical sensors.
DDW was run on the surface of the films to establish a baseline. When a stable baseline of SPR angle was obtained, the PPy and PPy-CHI film exhibited a SPR angular profiles that was deep enough for precise definition of the resonance angle. The values of the real and imaginary parts of the refractive indexes of PPy and PPy-CHI films were obtained by nonlinear least square fitting using Fresnel equations to the three-layer of SPR system.
The resonance of the Au-PPy thin film occurred at larger angles compared to the Au, which can be ascribed to a change in the actual refractive index of the gold layer when the PPy film is deposited on it. Figure 2 shows the surface plasmon resonance (SPR) reflectivity curves for the glass/Au/DDW, (Au), and glass/Au/PPy/DDW, (Au-PPy), and glass/Au/PPy-CHI/DDW, (Au-PPy-CHI), systems.
The resonance angle (θspr) and the optical constant for the PPy film were (57.67±0.01)0 and 1.598+0.159i, respectively. SPR angle for the PPy-CHI film appeared in lower value indicating formation of a thin film of polypyrrole with chitosan on the gold surface. The resonance angle (θspr) and the optical constant of the PPy-CHI film were (56.75±0.01)0 and 1.601+0.165i, respectively. The dip widths of the curves for the PPy-CHI and PPy films were larger than Au/DDW, which was proportional to the attenuation of the surface plasmon. The thickness of the thin films was calculated using the Fresnel equation and the values of 26 nm and 28 nm were obtained for the PPy-CHI and PPy thin films, respectively. When a stable baseline of SPR angle was obtained for PPy and PPy-CHI films, the surface of the films were ready for binding tests for Hg2+ and Pb2+ samples.
5.3. Binding of Hg2+ and Pb2+ on to PPy and PPy-CHI films
Different concentrations of Hg2+ and Pb2+ in aqueous solution were injected in to the fluid cell attached to the films, and the SPR angle (resonance units = RU) was monitored to detect any binding interactions. The increase in the SPR angle (ΔRU) for each Hg2+ and Pb2+ concentration was determined based on the resonance angle of the ions (after the ion binding event) and the DDW baselines before running ions samples over a time duration of Δt.
These ΔRU results indicated that Hg2+ and Pb2+ were binding successfully with the PPy and PPy-CHI. Each sample was run for 20 min. The concentrations of ions in the parts per million range produced the changes in the SPR angle minimum in the region of 0.03 to 0.07. Due to the high sensitivity of SPR, it also is possible to detect concentrations in the parts per billion ranges. A control experiment for the Hg2+ and Pb2+ ions with bare Au surface was done for 30 min, which produced no changes in the resonance angle indicating that the polymer was necessary to react with the ions. After exposure to each sample concentration, all of the PPy and PPy-CHI films were washed with DDW to establish a baseline, as the history of the films was irrelevant.
5.4. Sensitive optical sensor for Hg2+ and Pb2+detection
The increase in the SPR angle for each Hg2+ and Pb2+ concentration indicated that these ions were binding successfully with PPy. The typical sensograms for 0.5–12 ppm Hg2+ and Pb2+ binding on PPy are presented in Figure 3 and 4.
It can be observed that, first, ΔRU increased over the time for each sample, but after almost 700 sec the graphs showed a constant value. This result can be explained by saturation of the binding sites available on the PPy surface. It seems that there is a chemical binding of ions in water with the PPy thin film that was immobilized on the gold surface. The interaction between Hg2+ and PPy was also reported by Yu et al. , as the natural preference for a combination of soft acid (Hg2+) and soft base (PPy). On the other hand, there are some studies on the treatment of solutions of metal ions with redox polymers, such as polypyrroles, polyanilines and polythiophenes, to reduce the ions to a lower valence . These literatures show that PPy can interact with certain heavy metals through an acid and base interaction or an oxidation reaction.
5.5. Sensitivity enhancement using CHI
Chitosan was used to prepare the PPy-CHI composite film to function as a sensitivity enhancement agent for detecting for heavy metals ions. DDW was run to establish a baseline. The decreasing SPR angle for the PPy-CHI film when compared to the PPy film indicated that chitosan incorporated inside the PPy structure. The sensograms for 0.5–12 ppm Hg2+ and Pb2+ binding on the PPy- CHI are also presented in Figure 3 and 4. The composite films of PPy- CHI showed the higher ΔRU compared to the PPy film for each time and concentration, indicating a higher sensitivity of the PPy in the presence of chitosan. In fact, the natural biopolymers have adsorption properties toward certain heavy metals. Of the many absorbents identified, chitosan has the highest sorption capacity for several metal ions . The sorption proceeds by electrostatic attraction on protonated amine groups in acidic solutions resulted in an enhancement of the original ΔRU and improvement of sensitivity of sensor.
In order to show the sensitivity of the PPy and PPy-CHI films for metal ions, standard calibration curves were plotted for sensors and are shown in Figure 5 and 6. Different concentrations of ions were run for 20 min and all ΔRU were taken from the first 13 min of each binding curves. Each concentration was repeated 3 times and the standard deviation data were in the region of 0.06 to 0.18 and it is shown as error bar on the diagram of sensitivity. These figures clearly show the enhancement of sensitivity for sample determination in the presence of chitosan. In the both sensograms the SPR dip shift is directly correlated with the ions concentration ([Hg2+] or [Pb2+]). Linear regression analysis of the sensors yielded the following equations with all correlation coefficients R2 greater than 0.97, revealing good linearity for the relationship between the SPR dip shift and ions concentration:
∆θ = 6.50 × 10−1 + 6.41 × 10-2 [Hg2+] (PPy-CHI)
∆θ = 4.97 × 10−1 + 3.69 × 10−2 [Hg2+] (PPy)
∆θ = 6.75 × 10−1 + 6.77 × 10-2 [Pb2+] (PPy-CHI)
∆θ = 5.50 × 10−1 + 4.24 × 10−2 [Pb2+] (PPy)
From standard calibration curve, it can be seen that the sensitivity of PPy-CHI sensor was almost 2 times higher than that for the PPy sensor.
It can be seen that all the standard calibration curves showed a significant deviation from 0. This deviation was due to saturatation of the binding sites available on the polymer surface, a fundamental limitation of maximum uptake capacity .
Application of biopolymers such as chitosan, as an electrical or optical material has rarely been reported. However, using of these materials in electrical devices are now of interest because of the current environmental threat and societal concern. Chitosan as a biodegradable, biocompatible, nontoxic and low-cost polymer was found to improve the electrical and mechanical properties of the PPy film. The changes in the electrochemical and optical properties of the polypyrrole films are due to the changes in the real and imaginary parts of the complex dielectric constant when is combined with chitosan.
Chitosan as natural biopolymers shows a high sorption capacity for several metal ions. Following the interaction of CHI and metal ions to enhance the original ΔRU, lower concentrations of ions could be readily detected with less interference. The aim of this study was to prepare a sensor area based on PPy-CHI composite films for detecting Mercury and Lead ions. The refractive indexes of PPy-CHI were successfully measured by surface plasmon resonance (SPR) technique. This technique was used to fabricate the PPy and PPy-CHI optical sensors for monitoring trace amount of Hg2+ and Pb2+. Specific binding of chitosan with Hg2+ and Pb2+ ions were presented as an increase in resonance angles. Pb2+ ion showed higher value for ΔRU due to stronger biding with polymer and the sensors based on PPy and PPy-CHI were more sensitive to Pb2+ compared to the Hg2+.
The research on the preparation and characterization of conducting polymers is still continuing in order to find conducting polymers with improved electrical and mechanical properties. Since chitosan could improve the electrical and optical properties of the PPy film, further research could be extended to prepare the composite films using other biopolymer such as Nano cellulose with other conducting polymers.