Re: PWM and LED
Limit the current with a resistor, as you would do normally. R=Umax/Imax. I would not use 20mA, though. Something lower, just to be safe.
Now, the light intensity is proportional with the AVERAGE current through the LED. So you just need to turn on the LED with a duty cycle that will give you a moderate average current through the LED. Iave=Ipk*DC
But, as you can see, this method does not save any energy, since the average power is still the same, for the same intesity. You draw current less often, but higher current.
If you need to save pwer, this has to be done with a proper switching regulator, using an inductor (which dissipates little power).
Therefore, if the goal is to save energy while using a simple circuit, I would recommend you limit the current to a low current, that makes the LED bright enough.
Then have the LED flash. That way, the average current actually drops and you save power.
For example, let's assume you have an LED that needs 5mA to be as bright as you want it to be. If you go with the first method, you need a duty-cycle of 25%, limiting the max current to 20mA. You get an average of 5mA, but drawn continuously. There is no power saving. You could just limit the current to 5mA with a resistor and not need the PWM, saving money, space
Now, limit the current normally, with a resistor, to 5mA, but turn on the LED for 0.25 sec once a second second. Then your average current is 5mA*0.25/1=1.25mA. Now you save power.
They key is to have the LED on long enough for it to produce enough brightness at the low curent. Then just make it flash, to draw attention or indicate something.