There is a LED & a photo transistor behind that plastic dome If there is no against the plastic dome, then the complete ray of light of LED is reflected back to the photo transistor. If liquid moistens the plastic domes, then the refractive index changes & less light reaches the transistor. One obtains a digital output signal (High at air) at output