Help with idea for an optical pH sensor I am experimenting at home with the idea of making an optical pH sensor that can read the colour of pH indicator using photodiodes.
I am wondering if there is some kind of ion permeable membrane that could be used to contain the indicator solution, so it can 'read' the pH of the solution being tested, without mixing with it.
I would like something that is fairly easily obtainable to me as a home experimenter.
The sensor could possibly be used make an automated pH corrector for my local aquaponics farm.
I looked into commercially available pH sensors. The glass bulb type and ISFET type suffer from drift and need regular calibration. There are optical types available, but they are too expensive for me.
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.