We propose a new two-scale model to compute the swelling pressure in colloidal systems with microstructure sensitive to pH changes from an outer bulk fluid in thermodynamic equilibrium with the electrolyte solution in the nanopores. The model is based on establishing the microscopic pore scale governing equations for a biphasic porous medium composed of surface charged macromolecules saturated by the aqueous electrolyte solution containing four monovalent ions . Ion exchange reactions occur at the surface of the particles leading to a pH-dependent surface charge density, giving rise to a nonlinear Neumann condition for the Poisson–Boltzmann problem for the electric double layer potential. The homogenization procedure, based on formal matched asymptotic expansions, is applied to up-scale the pore-scale model to the macroscale. Modified forms of Terzaghi's effective stress principle and mass balance of the solid phase, including a disjoining stress tensor and electrochemical compressibility, are rigorously derived from the upscaling procedure. New constitutive laws are constructed for these quantities incorporating the pH-dependency. The two-scale model is discretized by the finite element method and applied to numerically simulate a free swelling experiment induced by chemical stimulation of the external bulk solution.