# Project: Digitally selectable voltage voltage regulator using LM317

#### dileepchacko

Joined May 13, 2008
102
Here a simple digitally selectable voltage voltage regulator using LM317
It can provide maximum 1500mA. Diode D1 and D2 is for protection from short circuit. Vs2,Vs3,Vs4,Vs5 is jest for simulation purpose. You can connect the 4 input to an TTL logic. Even you can change the resistor value and get 16 combination of voltages.

Design Equation

where Vout= Output voltage from voltage regulator
R2= Equivalent resistance of R6,R7,R8 and R9 (parallel combination)
R1= 120Ohm

#### Attachments

• 62 KB Views: 1,761

#### Wendy

Joined Mar 24, 2008
22,155
Think binary as well as digital, if R2 = 1K, R3 = 2K, R4 = 4K, and R5 = 8K.

Or maybe R2 = 125, R3 = 250, R4 = 500, and R5 = 1K.

Or some variation thereof. The advantage is a wider range, and just as controllable.

#### thingmaker3

Joined May 16, 2005
5,084
Bill is correct, as usual. With all four collector resistors the same value, an input of 0101 will yield the same output as 1010 or 1001.

#### Wendy

Joined Mar 24, 2008
22,155
I was thinking of this circuit while driving, 4 bits could be useful, but 8 should be better. If you have a 25V max output you should be able to get within .1V, which is usually good enough for a lot of projects. 8 bits is a standard byte in the computer world.

I'm not sure how linear the output would be though, I may graph it just to see. I wouldn't use transistors myself, something like a 4051 CMOS would be more likely if the current requirements were in spec (or close).

#### SgtWookie

Joined Jul 17, 2007
22,210
The posted circuit is extremely similar to an entry on page 21 in National Semiconductor's datasheet for the LM117/LM217/LM317.

Link to datasheet on National's site: http://www.national.com/ds.cgi/LM/LM117.pdf
See the attached excerpt.

#### Attachments

• 18.2 KB Views: 901

#### beenthere

Joined Apr 20, 2004
15,819

It's a handy technique for selecting output voltage from a homemade bench PS.

#### gogo2520

Joined Sep 16, 2008
3
Hello
I made a made one sort of like that, I found the project at http://members.shaw.ca/roma/ about three years ago. If I remember right the transistors were backwards on the PCB but that was easy to fix. I like the push button selector. I had fun making it and still use it today
Have fun
gogo

#### italo

Joined Nov 20, 2005
205
I was thinking of this circuit while driving, 4 bits could be useful, but 8 should be better. If you have a 25V max output you should be able to get within .1V, which is usually good enough for a lot of projects. 8 bits is a standard byte in the computer world.

I'm not sure how linear the output would be though, I may graph it just to see. I wouldn't use transistors myself, something like a 4051 CMOS would be more likely if the current requirements were in spec (or close).
You sure 25v 4051 is only good to 20v. Iguess it will work once.

#### Wendy

Joined Mar 24, 2008
22,155
You sure 25v 4051 is only good to 20v. Iguess it will work once.
You're right, just looked up the spec sheet of the CD4051, while you could use it in binary mode it would use more resistors and only be 3 bit.

Last edited:

#### tirnasjimmy

Joined Jul 28, 2011
2
The statement "R2 is the equivalent resistance of R6,R7,R8 & R9 in parallel" should read " R2 is the equivalent resistence of R2,R3,R4 & R5 in parallel."

Also R2 is used twice. once, presumably, as the resistor in the datasheet formula for the LM317 and again as one of the 4 switchable resistors.

Values of resistors R6 to R9 are irrelevant as long as they are big enough to protect the BJT base-emitter junction from current overload and small enough to allow the BJTs to saturate.