A medical fluid machine includes: an enclosure at least one medical fluid delivery component located inside the enclosure, the component capable of being powered by an external power source or a back-up battery a transistor in electrical communication with the battery and a regulator configured to: (i) receive as feedback a supply voltage and (ii) vary a gate voltage at the transistor to maintain the supply voltage at least substantially at a desired level.