You need to limit the current going through the led, so it won't burn out.
The easiest way to do that is to add a resistor in series with the led, to limit the current.
You have the classic formula Ohm's law : Voltage = Current x Resistance
From this formula you can derive the formula you need to calculate the resistor value:
Voltage power supply - (number of leds x Forward voltage of a single led) = Current x Resistance.
The forward voltage of a led is the minimum voltage the led needs to light up, and it's usually specified in the datasheet.
The value varies depending on the chemistry of the led, but typical values are 1.7v..2v for red leds, 2.2v for green and other colors, 3v for blue or white leds.
So let's say you want to use a red led with an average forward voltage of 2v, and you want to limit the current to 5mA (0.005A) because after all it's a stand-by led, not a laser pointer.
Your linear regulator outputs 5v so you can put the numbers in the formula:
5v (power supply voltage) - 1 led x 2v (forward voltage of led) = 0.005 (current in A) x Resistance
So Resistance = (5v - 2v ) / 0.005 = 3/0.005 = 600 ohm
600 ohm is not a value in the
E series so it would be hard to find, though you could produce it by chaining 6 100 resistors.
However, you can see that 560 and 680 would be in the E12 series, and 620 is in the E24 series, so all three values would be super easy to obtain. 560 ohm would give you slightly more current than 5mA, while 620 would give you a bit less current than 5mA.
Now as for actual schematic, first of all you would need to use a transformer to convert the high voltage to some lower voltage, because linear regulators like 7805 can not be powered with 230v.
Transformers also provide isolation, which makes things safe for you.
Linear regulators work by taking in some higher voltage (for example 9v DC) and they output the desired lower voltage (ex 5v) and they throw out the difference in the form of heat on the chip.
By design, linear regulators also need to have the minimum voltage higher than output voltage by some amount, which is listed in datasheets as "Dropout voltage". In the case of 7805, this dropout voltage is around 1.5v - 2v.
So, you need to have a minimum input voltage of 7v, but let's go with 7.5v.
IF you take a transformer, that will take as input some high AC voltage and will output some lower AC voltage.
The bridge rectifier converts this lower AC voltage into a really wavy DC voltage, which will have peaks equal to sqrt(2) [1.4142] x Vac, minus the losses in the bridge rectifier, which are equal to 2 x Voltage drop on diode inside the rectifier
So for example, a transformer that outputs 12v AC will have peaks of DC voltage after rectification equal to around 1.4142 x 12 - 2 x 0.8v = 15v
But remember, this is a wavy DC output, that 100-120 times a second peaks to 15v, but lots of times it's well below 5v... and you want to always have a minimum of 7.5v, for the linear regulator to work all the time.
To achieve this, you need to add a capacitor on the output of the bridge rectifier, to act like a buffer of energy.
You can approximate how big the capacitor should be with this formula :
Capacitance (in Farads) = Current / [ 2 x Mains AC Frequency x (Vdc peak - Vdc min) ]
So for example, if you want 1A of current and you're in a 230v country where the AC frequency is 50 Hz, and you want minimum 7.5v then with the transformer that outputs a peak of 15v you will have :
Capacitance = 1 A / [ 2 x 50 Hz x (15v - 7.5v) ] = 1 A / 100 x 7.5 = 1 / 750 = 0.001333333 Farads or 1333 uF
So, to be sure I'd have at least 7.5v when the regulator takes up to 1A of current, I'd need at least a 1333 uF ... so I'd probably go with a 1500 uF or a 2200uF capacitor.
With this particular example, a bigger capacitor could be used, but would not make the circuit better. In fact, a bigger capacitor would only keep the minimum voltage higher than 7.5v, and that only makes the linear regulator produce more heat, so it may make the circuit more expensive because you may have to add a bigger heatsink.
Also, when the capacitors are really discharged and you start a power supply, the capacitors absorb energy and fill up really fast, so there's a big pulse of current going through the transformer. This makes it harder to calculate a good fuse value for the transformer, if you decide to add one... because too high of a fuse makes it pointless and if the fuse is too low, the fuse may be tripped when the capacitor sucks that energy right at the start.
