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.

LM317 control by PIC MCU

Status
Not open for further replies.

VictorPS

Member
Hi,

I like to build a simple PIC Based Variable power supply.

First I thinking on using LM317, + a digital POT (10k) + PIC MCU to control the output voltage of LM317.

However, I worry the idea may not work , because the digital pot may only take 1mA max only, but the LM317 may need 5mA from the adj to ground.

Is there any other way I can control LM317?

Thank you,
Victor

P/s: reason choosing LM317 is because it 's great performance, and cheap.
 
Yes, you can use the digital pot... but the pot is limited to 0-5v. You will need an op-amp as well. I have been using a circuit like this in a project for more than a year, but as it's a commercial product I'm not at liberty to post the circuit.

Paul
 
Thanks for reply.
Can you post a simple block diagram to show the idea?
or your design is basically similar to voltage follower ?
 
VictorPS said:
Thanks for reply.
Can you post a simple block diagram to show the idea?
or your design is basically similar to voltage follower ?

What output voltage are you trying to get on the LM317? If it is less than 5V then you could use the digital pot without anything. If it's more than 5V...

But if you need an output voltage higher than the digital pot, couldn't you just feed the digital pot's center tap into the input of a opamp voltage follower? This would still limit you to 5V though. If you replaced the buffer with an amplifier though, you could feed a 0-5V signal into the amplifier and you could get it to produce an output larger than 5V with a <5V input (which the digital pot can do).

A few things:
-Of course, you would need to use a big-op amp for current capability since you are using this as a power supply. Possible opamps that might be used for high current capability are the OPA547, 548 or 549.
-obviously, the op-amp is a linear device so the supply voltage must always be higher than the than its output voltage.
-the PIC and digital pot need their own separate fixed voltage regulator
 
Last edited:
Something like this should work. I've left out the bypass caps, some resistor values, etc because I don't know your output requirements. The LM317 needs only 10ma to control it and the output voltage would sit 1.2V above the output voltage of the OpAmp.
 

Attachments

  • LM317.PNG
    LM317.PNG
    6.3 KB · Views: 11,194
Thank you to dknguyen and kchriste.
From the circuit. By putting 10k x2 for the opamp, it have a gain of x2, so a 5V input to the non inverting of Opamp will control the Lm317 from 1.25 to 11.25V, which is enough for my application.

beside using DPot, I think I can also using a DAC / PWM DAC to inject the analog voltage to the opamp for controlling.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top