# Digital LM317 Control

Discussion in 'Electronic Basics' started by Jay Davis, May 16, 2004.

1. ### Jay DavisGuest

I'm trying to build a circuit that digitally controls a LM317 using a
(0-5V) DAC. I'm kind of confused about the math here - I can't see how
to change the range of the LM317 to anything other than a 5V range. I
can see how to vary it from say 5 to 10, or from 17 to 22, but I can't
see how to do more than a 5V swing. Right now, I was designing the
circuit like this:

1K 240

I know that the LM317 creates a 1.2V reference across the 240 ohm
resistor, for a current of 5ma. So then I figure that (VOUT -
DACOUT)=5ma(1k) = range of only +/- 5V. Can someone set me straight here?

2. ### UncleWobblyGuest

Why not just generate whjatever voltage you want from the DAC and feed it
into an emitter follower circuit using a power transistor (dont' forget to
account for the base voltage drop)

3. ### Jay DavisGuest

How will this allow me to regulate over a full 1.2 to 30V range?

4. ### The Al BundyGuest

Something better and easier: use an opampl like the OPA549.
http://focus.ti.com/docs/prod/folders/print/opa549.html

You can make a voltage and current controlled powersupply with this opamp
and 2 DAC's.
And if you are handy enough you can even order some samples from TI..

Just some idea.

Al

5. ### Robert C MonsenGuest

R1 R2

Vout = 1.25*(240 + R2)/240 + Vin

In order to do a larger swing, you need a way to scale the output of
your DAC. One easy way would be an opamp circuit like this:
.----------.
IN | | OUT
--------------------| LM317 |----------------
| |
'----------'
|\ |
+----|-\ |
.------. | | >------+-------'
| DAC +---|----|+/ |
| | | |/ .-. R1+R2
'------' | | |R1 OUT = 1.25 + DAC * -----
| | | R2
| '-'
| |
+--------------+
|
.-.
| |R2
| |
'-'
|
|
===
GND
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.de

Obviously, IN must be larger than OUT by at least 3V. Accuracy is
related to the tolarances of R1 and R2.

Regards,
Bob Monsen

6. ### Jay DavisGuest

Ah, thanks! That's what I was trying to do

7. ### Jay DavisGuest

That looks interesting. Since I'm just doing this as a "fun" project
and nothing real serious, I'll probably just stick with parts I have on
hand, but should I want do do anything "for real", I'll take a look at
that part - 8A, 60V - yikes.

8. ### John LarkinGuest

Use an LM1117 for lower dropout differential. Nice part.

And, as Win has pointed out, you can usually power the opamp off the
regulator output!

John

9. ### Jay DavisGuest

Yeah, I just realized this. Obviously I can't power the opamp off of a
5v supply and expect the circuit to be able to do the full 1.2 to 30V -
no wonder I couldn't get it to make sense in my head.