I have a float switch that has three possible positions- open when above the water level, closed when below the water level, and rapidly opening and closing (freq~=0.1s) when its near the water level. I need to be able to distinguish bouncing around from the other two while only sampling the voltage across the switch every 1-2 seconds. I thought I could use an RC circuit to do this but my electronics background is fairly weak. I put together the following diagram:
I think this circuit has a time constant of 1s which should roughly give me the average switch value over the last 1 second or so. I think the current should be 1mA, which I think is appropriate for reading on an Arduino. Should this work? Is it a good way of solving this problem?