Flow diversion with a retractable turbidity sensor