*2.1. Materials*

Aniline (Across) was distilled before use under vacuum. Basic blue 3 dye, FeCl3·6H2O (Sigma-Aldrich, St. Louis, MO, USA), FeSO4·7H2O (Merck, Kenilworth, NJ, USA), Na2SO4 (Panreac Quimica SA, Barcelona, Spain), and Dodecyl benzene sulphonic acid, DBSA, (Across) were used as received. All chemicals used were of analytical grade.

### *2.2. Synthesis of PANI*

PANI was synthesized via chemical oxidation method by adding 0.3 mol (0.82 mL) aniline in 30 mL double distilled water. Then, 0.02 mol (0.25 mL) Do-decylbenzene sulphonic acid (DBSA) prepared in 40 mL double distilled water was added as an emulsifying agen<sup>t</sup> as well as a dopant. Afterwards, 0.01 M FeCl3. 6H2O solution (30 mL) was added dropwise to this mixture as an oxidant. The solution was stirred on a magnetic stirrer for about 12 h. Initially, the solution was a milky white color, but after an hour the solution turned light green and then dark green after 3 hours. Finally, the product was extensively washed with acetone and double distilled water till the filtrate became clear and dried in an oven at 60 ◦C for 24 h.

### *2.3. Synthesis of Fe3O4*

Chemical co-precipitation method was used to synthesize Fe3O4 by mixing FeCl3·6H2O and FeSO4·7H2O in a molar ratio of 2:0.5. DBSA was used as the emulsifying agent. The reaction was performed in basic medium (pH 10) in the temperature range of 85–90 ◦C. Then, 5 M ammonia solution (60 mL) was added as precipitating agent, which turned the reaction mixture black. The mixture was continuously stirred for about 2 h. Then, it was washed with plenty of distilled water and ethanol until the filtrate became clear. The resulting black precipitate was dried in an oven at 80 ◦C for 10 h and finally annealed in a furnace at 600 ◦C for 5 h [49]. The schematic representation of the process is presented in Scheme 1.

**Scheme 1.** Synthesis of Fe3O4.

### *2.4. Synthesis of PANI*/*Fe3O4 Composites*

Chemical oxidation method was used to synthesize PANI/Fe3O4 composites. First, 0.2 g Fe3O4 was mixed with 1.818 mL of aniline suspended in double distilled water (50 mL) and DBSA (0.5 mL). The mixture was stirred for about 30 min and followed by addition of 0.15 M FeCl3·6H2O prepared in 40 mL double distilled water as oxidizing agent. Initially the reaction mixture was milky white due to DBSA but turned reddish brown after addition of Fe3O4 particles. When oxidant was added a light green color appeared within 20 min, which changed into dark black after about 2 h. After 8 h continuous stirring, the synthesized product was washed with acetone and plenty of double distilled water. Finally, the clean precipitate was dried in an oven at 60 ◦C for 24 h. The schematic representation of the process in provided in Scheme 2.

**Scheme 2.** Synthesis of PANI/Fe3O4 Composite.

### 2.4.1. Batch Adsorption Study for Removal of BB3 Dye

Basic blue 3 dye solution of desired concentrations ranging 0.01–110 (mg/L) were prepared in 20 mL volume by dilution method from the respective stock solution. To these solutions, Fe3O4 was added and shacked in a shaker at a speed of 150 rpm for 90 min. These solutions were then filtered and the concentration of dye was determined using a carry-50 UV-Visible spectrophotometer. The amount of dye adsorbed was determined by using the following equation [50].

$$\mathbf{q}\_{\mathbf{e}} = \frac{(\mathbf{C}\_{\mathrm{i}} - \mathbf{C}\_{\mathrm{e}})}{\mathbf{m}} \times \mathbf{V} \tag{1}$$

where qe (mg/g) is the amount of dye adsorbed at equilibrium, Ci and Ce are the initial concentration and the concentration of dye present at equilibrium, respectively, m (g) is the amount of adsorbent added, and V (L) is the volume of solution. The effects of contact time, pH, initial concentration of dye, temperature, and ionic strength on the adsorption process were studied. The data obtained were used to calculate the kinetics and thermodynamic parameters. The same procedure was adopted for studying adsorption of Basic blue 3 dye on PANI and PANI/Fe3O4 composites.

After adsorption of BB3 dye on PANI/Fe3O4 composite, it was collected in filter paper with plenty of double distilled water to run out the adsorbed dye. After removal of BB3, the PANI/Fe3O4 composite

was washed with 0.1 M HCl, to remove the remaining dye from the surface. In this way composites were regenerated and could be reused
