Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Variable voltage output via LM317

Status
Not open for further replies.

Spadez

New Member
Hi.

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?

Regards,

James

p.s PWM in my case isnt an option.
 
Last edited:
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.
 
Last edited:
Hi.

Thank you for the reply.

Bascially I think I understand that on page one of the schematic:
https://www.electro-tech-online.com/custompdfs/2010/10/LM117.pdf

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?
 
Last edited:
The NPNs are used as switches.
 

Attachments

  • DF92.png
    DF92.png
    39.8 KB · Views: 284
Differential Voltage across lm317 vs Load current

Make sure to check your Differential Voltage across lm317 vs Load current to establish
minimum Vin requirements.....most common problem ignored.
 
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 Ω :D

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...
 
Last edited:
Right ok. So the C1 + C2 as well as the bottom of the adjust circuit are all connected to the circuit boards 0V rail?

The output pin on the LM317 will connect to the pump positive connector, and again is the 0V pump connector connected to my boards common 0V rail?
 
Pump, huh? How much current does it require?
 
Right ok. So the C1 + C2 as well as the bottom of the adjust circuit are all connected to the circuit boards 0V rail?

The output pin on the LM317 will connect to the pump positive connector, and again is the 0V pump connector connected to my boards common 0V rail?

Yes to both questions/
 
Super :)

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.
 
Please ignore this screw up, thank you.

Ron
 
Last edited:
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?

What is the input voltage?
 
Last edited:
Hi.

Sorry I didn't realise I would be getting near the limitation. I've found an alternative pump with a lower power requirement and start up current:

innovatek HPPS i-HighPower 12V Pump [] Water Cooling

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.

Thank you for the help, it's hugely appreciated.

James
 
Last edited:
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?
 
Last edited:
Look at the data sheet for the LM317, and understand the "Drop Out" spec.
 
Thank you for the reply. From what I can see, supplying 1.5A it has a peak drop out voltage of 2.5V.

In this respect is it correct that if I need a max of 12V I will need 14.5V. Call it 15V for good measure.

Have I got this right?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top