Help with idea for an optical pH sensor
I really like the concept but the problem is to find a membrane that is permeable to water and H3O+ ions but impermeable in respect to the indicator.
I understand you need something as in the picture below.
Dialysis tubing are commonly used to prevent bigger molecules from crossing the membrane, but unfortunately the typical lower limit is for molecules of around 1 KDa so much more than a pH indicator molecule.
 The only option available seems reverse osmosis membranes, for example used in water purification filters. However, the resulted filtered water has an altered pH (ref.1) therefore not suitable.
Finding a membrane that is permeable to water and H3O+ ions but not to small polar molecules (i.e.Phenolphthalein, blue bromothymol, Anthocyanins etc.) is something difficult to achieve especially if you have also the requirement of not altering the pH.
I think that is the reason why we still don't have a pH meter that works as you described.

References:
1)Nir, Oded &amp; Bishop, Noga &amp; Lahav, Ori &amp; Freger, Viatcheslav. (2015). Modeling pH Variation in Reverse Osmosis. Water Research. 87. 328–335. 10.1016/j.watres.2015.09.038.