Determining concentration of ions electrochemically