1 Introduction

Chitosan is a linear polysaccharide composed of randomly distributed N-acetyl-D-glucosamine and β-linked D-glucosamine. Chitosan is a deacetylated form of chitin (which may be variously deacetylated) and is soluble (sometimes with difficulty) in acidic solutions [1,2,3]. Chitin, which can be extracted from fungi [4], crustaceans [5], and insects [6], can be deacetylated to produce chitosan. This process makes chitin more acid soluble and improves its biological properties, especially its antibacterial activity [7, 8]. The ratio of the two monomer units determines the molecular weight and degree of deacetylation of chitosan, which significantly affects the antibacterial activity of chitosan [7, 9]. However, chitosan’s solubility severely limits its ability to function. Chitosan has three different forms of reactive functional groups: -NH2 at C-2, -OH at C-6, and -OH at C-3. It is frequently used to boost chitosan’s bioactivity and water solubility as well as to combine it with other compounds to broaden its range of applications [10]. The -NH2 group at C-2 distinguishes chitosan from chitin (by less than 50%) in terms of its physical, chemical, and biological activities. The amino group at C-2 and the -OH group at C-6 are the two main chemical alterations that are made to chitosan [2, 11]. The metric determining the molar percentage of monomeric glucosamine units in chitosan is its degree of deacetylation.

Chitosan is a fibrous biopolymer that can reduce the body’s absorption of fat and cholesterol from food [12]. It also helps blood clot when applied to wounds [13]. As a delivery carrier, it has great potential and cannot be compared with other polymers [14]. The Food and Drug Administration (FDA) has approved chitosan as GRAS (generally recognized as safe). Several antimicrobial drugs containing chitosan have been approved by the FDA [10]. Chitosan is partly soluble in water at DD of 70–85% and readily soluble in water at DD of 95–100% but such DD levels are difficult to achieve. Chitosan exhibits an intrinsic antibacterial activity, inhibiting bacteria growth. The rupture of the cell and changes in membrane permeability are brought on by the chitosan chain’s attachment to the negatively charged bacterial cell wall. The next step is binding to DNA, which inhibits DNA replication and results in cell death. Thus, chemical modifications of chitosan such as quaternary ammonium salinization, phosphorylation, sulfonation, and carboxylation can significantly alter its antibacterial capabilities [10].

Adsorption was found to be a very effective and cheap method among all available wastewater treatment methods. Due to the high concentration of –OH and NH2- groups in the polymer skeleton of chitosan and its derivatives, they are environmentally friendly polymers for the adsorption of drugs, dyes, and heavy metals [15]. In this study, chitosan was extracted from three different local sources: Blaps lethifera (CSB), Pimelia fernandezlopezi (CSP), Musca domestica (CSM), and the ash content (AC), moisture content (MC), fat binding capacity (FBC), and water binding capacity (WBC) of the produced chitosan were determined. The effect of DD of chitosan on antibacterial activity and elimination of azo dyes from wastewater was investigated. The factors of operation and medium, including chitosan source, contact time, dye concentration, and pH, were also investigated. The most critical change is that wastewater containing AZO dyes is extremely difficult to treat because the AZO dyes are refractory molecules that are stable to oxidants and resistant to aerobic digestion. Treating wastewater containing low concentrations of AZO dye molecules is another challenge.

2 Materials and methods

2.1 Materials

Acetic acid (CH3COOH; 98%), sodium hydroxide (NaOH,97%), hydrochloric acid (HCl, 99%), hydrogen peroxide (H2O2, 98%), dimethyl sulfoxide (DMSO, 99%), and methylene blue (C16H18ClN3S, 82%) were purchased from Biochem Chemophara. A Bioscan Industrie Algeria provided the Mueller–Hinton agar. Insects (Blaps lethifera, Pimelia fernandezlopezi, Musca domestica) were employed as a variety of local resources to extract chitosan. The insects used in this study are widely distributed worldwide and in Algeria and were not endangered or protected species in the field study. The specimens (insects) were acquired in a dead and dry state, and no special permit was required for access to the site.

2.2 Extraction of chitosan

