Basically I need to have three voltages (8, 10 12). I then need to use a PIC to control which voltage is outputted from the variable voltage regulator.
I am told that I need a LM317 but I havent been able to find any information on schematics that use the PIC to control the output voltage.
Is anyone able to point me in the right direction?
Look at the LM317 data sheet where is shows how to make it adjustable. Note that this is basically a voltage divider consisting of two resistors; the upper one doesn't change (usually 120 or 240Ω, depending on which version of the 317 you have), and the bottom one, the voltage drop across which adds to the intrinsic 1.25V reference inside the 317.
For your purpose, choose a bottom resistor to give you 12V out. Now calculate a resistor which when paralleled with the resistor above would drop the voltage to 10V, and do this a second time with yet another resistor which when paralleled with the previous two would reduce the output to 8V.
Use open-collector NPNs with a suitable base-current limiting resistor to "ground" the two additional resistors to put them in parallel with the original 12V resistor...
This will take two port pins; 00 gives 12V, 01 gives 10V, 11 gives 8V, and btw: 10 would give a fourth TBD voltage.
Try the math yourself. If you get stuck, write back.
It shows a circuit to produce a variable voltage. From there I can vary R2 to change the voltage output.
The bit I dont understand is the open collector NPN's. Im new to electronics.
Can i assume it is a system whereby I use pins on the PIC to turn the resistors in parrellel to R2 on and off, thereby varying the voltage output using the PIC?
Is there somewhere I can go to, to learn about these NPNs used in my application?
Thank you all for all your replies, especially Mike as that diagram is a huge help.
Sorry for such a basic question but im a bit confused about wiring up the the LM317. It doesnt have a 0V pin.
The LM317 is as follows: Adjustable, Vout, Vin
The normal voltage regulator is: Vout, Vin, V0.
How am I meant to connect the LM317 to 0V? Is it right that I can connect it to the common 0V rail that is used on the rest of the board (say the input 0V that is also used by the other 5V voltage regulator)
...
Sorry for such a basic question but im a bit confused about wiring up the the LM317. It doesnt have a 0V pin.
The LM317 is as follows: Adjustable, Vout, Vin
The normal voltage regulator is: Vout, Vin, V0.
How am I meant to connect the LM317 to 0V? Is it right that I can connect it to the common 0V rail that is used on the rest of the board (say the input 0V that is also used by the other 5V voltage regulator)
There is no connection to 0V (Gnd) on a LM317, not unless you want it to deliver 1.25V, in which case Adj is connected to ground. Another way of saying that is that R2 (the bottom resistor in the normal voltage divider) is zero Ω
For your purposes, just hook it up the way I showed....
Depending on how much current you need at the three voltages, you might have to consider that the LM317 will have to be mounted on a heatsink, in which case you will have to insulate the heatsink, or insulate the tab on the LM317 from the heatsink.
Also, as another poster pointed out, you have to consider the minimum input voltage, which will have to be Vdo (the drop out voltage of the LM317, ~2.2V?) plus the 12V you want...
Yes it is a 12V brushless pump with 1A current draw, possibly a bit more on startup. Ive read lots of information on the internet and apparently the pump doesnt work well with PWM. Since I only needed three different settings the voltage seemed like a good option.
With more than 1A for starting, I guessing that the LM317 may go into current limiting to protect itself, and pump will labor on start up. You should have stated your current requirement up front (and I should have asked).
If the unregulated input voltage is 15V, at 8V output, the LM317 will be dissipating (15-8)*1 = 7W, so it will have to be on a large heatsink. You are planning to use a LM317T (TO220 version of the LM317), right?
Will this be a suitable option? I hope this wouldn't push the voltage regulator past it's limit. It would be suitable for my pumping application in terms of size and output.
I will be using large heatsinks and the lm317t.
I'm not sure what the input voltage requirement would be, but I haven't factored that in yet so I can tailor it to my requirements.
The LM317T should be able to handle that pump. The 317T will deliver a minimum of 1.5A, so it might be ok for your first choice. For most DC motors, the start up current is several times the running current.
My pumps have arrived and they look great. I will experiment with them tomorrow.
Two questions really. How do I work out what voltage I need to supply to the two LM317T's? This supply will also have to supply the 5V regulator side of things.
The way I have this planned out is the 15V goes into the 5V regulator for the PIC and into the two LM317's for the variable voltage. Ive been looking at something like this supply:
**broken link removed**
It certainly seems to have enough amps to drive the pumps but im not sure if 15V will be enough.
Is this some kind of equation I can use to work it out or it is just trail and error?