Your solution started out as bearable (5V at 100mA) but ended up completely unacceptable at 500 mA. You say that your "wall wart" is rated at 300 mA. When you supply a voltage using a linear regulator the current in is the same as the current out - the regulator drops the difference in voltage. So here if you draw 500 mA at 5V you must supply 500 mA at 12V or 24V. The transformer will be overloaded in either case.
If the ratings are as you say then a potentially acceptable solution is to use a switching regulator (SR) operating from 24V in. \$5V \times 500 mA = 2.5 W\$.
\$24V \times 5 W =~ 210 mA\$. If the SR is 80% efficient (easily achieved) that rises to 260 mA. As that is liable to be an occasional requirement the total current at 24V will probably be acceptable with a 300 mA supply - depending on how many solenoids you wish to maintain on.
If you switch only one solenoid on at once the current drain with N activated is \$20 \times N + 20 mA\$. The surge current is essentially immaterial.
If you wanted more than 3 or 4 solenoids then current drain at 5V may need to be limited.
e.g.
- 10 solenoids at 20 mA = \$200 mA\$
- Balance = \$300mA-200mA = 100 mA\$
- Available current at 5V at 80 % efficient = \$ 100 mA \times \frac{24}{5} \times 0.8 = 384 mA\$, say \$400 mA\$.
Note that when a switching regulator is used, using a higher input voltage will result in less input current drain. Hence it is better here to use the full 24V supply.
Note also that if the transformer is a genuine 24 VAC then the rectified DC will be about \$24 VAC \times 1.414 - 1.5V - \$ "a bit" \$~= 30 VDC \$
Because:
\$VDC_{peak} = VAC_{RMS} \times \sqrt{2} ~= VAC \times 1.414 ~= 34 V\$.
A full bridge rectifier will drop about 1.5V.
34 VDC is peak voltage and available DC will be slightly lower - depends on load. There will be "a bit" of ripple and wiring loss and transformer droop and ...
At 80% efficiency this gives a 24VAC to 5V DC current boost of \$ \frac{30}{5} \times 0.8 = 4.8:1 \$
e.g.
- for 48 mA at 5V you need 10 mA at 30V.
- for 480 mA at 5V you need 100 mA at 30V.
So you about get 10 solenoids plus almost 500 mA at 5V DC :-)
One solution of many:
There are many SR IC's and designs. Here a simple buck regulator will suffice.
You can buy commercial units or "roll your own". There are many modern ICs but if cost is at a premium you could look at ye olde MC34063. About the cheapest switching regulator IC available and able to handle essentially any topology. It would handle this task with no external semiconductors and a minimum of other components.
MC34063. $US0.62 from Digikey in 1's. I pay about 10 cents each in 10,000 qauntity in China (about half Digikey's price).
Figure 8 in the datasheet referenced below happens to be a "perfect match" to your requirement. Here 25 VDC in, 5V at 500 mA out. 83% efficient.
3 x R, 3 x C, diode, inductor. It would work without alteration at 30 VDC in.
Datasheet - http://focus.ti.com/lit/ds/symlink/mc33063a.pdf
Prices - http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=296-17766-5-ND
Figure 8 in the LM34063 datasheet shows ALL component values except for the inductor design (inductance only is given). We can spec the inductor for you from Digikey (see below) or wherever and/or help you design it. Basically it's a 200 uH inducor designed for general power switching use with a saturation current of say 750 mA or more. Things like resonant frequency, resistance etc matter BUT are liable to be fine in any part that meets the basic spec. OR you can wind your own for very little on eg a Micrometals core. Design software on their site.
From Digikey $US0.62/1. In stock. Bourns (ie good).
Price:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=SDR1005-221KLCT-ND
Datasheet:
http://www.bourns.com/data/global/pdfs/SDR1005.pdf
Slightly better spec
Do you understand that this type of power supply provides no isoation at all from the mains? It is only intended for applications in which the circuit being powered will have no connections whatsoever to anything else.
You're lucky you didn't lose your PC as well, since you were essentially connecting 120 VAC directly to a USB port! Be thankful that the PICkit sacrificed itself to save your system.
Go out right now and invest in a real bench power supply. Used ones can be had for a few dollars, and even a good low-end new one will be less than $50.
As an aside, I don't understand why that application note has you putting the dropping resistance/capacitance and the diode D2 in the neutral side of the mains connection instead of the hot side. I think it would be at least a little bit less risky to do it the other way around. But maybe they wanted to make sure failures like this one would be more memorable.
Best Answer
Sounds like a homework question :-).
If you need to ask at the level of detail you are asking you will need more input and learning than you will get in a single answer here.
If this is a real project that is worth money then that is the sort of task that is worth spending money on the design of for professional input.
But:
Assume design life is 100,000 hours = 11.4 years x 8765 hrs pa.
Capacitors can be aluminum electrolytic IF you design properly. A 2000 hour capacitor will need to be run at 60C under rated temperature . So 105C caps need 105C - 60 = 45C ambient or less and preferably much less. That sounds easy but must account for local temperature + enclosure rise + self heating + radiation from other components + any local hot spotting from other air flow. Care will be needed. 3000 or 4000 hour caps will help. Be aware that aluminium wet electrolytic caps die FASTER at a given temperature when unpowered than when powered (due to dryout).
Solid Aluminum caps will be easier to use where size and price allows.
Tantalum caps are tempting and work well if design is immaculate and if reality follows theory. If this is in a game it's worth the risk, perhaps. If it's in a sub or spacecraft then send tantalum packing now.
Understand temperature derating, ripple current derating.
Buy components of known trustable brands AND ensure that what you buy is what it claims to be. Incoming inspect as much as needed to maintain certainty.
Properly manage ESD issues (electrostatic discharge), if it says don't bend closer to xxx from seal then don't, if it says clamp lead to prevent shock damage while cutting or bending then do. Similarly take proper note of manufacturers advice re max storage time at xx% RH, retreatment required for packages open too long, reflow soldering temperature profiles, advice that part may not be solder by means of xxx, ultrasonic cleaning warnings, solvent cleaning warnings, do not stack xxx way, do not apply force to xxx, ... manufacturers advice.
Design properly. Use worst case parameters, pore data sheet for exceptions and special requirements. err on conservative side.
For any of the following that you wish to be protect from take due note: Assume worst worst case mains transients, sags, brownout, lightning strike, acts of God, acts of children, acts of drunks and people of low IQ, acts of mice rats ants and cockroaches (gnawing, urinating, defecating, nesting, dying, ...), 100% condensing atmospheres, low humidity, air conditioning failure, coffee spills, Coke spills ... .
If you care, assume that 110 VAC equipment will be plugged into 230 VAC mains. Assume that 60 Hz equipment will be plugged into 50 Hz (iron cored transformers care, other things may) and vice versa.
Understand longitudinal and transverse mains filters. Understand X & Y filter capacitor ratings. Realise that mains to output ground Y caps can produce destructive output voltages(typically half mans voltage).
Allow component degradations and changes of characteristics with time - capacitor dryout, LED degradation (especially including opto couplers), iron cored coil binder thermal degradation, ... .
Be aware of why components have rated values - voltage ratings for resistors, surge (not fusing) ratings for fuses, temperature rise for tracks, resistor current as opposed to power ratings, power semiconductor peak vs max operating ratings, dV/dT opto ratings ... .
That's a once over lightly out of my head start. There can be much more. Skimp on or ignore almost any of these and your 10 year lifetime is suspect. 100,000 hours is a long time. Survival is usually via gross dumb overkill or skilled design but seldom due to luck. If you are feeling lucky you probably wont be.
Produce a total picture of what you wish to do, known hazards, know mitigations, sensible solutions. Worry it to dearth if you don't want it to die.
More ...
___________________________________
This superb reference, supplied by @davidcarey, is essential readung.
Underestimating Complexity of Power Supply Design - Underestimating the complexity of power supply design can lead to schedule slips, cost overruns, and excessive field failures.
Useful:
Best manufacturing practices site - Reliability
and their download list - some relevant.
MORE POWER FOR THE DOLLAR 149 pages
Price vs Value - A Technical Guide
NAVSO P-3641A (Replaces NAVMAT P-4855-1A) October 1999
Power Supply Standards