The growing need for sustainable and affordable technologies for wastewater treatment has driven the development of biosorbents derived from agricultural residues. This work investigates the optimization of alkaline chemical activation applied to two widespread biomasses—spent coffee grounds (SCG) and date pits (DP)—to enhance their capacity to remove methylene blue (MB) from aqueous solutions. Using a two-level full factorial design, the impact of NaOH concentration, activation time, and activation temperature on sorbent performance was assessed.
Among the tested materials, SCG demonstrated a strong response to chemical activation, whereas DP presented limited improvement. The optimal operating conditions for SCG (0.2 M NaOH, 5.5 h activation, and 22 °C) yielded the highest adsorption capacity (140.23 mg g⁻¹), confirming the key role of activation time and temperature in shaping surface reactivity. Textural and spectroscopic analyses (BET, SEM, and FTIR) revealed a mesoporous structure (37.44 m² g⁻¹; pore diameter 4.39 nm) and the presence of functional groups (O–H, C=O, and C–O) actively involved in dye uptake. The point of zero charge (pHpzc_\text{pzc}pzc = 5.42) indicated enhanced surface acidity following NaOH treatment.
Adsorption performance was strongly influenced by pH, dosage, and temperature, with higher pH and moderate dosages favoring MB removal. Kinetic modeling identified the pseudo-second-order model as the most suitable (R² = 0.96), supported by intraparticle diffusion analysis indicating multi-step mass transfer. Equilibrium data were best represented by the Sips isotherm (R² = 0.99), predicting a maximum capacity of 145.59 mg g⁻¹. Thermodynamic parameters revealed a spontaneous, exothermic, and entropy-driven process.
Overall, this study demonstrates that statistically optimized alkaline activation significantly enhances the adsorption performance of SCG, validating its potential as an efficient, low-cost biosorbent for treating dye-polluted wastewater, while contributing to the valorization of agro-industrial residues within circular economy frameworks.