Chitosan was obtained from different insects (Blaps lethifera, Pimelia fernandezlopezi, Musca domestica) and prepared according to the method of Kaya [16], as shown in Fig. 1, with a slight modification. Briefly, 1 M HCl was applied with 30 g of each insect powder for 1 h at 40 °C. After demineralization, deproteinization steps were performed for 2 h of 1 M NaOH at 80 °C and then washed with water until neutral, and decolorization was performed by treating the obtained polymer with 10 v/v % H2O2 for 30 at 50 °C. The obtained chitin was then subjected to deacetylation with 50 w/v% NaOH, which was repeated to achieve a higher DD in the chitosan. The resulting chitosan was then dried for 24 h in a vacuum oven at 50 °C.

Fig. 1
figure 1

Schematic presentation showing extraction steps of chitosan from various insects

2.3 Physicochemical characterization

After drying, the chitosan was weighed and its water yield was calculated according to the following procedure: Yield (%) = (weight of chitosan dried, g)/(weight of insect, g) × 100. By using FTIR spectroscopy, the DD of chitosan was calculated using the following formula:\(\mathrm{DD}\left(\mathrm{\%}\right)=100-\left[100\times \left({\mathrm{A}}_{1655}/{\mathrm{A}}_{3450}\right)/1.33\right]\), where: A1655 and A3450 cm−1 are, respectively, the absolute heights of the amide and hydroxyl groups’ absorption bands. where the ratio A1655/A3450 for fully N-acetylated chitosan is indicated by the factor of 1.33 [17]. The following equation was used to calculate the chitosan ash (AC) according to a technique described by R.H. Rdde et al. [18]: Ash (%) = (W1/ W2) × 100, where W1 and W2 are the weight of the sample and residue, respectively. Determined was the moisture content (MC) by vacuum-drying the prepared chitosan for 24 h at 110 °C. Moisture content (MC,%) = (W1-W2/ W1) × 100, W1 and W2 are where the weights of the chitosan samples before and after drying, respectively [19]. The extracted chitosan samples’ fat binding capacity (FBC) and water binding capacity (WBC) were measured using a modified method of Wang and Kinsella [19] approach. WBC% = (water bound, g)/(weight of sample, g) × 100 and FBC (%) = (fat bound, g)/(weight of the sample, g) × 100 were used to compute the WBC and FBC [19]. The absorption spectra were recorded using ultraviolet–visible spectroscopy (UV–Vis, UV-2450 Shimadzu) after 0.1 mg of chitosan was dissolved in 2 mL of acetic acid. The crystal structure of chitosan was examined using an X-ray diffractometer (XRD, Rigaku D/Max-2000, Tokyo, Japan) and a Fourier transform infrared spectrophotometer (FTIR, Perkin-Elmer 1725 ×). The morphology of the various chitosan samples was examined using a scanning electron microscope (SEM, Leo Supra 55-Zeiss Inc., Germany).

2.4 Antibacterial bioassay

The agar well diffusion technique was used to investigate the antibacterial activity of chitosan against a variety of bacterial species, i.e., Listeria innocua (CLIP74915), Bacillus subtiliis (ATCC6633), Staphylococcus Aureus (ATCC6538), Salmonella typhimuruim (ATCC14028), and Pseudomonas aeruginosa (ATCC9027). Wells with a diameter of 6 mm were made in each of the agar plates used with a sterile stainless steel cork borer. The culture plates were prepared and sprayed with 100 L of a 24 h matured broth culture of bacterial strains. Chitosan was used to test antibacterial activity at different concentrations (1 w/v%, 4 w/v%, and 8 w/v% in acetic acid). The samples’ antibacterial efficacy was assessed using ciprofloxacin (CIP-5) as a reference. The plates were titrated with 5 µL chitosan solution. The plates were titrated with 5 µL chitosan solution. Figure 6 shows the inhibitory zones after the plates were incubated at 37 °C for 24 h.

2.5 Dye removal experiment

To evaluate the absorption capacity of chitosan, the dye MB (methylene blue) was used as a model pollutant [18]. In an experiment, the MB dye (13 ppm) was stirred with the appropriate amount of chitosan (400 mg) for 2 h to achieve maximum absorption of MB. Then a UV–Vis spectrometer is used to monitor the evolution of the reaction at different time points. Under UV illumination, the experiment of a complete reduction reaction was carried out. It is easy to see that the intense blue hue of the reaction mixture gradually fades and eventually becomes colorless. The centrifugal solution and removal of chitosan were used to cut off absorption. Using a UV–Vis spectrometer, the absorbance was evaluated for MB dye at 663 nm, which is an indication of the removal efficiency of MB. The difference between the MB dye concentration in the aqueous solution before and after absorption was used to quantify the adsorbed (qe):

