1 Introduction

Conducting polymers are materials that hold both metallic and plastic properties and also have the ability to react through highly reversible oxidization and reduction reactions [1]. Polyaniline is one of the most important conductor polymers and has attracted much attention. The polymers weak processing and weak mechanical properties, low solubility and unabsorbability have led to problems in industrial applications [2]. In the present work, considering the importance of polyaniline and by modifying its properties with composites, additionally, considering the importance of starch in constructing deflectable polymers, it has been decided to construct a nanoscale from carboxymethyl starch by modifying the structure and methylation of the polymer. Due to their nanometer sizes, filler dispersion nanocomposites exhibit considerably improved properties when compared to the pure polymers or their traditional composites. Increased modulus and strength, outstanding barrier properties, improved solvent and heat resistance and decreased flammability are among the characterization techniques. Therefore, by using carboxymethyl starch (SCOOH), increasing polar properties and increasing these natural polymers in the polyaniline matrix, certain effects and results such as modification of thermal properties, solubility and the increase in water absorption in starch without changing or impairing properties of the polymer were observed, including thermal properties and conduction. These nanomaterials are widely employed in optoelectronics, electronics, medicine and photonics [36]. In addition to these interesting properties, the potential technological applications such as an active material in electrooptical devices, modulators and optical switches also can be found [7]. Third-order nonlinearity in conducting materials is extremely important parameter because of its various properties, including multi-photon absorption, free carrier absorption, nonlinear scattering and refraction [8, 9].

Nonlinear optical absorption and refraction of the nanocomposite were investigated in two different solvents using open and closed aperture Z-scan techniques, respectively. The synthesized sample has been characterized for its nanostructures by using an X-ray diffractometer (XRD) and scanning electron microscopy (SEM). Also, the linear optical properties, including UV–Visible absorption, were measured.

2 Experiment

2.1 Synthesis

Carboxymethyl starch was synthesized at 60 °C by a chemical method as described below. For synthesis, the isopropanol–water solution (23 ml), with a volume ratio of (85:15), starch (1 gr) and NaOH (1.2 gr, M = 40) were added in a flask. The mixture was stirred with a magnetic stirrer for 30 min. Then, we gradually added chloroaceticacid (1.5 gr, 25 mmol). The reaction was carried out for 4 h. After completion of the reaction, the solution was allowed to cool down at room temperature and the organic solution was evaporated and neutralized with acetic acid. The solution was kept at 4–6 °C for 10 h, colloidal sediment was filtered, and the solid precipitate was washed with methanol several times and dried in a vacuum.

2.2 NLO measurements

The nanocomposite was dispersed in dimethylformamide (DMF) and N-methylpyrrolidone (NMP) and placed in a quartz cell with a thickness of 4.9 mm. Nonlinear optical absorption and refraction of the nanocomposite were investigated in two different solvents, using open and closed aperture Z-scan techniques, respectively. The nonlinear coefficients of pure solvents were measured, too. We found them several orders of magnitude smaller than the nonlinear coefficients of our sample. So permissible we ignored them.

A continuous wave (CW) Nd–YAG laser with a wavelength of 532 nm and a Gaussian spatial profile was used. The beam propagation direction defines the z-axis. A schematic diagram of the Z-scan experimental setup is shown in Fig. 1, where BS is a beam splitter. A positive lens (f = 10 cm) was used to focus the laser beam. The sample was translated from negative z to a positive z. In the open aperture technique, photodiode 1 measured the intensity-dependant absorption (nonlinear absorption); in the closed aperture technique, photodiode 2 measured the fraction of diffracted intensity [10]. The Rayleigh range of the beam was much greater than the thickness of the sample cuvette (i.e., \(L<Z_{0}\)) [11].

Fig. 1
figure 1

Scheme of the experimental setup of the Z-scan technique

2.3 X-ray diffraction

The XRD pattern studies were performed on the SCOOH nanocomposite. The X-ray powder pattern of this nanocomposite was recorded using an Xpert Philips diffractometer that is shown in Fig. 2. The broad diffraction peaks confirm the nanocrystalline nature of the sample. Particle size of these nanoparticles was calculated by Debye–Scherrer formula \(d=\frac{k{\uplambda }}{\beta \cos {\theta }}\), where k is a constant (k = 0.93) and β is the width of the diffraction peak at half maxima. The average particle size of the nanocomposite was found to be 35 nm, which indicates the formation of well-defined semicrystalline nanostructures.

Fig. 2
figure 2

