I apologize. I failed to mention the LM339 comparator driving the PIC IO.
It is still a simple solution. I built the one for my water system back in my basic stamp days. Still working.

Again I am sorry for the misleading post.