$${\mathrm{q}}_{\mathrm{e}}=\frac{\left({\mathrm{C}}_{0}-{\mathrm{C}}_{\mathrm{e}}\right)\mathrm{V}}{\mathrm{m}}$$

where qe is the equilibrium concentration of the dye on the adsorbent (mg.g−1); C0 and Ce are the initial and equilibrium concentrations of the dye solutions, respectively (mg.L−1); V is the volume of the dye solution (L), and m is the weight of the chitosan (g). Dye removal efficiency (%) was obtained using Eq:

$$Removal\;efficiency\;\left(\%\right)=\frac{\left(C_0-C_e\right)}{C_0}\times100$$

where Ce is the immediate concentration and C0 is the initial concentration of MB.

3 Results and discussion

3.1 Characteristics of chitosan

Table 1 displays the findings of the present study, which demonstrated that the dry weights of chitosan isolated from insects (CSB, CSP, and CSM) were 50.0%, 41.6%, and 57.9%, respectively. The difference in chitosan yield was due to the chitosan source and the process of removing proteins and impurities during the deacetylation and precipitation process. The WBC value was 515.1% for CSB followed by CSP-chitosan (287.0%) and CSM-chitosan (301.1%). The range of WBC found in CSP-chitosan and CSM-chitosan was slightly lower than that reported by Chu et al. [19] (458–805%), but the value of CSB-chitosan was in agreement with that found. The FBC of the CSB-chitosan was 296.7%, followed by CSP-chitosan with 433.5% and CSM-chitosan with 455.1%. The range of FBC-chitosan in this study (363.3 to 516.9%) was slightly similar to the value reported by Cho et al. and the value observed by Li et al. from 217 to 403% [20]. Ash is the inorganic residue left when chitosan is completely decomposed by heating in the presence of air. The ash content of chitosan is a key indicator of the effectiveness of calcium carbonate removal and the demineralization stage. High-quality chitosan should have an ash content of less than 1% [21]. As indicated in Table 1. The chitosan obtained from CSM had the greatest ash concentration (8.2%), followed by CSP-chitosan (2%) and CSB-chitosan (1.5%), indicating that the chitosan obtained from CSB has the highest quality. Chitosan isolated from CSP (MC) had a moisture content of 17.2%, followed by CSB (14.3%) and CSM (7.8%).

Table 1 Characteristics of various sources of chitosan extracts

3.2 UV–Vis spectroscopy analysis

The UV–Vis spectra of chitosan extracted from different insects are shown in Fig. 2. The UV–Vis spectra of CSB-chitosan, CSP-chitosan, and CSM-chitosan each show distinctive absorption bands at 338 nm, 261 nm, and 346 nm, respectively. The absorption spectrum of UV–Vis is similar to the absorption maximum at 300–370 nm reported in previous publications for chitosan [22,23,24]. The band at 300–360 nm gives the absorption related to the direct electronic π-d orbitals and is called the Soret band [23, 25]. The sharp UV bands shown for chitosan in the UV range prove strong’s absorption and their potential applications in Wastewater treatment and nanoparticle production [26, 27].

Fig. 2
figure 2

UV–Vis spectra of the chitosan from insects (CSB, CSP, CSM)

3.3 FTIR spectroscopy analysis

Figure 3 compares the functional groups and displays the FTIR spectra profiles of isolated chitosan from various sources. Analysis of these spectra shows a broader band at 3100–3500 cm−1 related to the stretching vibrations of free -NH2 groups and water molecules with the—OH and -NH atoms, respectively. The C-H stretching was responsible for the absorption peak at about 2850–2950 cm−1. Due to the elimination of the acetyl group, the band at 1623 cm−1 was an amide I formed by interactions between hydrogen and hydroxyl groups (deacetylated chitin). FTIR analysis was used to determine the chitosan’s DD, The value of the DD depends on several factors such as the source of the sample, the method of preparing the sample, the type of devices used in the analysis, and the method and technique of analysis. The relative DD % for CSB, CSP, and CSM are 87.1%, 88.1%, and 84.2%, respectively (Table 1).

