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
You have asked a bunch of questions there which all have straightforward answers, but it's a bit much to try to cover them all in detail this space, but let me give some suggestions.
LED light for plant?
First, before proceeding, are you sure that LED light, which usually has a very narrow spectrum (or a few narrow lines), will be suited to plant light? I don't know about this, but it would be worth verifying before going to effort.
How to power and control LEDs
Next, you need a few clues about how to power and control LEDs.
You don't mention what the role of the Arduino will be -- will it be to turn the LEDs on and off, or do you want it to produce gradations of light intensity?
a) If on/off, you'll want an arduino shield that provides a relay or power-transistor which can switch an appropriate amount of current, which I'll get to below.
b) If gradations, you'll need a shield that can control the current in increments. Or, a popular alternative is an output controller that pulses the light very rapidly, controlling the overall light by the ratio of on to off time. This is referred to as "Pulse Width Modulation" or PWM. Again the PWM output switch element (transistor) needs to be rated for at least the amount of current you supply to your LEDs.
Edit: Arduinos usually have some outputs that are referred to as "analog outputs" but are actually PWM, so this capability is built in to the Arduino -- though you would still need to provide an external transistor to handle the current of the LEDs -- see examples online.
Supplying electricity to LEDs.
This is the mildly tricky part. LEDs are specified with a typical voltage and current number. For Cree ML-E: 3.2V at 150mA. So you might think "I'll hook eight of those up to 24 volts, and that'll be about right". Unfortunately, it's not so simple. LEDs have a characteristic whereby if you supply a little less than the nominal voltage, and they pass very little current and produce little light. A little more than the nominal voltage and they pass a great deal of current, and probably burn out.
So you don't want to supply a fixed voltage direct to an LED. Instead, you provide a supply which regulates the current. You'll notice that the LED supply you linked to is described as a constant current source. But you don't need to be that fancy. Instead, you can use a supply with a voltage higher than that needed by the LEDs, and put a resistor in series. Example:
Supply: 5V
LED: requires 3.2V, 0.15A
Voltage difference: 1.8V
Resistor: I = V/R So R = V/I, = 1.8/0.15 = 12 ohms. (And FWIW, P = I * V = 0.15 * 1.8 = 0.27 W, so choose a half watt or better physical size of resistor.)
Yes, you can put a bunch of LEDs in series, so for your example 6 x 3.2 or 7 x 3.2 would be possibilities, and still have some voltage drop left between the LED requirements and the 24 V supply. (You will need to factor in that whatever is switching the LEDs, such as a transistor, will also add some voltage drop to the chain.)
Generally, it is a bad idea to attach LEDs (or chains of LEDs) directly in parallel, because the actual voltage for the nominal current may vary from one LED to another, and from one chain to another. So multiple LED chains should each have their own series resistor.
Power for Arduino
Transforming 24V for use with Arduino: The easy answer here is a 7805 voltage regulator which is super easy to use. There are zillions of references for this on the web, so I'll not elaborate. Couple of things to attend to:
a) 24V -> 5V is a relatively large drop for the 7805, so you will need to attach it to a heat sink.
b) The switching of the LEDs will cause sharp changes in the demands on the supply, so err on the side of using relatively large capacitors with the 7805, and parallel them with smaller caps to help with the high-frequency aspect of the sharp switching. This thread is representative. Capacitor Sizes for 7805 Regulator.
[Edit] I'd neglected to note that the original question asked about Arduino with 7-12V power input, which is because Arduino Uno has a voltage regulator that handles the power from the Power In jack. The Uno can run on 5V from USB (when no power is supplied at the Power In jack), but if you are supplying power to the jack, then as the questioner mentioned, that will need to be 7V or higher. So a reasonable solution would be a 7808 or 7809 to obtain 8 or 9V from 24V.
Best Answer
Listen to Spehro.
If you'd rather do things the hard way, take the transformer output and run it through a full-wave rectifier. Filter the output with a large (say, 10000 uF) capacitor, then drop the resulting 15 - 18 volts through a regulator (linear or switching).
simulate this circuit – Schematic created using CircuitLab
Note that the diodes must be power rectifiers, not signal diodes.
If you're planning on using the transformer with 110 VAC in, this may not work. If you draw several amps and load the transformer to 10.5 / 2 volts AC, the diode drops will probably keep the capacitor voltage too low, unless you are careful to use a LDO (Low DropOut) regulator.