The X-ray diffraction pattern of modified carboxymethyl starch

2.4 Scanning electron microscopy

The results of the SEM for composite (polyaniline/carboxymethyl starch) in three different ratios (2:1), (1:1) and (1:2) are shown in Fig. 3a–c, respectively. These figures demonstrate the uniform and homogeneous distribution of the polyaniline in the composite and display the nanoscale structure of growing polyaniline in the composite. It can be observed that the SEM images of (1:1) ratio show better morphology compared to other ratios, and these images are in the nanometric scale of polyaniline in the presence of template. However, the (2:1) and (1:2) SEM images are not in this scale anymore. In addition, increasing the ratio of polyaniline to starch leads to reduction in the regularity.

Fig. 3
figure 3

The SEM images of composite (polyaniline/carboxymethyl starch) in three different ratios (2:1), (1:1) and (1:2) are shown in (a), (b) and (c), respectively

2.5 UV–Vis absorption spectra

The solutions of nanocomposite were prepared in dimethylformamide (DMF) and N-methylpyrrolidone (NMP) and placed in 1-cm cuvette. The linear absorption of the sample in two different solvents was recorded by using a UV–Vis spectrometer (PG instruments Ltd-T80). The absorption and transmission spectra of the SCOOH nanocomposite in DMF and NMP solvents are shown in Fig. 4a, b, respectively. The spectrum shows absorption peaks at 310 and 278 nm, and the linear transmittances at λ = 532 nm are 65.5 and 62.1, respectively. The values of linear absorption \(\alpha =\frac{\ln (\frac{1-A}{T})}{l}\) and linear transmittance \(T_{0}=\frac{1-A}{T}\) are listed in Table 3. In this equation, A and T are the absorbance and transmittance of the sample at a given wavelength.

Fig. 4
figure 4

The absorption and transmission spectra of the SCOOH nanocomposite in a DMF and b NMP solvents, respectively

3 Results and discussion

When the sample was placed on the translation stage and its transmittance data were measured, the intensity of the laser beam on the detector varied due to the Kerr lens generated in the nanocomposite by the intense beam. Since the absorption at the CW laser wavelength is high, nonlinearity during Z-scan measurement of refractive index may have thermal origin in addition to the optical Kerr effect. Figure 5a, b illustrates the dependence of the closed aperture Z-scan signal \(\Delta T_{(P{-}V)}\) on \(I_{0}\) at different levels of intensity. According to these figures, there is a pre-focal maximum (peak) followed by a post-focal minimum (valley) in transmittance, indicating negative nonlinearity with a self-defocusing effect. Therefore, in order to estimate the intensity dependence of nonlinear refraction processes for SCOOH at the closed aperture, Eq. (1) was used. Magnitude and the sign of the nonlinear phase shift can be determined from the changes in normalized transmittance \(\Delta T_{(P{-}V)}\) and the position of the peak and valley [1215], given by

$$ \Delta T_{P{-}V}=0.406(1-S)^{0.25}\left| \Delta \varphi \right| $$
(1)

where S is the linear aperture transmittance and can be determined using:

$$ S=1-\exp \left( \frac{-2r^{2}_{\rm a}}{\omega ^{2}_{\rm a}}\right) $$
(2)

where \(r_{\rm a}\) and \(\omega _{\rm a}\) are the aperture radius and the beam radius on the aperture, respectively. The nonlinear refraction coefficient was determined by:

$$ n_{2}=\frac{\Delta \varphi }{k I_{0} L_{\rm eff}} $$
(3)

where \(k=\frac{2\pi }{{\uplambda }}\) (λ is the laser wave length) is the wave vector, \(I_{0}\) is the intensity of the laser beam at the focus, \(L_{\rm eff}=\frac{1-{\rm e}^{-\alpha L}}{\alpha }\) is the sample’s effective length, and α is the linear absorption coefficient. The closed aperture Z-scan profiles of solutions show purely nonlinear refraction components at different laser intensities. By studying the intensity-dependent refraction coefficient of the SCOOH nanocomposite in two discrete DMF and NMP solutions, it was observed that increasing the intensity leads to increase peak–valley transmittance difference. The theoretical fits to the closed aperture experimental data were obtained from the following equation:

$$ T(z)=1-\frac{4\Delta \varphi \left( z/z_{0}\right) }{{\left( 1+\left( z/z_{0}\right) ^{2}\right) } {\left( 9+\left( z/z_{0}\right) ^{2}\right) }} $$
(4)

