Be warned, just turning off the motor at a certain point isn't enough! What you'll find is that the mechanical inertia of the motor and wiper blades will result in the system slowing down, but not stopping, all the way past your "switch off" sensor, and then back to "on" again. In most wiper motors, the "STOP" position switch also directly shorts the motor armature, and the resulting braking effect (full motor torque) stops the system rapidly. Modern electronically switched systems use semiconductor switching to achieve the same result, and take a position switch input from a microswitch on the motor gear.