A new optical pH sensor based on Polysulfone (PSU) and Polyaniline (PANI) was developed. The transparent and flexible PSU membrane was employed as a support. The electrically conductive and pH-responsive PANI was deposited onto the membrane surface by in situ chemical oxidative polymerization (COP). The absorption spectra of the PANI-coated PSU membranes exhibited sensitivity to pH changes in the range of 4-12, which allowed for designing dual wave length pH optical sensor. The performance and durability of the membranes were assessed by measuring their response starting from high pH and going down to low pH, and vice versa. The effect of synthesis conditions and film thickness were investigated. The effect of the membrane's storage conditions on the reproducibility of the results was also investigated