This paper presents the design, simulation, assembly and testing of a force-compensated hydrogel-based pH sensor. In the conventional deflection method, a piezoresistive pressure sensor is used as a chemical-mechanical-electronic transducer to measure the volume change of a pH-sensitive hydrogel. In this compensation method, the pH-sensitive hydrogel keeps its volume constant during the whole measuring process, independent of applied pH value. In order to maintain a balanced state, an additional thermal actuator is integrated into the close-loop sensor system with higher precision and faster dynamic response. Poly (N-isopropylacrylamide) (PNIPAAm) with 5 mol% monomer 3-acrylamido propionic acid (AAmPA) is used as the temperature-sensitive hydrogel, while poly (vinyl alcohol) with poly (acrylic acid) (PAA) serves as the pH-sensitive hydrogel. A thermal simulation is introduced to assess the temperature distribution of the whole microsystem, especially the temperature influence on both hydrogels. Following tests are detailed to verify the working functions of a sensor based on pH-sensitive hydrogel and an actuator based on temperature-sensitive hydrogel. A miniaturized prototype is assembled and investigated in deionized water: the response time amounts to about 25 min, just half of that one of a sensor based on the conventional deflection method. The results confirm the applicability of t he compensation method to the hydrogel-based sensors.