CO2 corrosion comprises the majority of material damage, which leads to shutdown in petroleum industries. This phenomenon depends on parameters such as pH and temperature. Monitoring and recording these parameters help industries minimize waste in terms of time and financial resources. The insufficiency of tools for this purpose is noticeable. This study proposed an potentiometric IrO2–pH microelectrode design in conjuction with a Ag/AgCl refrence electrode for real-time corrosion monitoring that can be used in various industries. Electrodeposition approach was used in the fabrication of a pH sensor. Electrochemical experiments were conducted to characterize the IrO2–pH sensor as well as monitor the pH on a metal surface in conjunction with the fabrication of a pH microelectrode-designed system. Results show that the proposed pH sensor design can be used for real-time corrosion monitoring by surface pH measurement.