Driving a step motor to control float switch

It is a simply white plastic donut ring that slides up and down a little column with a sensor inside to register 'on' or 'off' when it reaches the top or slides down to the bottom.