Closed-loop systems and methods for controlling pH. The system includes a working electrode, a counter electrode, a reference electrode, a first ion-sensitive field-effect transistor (ISFET), a second ISFET, and an electronic controller. The working electrode, the counter electrode, the reference electrode, and a first sensing terminal of the first ISFET are immersible in an active solution. A second sensing terminal of the second ISFET is immersible in a reference solution. The electronic controller is configured to apply a first amount of current or voltage to the working electrode and determine a differential voltage between the first ISFET and the second ISFET. The electronic controller is also configured to set a second amount of current or voltage to reduce a difference between the differential voltage and a target voltage. The electronic controller is further configured to apply the second amount of current or voltage to the working electrode.