The difference between this curve and the experimental data is probably due to absorption effect in the system, while the theoretical curve is plotted in perfect conditions.

Fig. 5
figure 5

The closed aperture Z-scan curves of a the nanocomposite-DMF and b NMP solutions at different laser intensities. The solid curves show the theoretical results using Eq. (4) for one of the intensities

Figure 6a, b shows the nonlinear absorption coefficient of the nanocomposite in two different solvents. By analyzing the nonlinear absorption coefficient, it can be concluded that nonlinear absorption in the nanocomposite-DMF and nanocomposite-NMP solutions was confined to irradiances of 1.86 and 2.76 kW/m2, respectively. Also, by enhancing the entry irradiance, nonlinear absorption was converted to saturated absorption. The saturated absorption was observed after powers 16 and 20 mW for nanocomposite-DMF and nanocomposite-NMP solutions, respectively. Therefore, these powers are the saturation threshold. The nonlinear absorption coefficient β(cm/W) was obtained from a best fitting, performed on the experimental and theoretical data of the open aperture measurement. This fit of Eq. (5) to the experimental data is depicted in Fig. 6 The normalized change in transmitted intensity can be calculated using the following equation:

$$ \Delta T(z)\approx \frac{q_{0}}{2\sqrt{2}}\frac{1}{\left( 1+\left( z/z_{0}\right) ^{2}\right) } $$
(5)

where \(\Delta T(z)\) is the normalized transmittance of the sample at Z, and \(Z_{0}=\frac{k\omega ^{2}_{0}}{2}\) is the Rayleigh diffraction length. The values of \(q_{0}\) for Fig. 6a, b are corresponded to 0.531 and 2.799, respectively. Further, \(\omega _{0}\) is the beam waist at the focal point Z = 0, and Z is the sample position. The nonlinear absorption coefficient β can be determined from the following equation [14, 15].

$$ q_{0}=\beta I_{0} L_{{\rm eff}} $$
(6)

Measured values of the nonlinear refractive index of the SCOOH in DMF and NMP are given in Tables 1 and 2, respectively.

Fig. 6
figure 6

The open aperture Z-scan curves of the nanocomposite dissolved in a DMF and b NMP solutions at a peak irradiance of 1.86 and 2.76 kw/m2, respectively. The solid line is the theoretical curve calculated using Eq. (5)

Table 1 Nonlinear refractive index \((n_2) \) values of SCOOH nanocomposite-DMF solution
Table 2 Nonlinear refractive index \((n_2)\) values of SCOOH nanocomposite-NMP solution

The linear and nonlinear absorption coefficients \((\alpha ,\beta )\) of the polyaniline carboxymethyl starch, soluble in different solvents, are given in Table 3.

Table 3 The linear and nonlinear absorption coefficients \((\alpha ,\beta )\) of the polyaniline carboxymethyl starch soluble in different solvents

4 Conclusion

In this paper, the third-order nonlinear optical properties of modified nanocomposite SCOOH were presented. The nanocomposite was solved in two different solvents (DMF and NMP) and investigated by the use of the single-beam closed and open aperture Z-scan techniques, with a continuous wave Nd–YAG laser at 532 nm. The nonlinear absorption coefficient was acquired from a best fitting, performed on the experimental and theoretical data of the open aperture measurement. The obtained values of the nonlinear refraction coefficient were determined to be from the order of \(10^{-6}\,{\rm cm}^{2}/{\rm W}\). The curve follows peak–valley trace, indicating negative nonlinear refractive coefficient due to self-defocusing that is observed for both of the solvents. In recent years, there were various reports on the preparation and applications of the other nanocomposites and conductive polymers such as P3DDT–CdS nanocomposites \((10^{-13}\,{\rm cm}^{2}/{\rm W})\) [16], silver/PVA nanocomposite \((10^{-8}\,{\rm cm}^{2}/{\rm W})\) [17], ZnS/polymer nanocomposite [18], TiO\(_2\)–SiO\(_2\) nanocomposite \((10^{-13}\,{\rm cm}^{2}/{\rm W})\) [19], Ni/NiCo2 and Co/Co3O4 nanocomposites \((10^{-12}{-} 10^{-13}\,{\rm cm}^{2}/{\rm W})\) [20] and ZnS/PMMA nanocomposite [21]. Compared with these nanocomposites, nonlinear coefficients of SCOOH make it a good candidate for applications such as optoelectronics, medicine, photonics and various technological applications, such as an active material in electrooptical devices, modulators and optical switches.