Circuit diagram Switching power supply :
The circuit in the diagram provides an output voltage of 5 V and is supplied by a 24 V source. The regulator need not be disabled until the capacitor is fully charged: when the potential across the capacitor has reached a level of half or more of the input voltage, all is well. This is why the zener diode in the diagram is rated at 15 V. Many regulators produced by National Semiconductor have an integral on/off switch, and this is used in the present circuit. The input is intended for TTL signals, and usually consists of a transistor whose base is accessible externally. This means that a higher switching voltage may be applied via a series resistor: the value of this in the present circuit is 22 kΩ. When the voltage across the capacitor reaches a level of about 17 V, transistor T1 comes on, whereupon the regulator is enabled.
Source: National Semiconductors