A simple optical pH sensor using the active compound anthocyanin (ACN), derived Ruellia tuberosa L. flower immobilized in a pectin membrane matrix, was been fabricated and employed to monitor the freshness of tilapia fish at room temperature and 4 oC storage. The quantitative pH values were measured based on the UV-Vis spectroscopy absorbance. The optimum pectin weight and ACN concentrations were 0.1% and 0.025 mg/L. The sensor showed good sensitivity at 0.03 M phosphate buffer solution. The sensor's reproducibility was evaluated using 10 replicate sensors where a standard deviation of 0.045 or relative standard deviation of 9.15 was achieved. The sensor displayed an excellent response after 10 minutes of exposure, possessing a response stability for 10 consecutive days. The decrease in pH value of the Tilapia fish from 7.3 to 5 was observed in a 48 hour test, which can be used as the parameter when monitoring fish freshness. Overall, this reported optical pH sensor has a novelty as it could be used to monitor the rigor mortis phase of fish meat, which is useful in food industry.