A recommended approach would be to use an optocoupler followed by a comparator (eg. [LM339][1]), or better, an integrated part such as the Fairchild Semi [FODM8071 **logic gate output** optocoupler][2]. 

**The reason the optocoupler is recommended**: 

There is likely to be a ground potential difference over a 50 meter cable, also the possibility of picking up EMI over the long cable. The optocoupler eliminates any ground loop / potential mismatch concerns, as well as any need to precisely match the sensor's supply voltage to the microcontroller's.

The use of the opto will allow a higher voltage to be used for the sensor circuit, reducing EMI noise sensitivity.

An added benefit of the specific Fairchild part suggested above is its high noise immunity. This will result in a more stable signal acquisition, important given the distances involved.

FODM8071 is a 5-pin leaded SMT part, so using it is essentially like not having to build any additional circuit - you could wire the part and its few support discrete components up deadbug style, if you like, or put them together on a proto-board PCB.


  [1]: http://www.ti.com/lit/ds/symlink/lm239-n.pdf
  [2]: http://www.fairchildsemi.com/ds/FO/FODM8071.pdf