Consider the dissociation of a weak acid, #HA#:

#HA rightleftharpoons H^+ + A^-#. As we know,

#K_a = {[H^+][A^-]}/[[HA]],#

#and log_10{K_a} = log_10[H^+] + log_10{{[A^-]]/[[HA]]}#;

Equivalently (multiplying each by #-1#,

#-log_10{ K_a} = -log_10[H^+] - log_10{{[A^-]]/[[HA]]}#.

But, by definition, #-log_10{ K_a} = pK_a#, and #-log_10[H^+] = pH#.

Therefore, #pH# = #pK_a# #+# #log_10{{[A^-]]/[[HA]]}#. This is a form of the buffer equation, with which you are going to get very familiar.

Now at half-equivalence, by definition, #[HA] = [A^-]#, and since #log_10 1# = 0, when plugged back into the equation, #pH = pK_a#. So, in order to measure #pK_a# values of weak acids we plot a titration curve with a #pH# meter, and note value at half-equivalence.