GARTHWILSON on Thu 11 Mar 2021 wrote:
If you have 9V or 12V to bring down to 5V, I would just say the easiest for the beginner is something like a 7805 with adequate heatsinking.
I strongly agree. When I used a 7805, it worked first time. When I moved to LM317, I thought "[Expletive deleted] this! Next time, I'm buying 7805s!" This is a reason why 7805 is found in so many 8 bit computers. It just works. Admittedly, LM317 will be an exercise in frustration if you have a very small choice of resistor values, questionable numeracy and terrible soldering. Regardless, the general principle is true. Every other option will be surprisingly more difficult and tangential when powering 5V digital logic. Any design without 7805 should be regarded as intermediate or advanced and may be an unnecessary complication. If your design benefits from intermediate or advanced circuitry, it can be revised when you have more experience.
Despite such warning, I've devised a power regulation circuit to meet many of the requirements mentioned on the 6502 Forum:-
After previous empirical experiments with LM317 variable voltage regulation (apparently, not an oxymoron), I was able to combine the numerous examples typically found in a datasheet and devise a diode protected, surge protected, 5.0V, 4.6V, 3.3V supply where all power rails come up together. This can be easily adapted or extended to cover other cases; possibly beyond 30V.
LM317 is an odd device which is less encapsulated than the popular 7805 design. Both devices are able to limit current or voltage but not both functions at the same time. LM317 is typically "programmed" with a
potential divider circuit to provide a relative voltage drop. (7805 is effectively a pre-programmed LM317.) In the typical LM317 voltage regulation arrangement, LM317 is not grounded and may be used to provide one or more large voltage drops. To achieve this, 100 microamps traverses the Adjust pin and this current sense is used as negative feedback. Configuration is relative to an internal 1.25V zener diode which, unfortunately, also sets the minimum voltage drop.
Given the very small current sense, it is possible to create a multi-Y arrangement where the bottom half of the potential dividers is shared and the top half allows multiple LM317 devices to work at different ratios. Ordinarily, when voltage is fixed and current is variable, this would not work. However, it works in a restricted range when current is fixed and voltage is variable. The remainder of the circuit concerns PNP 2N2905, 2N2907 or similar with capacitor at base. When the capacitor is empty, this arrangement initially bypasses the common element of the potential dividers and sets each LM317 to the minimum possible voltage. As the capacitor fills, the PNP transistor switches off and the 2.7k resistor is not bypassed. This sets the maximum voltage for each section.
5.0V is configured with 1k resistor. 4.6-5.0V may be set with 1k resistor in series with 100 ohm potentiometer. (Screw type is strongly recommended.) 3.3-3.4V may similarly configured with 1.8k in series with a separate 100 ohm potentiometer. Do not use the 3.3V section heavily because it is a convenience feature with the least efficiency.
For dubious power sources, such as
power jacks and USB, use full bridge rectifier and then Buck, Boost or Buck/Boost to 7V. Well, ideally, you should use fully galvanically isolated, full opto-isolated
Ćuk conversion is saturated mode. However, if you're buying cheap components, you are more likely to find Buck/Boost modules available in packs of 10. Set them to 7V with a screwdriver and check that the output does not exceed 7V when the input is 9V. Such units convert excess voltage at 85% efficiency but the output has significant noise. LM317 burns the last 2V (1.25V minimum drop plus 0.75 margin) to make a smooth supply. Obviously, there are more efficient methods to regulate power. However, many of them involve reading 500 pages about
snubber circuits and more obscure topics. 7805 is "get 'er done" and LM317 is only the next step in a possible long journey.
Firefox6502 seeks a circuit where it is possible to select source of power input. Place a full bridge rectifier and Buck/Boost circuit behind a single poll switch. This should be suitable for input with either polarity, 4-20V. Indeed, it should be suitable for solar power.