Weak acids, #HA#, dissociate according to the following equilibrium:
#HA(aq) + H_2O(l) rightleftharpoonsH_3O^+ + A^-#
By definition, #K_a=([H_3O^+][A^-])/([HA])#
We can take #-log_10# of both sides, to give............
#pH=pK_a + log_10([[A^-]]/[[HA]])#
Several glass electrodes are available that are calibrated to read #pH#. Both weak acids and weak bases can have their dissociation constants measured by these means. Of course, given the equation, the #pK_a# of the acid, is the #pH# at the point of half-equivalence. Why?