Fig. 3
figure 3

FTIR spectra of the chitosan from insects: a wavenumber between 4000 and 2000 cm−1 and b wavenumber between 2000 and 400 cm.−1

3.4 Crystallinity and crystalline structure

The crystalline structure of chitosan depends strongly on its deacetylation process as well as on its amorphous chitin form. The XRD pattern of CSB-chitosan shows two diffraction peaks occurring at (10.7 and 19.9°), and at 11.5° and 20.4° in CSP. For CSM-chitosan, two peaks at 10.5 and 20.2° are shown in Fig. 4. The following equation is used to calculate the chitosan crystallinity index (CrI) [28]:

Fig. 4
figure 4

XRD diffraction pattern of the chitosan from insects

$$\mathrm{CrI}=\left({\mathrm{I}}_{110}-{\mathrm{I}}_{\mathrm{am}}\right)/{\mathrm{I}}_{110}$$

Iam is the greatest intensity in the corresponding amorphous area at 2 θ ≈ 11°, while I110 is the maximum intensity at 2 θ≈20°. The crystallinity index values of chitosan obtained from the CSB, CSP, and CSM were 84%, 73%, and 81% respectively, Whereas in other studies, the CrI value of chitosan isolated from other insects, including beetles, cuttlefish, shrimp, and silkworms (B. mori), ranged from 36 to 95% [28,29,30].

3.5 Electron microscopy for scanning (SEM)

The chitosan produced from Blaps lethifera, Pimelia fernandezlopezi, and Musca domestica was selected for examination by SEM (Fig. 5), SEM images of CSB-chitosan showed that the surface has become a smooth polymer, (Fig. 5a) [31, 32], and it is observed by a fibrous structure with a rough surface of the structure of CSP-chitosan (Fig. 5b), and a similar observation was reported by Zainab. et al. [33]. The extracted CSM-chitosan was observed to have lumps on the surface polymer, as in the study of Mohammed et al. [34].

Fig. 5
figure 5

SEM analysis of the chitosan: a CSB-chitosan, b CSP-chitosan, c CSM-chitosan

3.6 Antibacterial activities

Bacterial cell membranes are negatively charged due to the presence of highly electronegative groups on their constituent lipopolysaccharides and phospholipids. Chitosan can adhere to the surfaces of negatively charged cells and decreases the permeability of the cell membrane; as a result, leading to cell death. Type of bacteria, growth stage, chitosan Mwt, chitosan concentration, medium temperature, and pH are the main factors that influence the antibacteiral activity of chitosan [35]. Figure 6 shows that the extracted chitosans exhibit strong antibacterial activity against gram-negative bacteria (Salmonella typhimurium and Pseudomonas aeruginosa) and gram-positive bacteria (Bacillus subtiliis, Staphylococcus aureus, and Listeria innocua). The results also show that the higher the DD, the greater the positive charge after amino-protonation of chitosan, and the stronger its antibacterial activity [36]. This explains why CSP-chitosan (88.2% DD) shows the strongest antibacterial activity, followed by CSB-chitosan (87.1% DD), then CSM-chitosan (84.1% DD). Moreover, the antibacterial activity of chitosan increases with increasing chitosan concentration from 0 to 8% [37].

Fig. 6
figure 6

Antibacterial activity of a CSB-chitosan, b CSP-chitosan, c CSM-chitosan at various concentrations against different bacteria

One proposed mechanism for the bactericidal effect of chitosan is its direct blocking ability, which prevents nutrients and oxygen from entering the intracellular space. This mechanism is suitable for higher molecular weight chitosan, which forms a polymer membrane on the surface of the bacterial cell [30]. However, due to the different composition of gram-positive and gram-negative cell walls, the interaction of chitosan with these two types of bacteria is different. Some studies reported that the bactericidal effect of chitosan is stronger in gram-negative bacteria than in gram-positive bacteria, due to the higher affinity of amino groups for anionic radicals in the cell wall [38, 39]. In other studies, gram-positive bacteria were thought to be more sensitive to the antimicrobial activity of chitosan, which is due to the gram-negative outer membrane barrier.

