If the 'switch' is the physical probe then it should be good for 24v I'd have thought. As long as the closed current is limited to the 20mA mentioned before I can't see why it has to limited to 5v. The transistor can be reconfigured to drive the LED from the 24v supply (which is NOT the '24v' connection seen in the drawing by the way. Read post #1 if confused by that)