I’ve used a circuit, much the same as Pete’s (with a 1,000 mF cap) but also a 5V voltage regulator. The VR is cheap enough, but it looks like it’s not required. Pro’s & con’s?
Voltage regulator wastes energy (in this case voltage). If the input is 12V, and the output is 5V the regulator needs to burn off the extra 7V. It literally burns it off as heat energy.
As soon as the capacitor starts discharging (when the power from the rails drops off), the voltage starts dropping. The voltage regulator will keep on supplying 5V to the LED circuit for as long as its input voltage is over 5V, plus some some additional voltage that the regulator needs. While this is taking place any voltage (energy) over that is dissipated as heat. White LED will keep glowing down to around 3V (but at reduced brightness).
Anyway, the whole point of this is that the regulator is "stealing" the precious energy stored in the capacitor. Without the regulator, the LED will have the entire energy from the capacitor available to produce light. Yes, the voltage will be constantly ramping down (causing the LED current to also ramp down), but white LEDs are so efficient that you will not notice any significant brightness changes until the voltage gets quite low.
When (due to space constraints) low value caps are used (like 100 µF), there is very little energy there to keep the LED glowing. With larger caps (like 1000 µF) there is more energy available to keep the LED glowing (and for the regulator to dissipate the extra voltage).
To me, using a voltage regulator is unneeded and it is a unnecessary complication.
BTW Dwigth, you used the term mF. That is mili-Farads, which is 1000 times larger than micro-Farads (µF). Becuase the micro character is not present on keyboards, it is accepted to replace it with a plain "u" (as in uF). In the past I have seen some (usually Japanese) schematic diagrams where µF were represented by MF, but I haven't seen that used since the '70s. Proper terminology to me is important because we now do have capacitors which can actually be 1000mF (that is 1 Farad or 1,000,000 µF). Those are the SuperCaps or Gold Caps used in keep-alives for DCC decoders. Back in the '70s, such capacitors didn't exist so electronic techs would not be confused MF instead of µF in schematic diagrams. Well, actually "M" indicates "mega" or 1,000, but again, such large capacitance value would be totally unrealistic.