Previous studies reported that chitosan showed higher antibacterial activities than chitosan oligomers and significantly inhibited the growth of most bacteria tested, although the inhibitory effects differed with the MW of the chitosan and the bacterium [40]. The influence of Mwt and concentration of chitosan against E. coli was studied by Nan et al. [37], who studied different types of chitosans (Mwt from 5,5104 to 15,5104 KDa) and concentrations (20 to 1000 ppm). The authors reported that at high concentrations (> 200 ppm), chitosan has a direct blocking ability to prevent nutrients and oxygen from reaching the intracellular space. All chitosan samples with Mwt between 5.5 104 and 15.5 104 Da showed this property. This indicates that this mechanism works best with chitosan of higher molecular weight [41]. Low Mwt chitosan has more ability to penetrate the cell membranes and interacts with DNA in a subsequent bactericidal step and prevents the synthesis of mRNA and proteins after it enters the nucleus of bacteria [42].

3.7 Adsorption of methylene blue

The adsorption method is considered the best solution for the removal of industrial dyes from wastewater. The high content of amino functions in chitosan provides new adsorption properties for many metal ions and organic dyes. As shown in Fig. 7, the deacetylated amino groups in chitosan can be protonated, and the polycationic properties of chitosan are expected to contribute to charged interactions with MB, a basic dye. MB molecules can interact with the chitosan functional groups through covalence, electrostatic, and hydrogen bonding. Modification of the chitosan molecule by increasing the degree of acetylation, grafting (insertion of functional groups), or crosslinking reactions with other polymers may result in better adsorption capacity for hazardous pollutants in wastewater and good resistance to extreme media conditions. DD of chitosan is important, as the adsorption capacity of chitosan is high when the value of DD is increased. This can be seen in Fig. 8, where the chitosan- CSP with the highest DD (88.2%) has the highest adsorption capacity (1.7 mg.g−1), compared to 1 mg.g−1 for the CSB chitosan and 0.8 mg.g−1 for the CSM chitosan. Under optimal conditions, the MB removal efficiencies of CSB-chitosan, CSP-chitosan, and CSM-chitosan reached 37%, 87%, and 26%, respectively, within 120 min. Similar results were reported by Dhanasekaran and colleagues [42]. Table 2 shows the AZO dye removal efficiency of chitosan obtained from different sources compared to this work.

Fig. 7
figure 7

Schematic presentation showing the chemical and physical interaction between chitosan and MB dye

Fig. 8
figure 8

Time effect reaction of chitosan on the absorption of MB and removal efficiency (%) of MB dye: a, b CSB-chitosan, c, d CSP-chitosan, and e, f CSM-chitosan

Table 2 AZO dye removal efficiency of chitosan extracted from different sources compared to this work

4 Conclusion

Insects can be considered important resources for chitin and chitosan. Studies show that the chitin content of various insect species is up to 40% of the exoskeleton on a dry basis. In this study, chitosan was extracted from three different sources: Blaps lethifera (CSB), Pimelia fernandezlopezi (CSP), and Musca domestica (CSM). Chitosan yield was greatest in Musca domestica, 57.9% on a dry basis, followed by Blaps Lethifera and Pimelia Fernandezlopezi with yields of 50.0% and 41.6%, respectively. The degree of deacetylation (DD) for chitosan from CSB, CSP, and CSM were 87.1%, 88.2%, and 84.1%, respectively. The chitosan isolated from Blaps Lethifera possessed the highest crystallinity, according to X-ray powder diffraction (XRD). Chitosan extracts showed good antibacterial activity against gram-positive and gram-negative bacteria including Listeria innocua, Bacillus subtiliis, Staphylococcus aureus, Salmonella typhimuruim, and Pseudomonas aeruginosa. Due to the high concentration of –OH and NH2- groups in the polymer skeleton of chitosan, it has shown high adsorption capacity for azo dye (methylene blue, MB). The adsorption capacity values for chitosan were approximately 1 mg·g−1 for Blaps lethifera (CSB-chitosan), 1.7 mg·g−1 for Pimelia fernandezlopezi (CSP-chitosan), and 0.8 mg·g−1 for Musca domestica (CSM-chitosan) at neutral pH = 7, contact time of 120 min, and initial MB dye concentration of 13 ppm. These results indicate that the selected insects can be used for chitosan extraction, saving many tons of insect waste as sustainable resources for environmental and pharmaceutical applications.