Best way to get 12 V from 28 V or 5 V ?

I have a 28 volt 6A power supply going to stepper drivers + motors and the 5 V from a computer going to an Arduino.

I need to add a 12 volt 150 mA pneumatic solenoid, and a transistor to control it from an Arduino IO pin. Should I use a resistor voltage divider on the 28V, or would it be better to use something like a charge pump circuit on the 5V?

Thanks as always,


PS Thanks to Grumpy Mike for introducing me to voltage dividers.

"resistor voltage divider ", No. Voltage out will vary with the current being drawn.
You don't have a lot of current need there, just use a LM7812 to bring the 28V down to 12V.
Will be dissipating 2.4W (28V - 12V) * 0.15A, so a heatsink will likely be needed.

I use this boost regulator in my fencing scoring machine, has worked out very well.

Supply it with 5V (4A capable), adjust the output for 12V.
Drives 2 banks of 20 LEDs, MOSFET speaker amplifier, and 2 remote boxes 50 feet away where the 12V drives 2 more banks of LEDs in each box, and a 7805 to make power for a promini that controls the transistors for the LEDs.

a 7812 regulator will be stable and the best I think. A TO-92 package can handle that amount of current and they are less than a buck probably.
As far as a transistor driver. Of course a npn or pnp transistor will work for you. But I personally like to use the darlington transistor. They wire the same as a standard lets say PNP or NPN transistor, but you get the added bonus that they will turn on with a fraction of the current needed as compared to a standard PNP or NPN transistor. We are talking about nano amps here.

Gotta be careful with the darlington's tho - they have a higher Vce than discrete NPNs.
The lowest I see at digikey is 0.9V, and that's for Ice of just 300mA.

LM7812 good for up to 35V, 12V output,

will need some heatsinking tho for the 2.4W that it is dissipating.

If the 12v is only needed to drive a single 150mA solenoid, just put a 100 ohm 3W (or greater) resistor in series with the solenoid so that you can run the combination from 28v directly. No need for a voltage regulator at all.

Thanks for the info guys. Three more questions:

1 - The solenoid will have a duty cycle of 17% (on for 1 S, off for 5 S, repeat) so I think the LM7812 will be dissipating 400 mW instead of 2.4W correct?

2 - Do I wire the LM7812 up with just a .33uF cap on the input and a .1uF cap on the output, like in the "Typical Applications - DC Parameters" section of the spec sheet?

3 - Crossroads you said to use this chip because a resistor voltage divider's voltage out will vary with the current being drawn. Is that really important for a solenoid? My (limited) experience with electromechanical things is that they're pretty tolerant of voltage ranges. (I'm going to use your advice and use the LM7812, I'm just trying to figure out what's appropriate when).

Thanks again,


dc42 - Thanks for the idea. I will look at that.

You can go whatever route meets your needs & budget.
I went with the switching regulator as creating 5V from a 12v supply with a LM7805, the unheatsunk 7805 for the main box got really hot! Didn't measure the current, but I didn't all that heat in the box.

For a solenoid, yeah, maybe not so critical. Check its specs, see what absolute max it can handle.

As to what's appropriate when, hard to say. Depends on budget, enclosure, end use, etc.

If you know it draws 150ma you can try just puttin a 180 ohm resistor in series and that should work

The specs are a little weird, they say "100mA or 350mA".

It was only $2.50 from All Electronics ( and since they're only about 90 minutes from me I get overnight shipping for dirt cheap.

I think I'm going to try both the resistor and the LM7812 solutions; the LM7812 is only $0.70 at DigiKey and I'm sure if I don't use it here I will find something to do with it down the road. I've got a bunch of transistors but no Darlingtons; hopefully something I have will work.

In case you're interested it will be used to control air flow between a vacuum pump and a SMD pick and place head.

I hope.

Thanks to all for your help.

The specs are a little weird, they say "100mA or 350mA".

I suggest you measure its resistance to determine the steady-state current. It might possibly mean 350mA peak while the solenoid is moving and 150mA when it is stationary. If this is the case, running it from 28v through a series resistor of 100 ohms should still work, although the solenoid may open slightly more slowly then when driven from a constant 12v.

You don't need a darlington to drive that solenoid, a transistor with a good hfe at that sort of current will be adequate, e.g. BC337.