Low pass filter to remove noise from signal
(Things in italics are easy to look up)

The low pass filter is not what you want, you want to compare your voltage to some threshold (e.g. 2.5 V) and decide whether it's high or low. 

A comparator does that.

Your low-pass filter is still a very good idea, because it still removes noise, and especially at the point where the signal crosses the threshold voltage, you don't want it "jumping" around, but go as smooth as possible.

In fact, wouldn't it be nicest if your sensor detect "ON" when the voltage was low before, but then crosses the say, 4 V boundary (in a rising edge), and "OFF" if was high before and then crosses the 1 V boundary (in a falling edge)? That way, the thing is even more immune to toggling around.

We call that kind of mechanism a Schmitt trigger.