Not quite what you wanted but it might help.
I just replaced my mechanical stop on the Z axis with an opto one.
I couldn't source the 2.1 parts (not at the prices I was prepared to pay anyway) so I got an opto interrupter from ebay.
Anyway attached is my circuit which works ok.
The out wire goes to the signal input on the sanguinololu, the +5v goes to the +5v line not the +v on the board.
Also attached is sketchup file of housing, I have since modified the clamp part.