datasheets.com EBN.com EDN.com EETimes.com Embedded.com PlanetAnalog.com TechOnline.com
Events
UBM Tech
UBM Tech

Design Article

#### Comment

jvme

5/15/2013 3:16 PM EDT

Dear Aruna,

There is definitely something missing in this scheme. It ...

More...

michou

4/23/2013 8:31 PM EDT

What is the minimum voltage for this design? What happens if the PWM signal ...

More...

# Control an LM317T with a PWM signal

## 2/3/2011 2:00 PM EST

The LM317T from National Semiconductor is a popular adjustable-voltage regulator that provides output voltages of 1.25 to 37V with maximum 1.5A current. You can adjust the output voltage with a potentiometer. The circuit in Figure 1 replaces the potentiometer with an analog voltage that you can control from a PWM (pulse-width-modulation) signal. You control this signal with a microcontroller or any other digital circuit. You can use the same microcontroller to dynamically monitor the output and adjust the LM317T.

Using an RC lowpass filter and an op amp, you can convert the PWM signal to a dc level that can adjust the LM317T’s voltage output. Varying the pulse width of the input signal lets you generate an analog voltage of 0 to 5V at the output of the lowpass filter. The op amp multiplies the voltage to achieve the desired voltage range.

For scenarios in which you must multiply the input voltage by two, the LM317T’s adjustment pin receives 0 to 10V. Its output-voltage range is 1.25 to 11.25V. The equation VOUT=VADJ+1.25V governs the LM3175T’s output voltage. You can change the op amp’s gain by choosing proper values for R4 and R2. You must be able to remove offset voltages from the op amp. Use an op amp, such as a National Semiconductor LM741, with null adjustment. The selection of values for the capacitor and resistor for the RC lowpass filter depends on the PWM signal’s frequency. This circuit uses values for a 1-kHz PWM signal.

You can improve the circuit by replacing the RC lowpass filter with an active filter and then feeding a feedback signal from the circuit’s output into the microcontroller for dynamic adjustments.

anonymous user

2/4/2011 10:36 PM EST

For what would this circuit be used?

anonymous user

2/6/2011 8:39 PM EST

Why use a LM317T when the output voltage is controlled by the PWM signal?

aruna1

2/7/2011 8:49 AM EST

you cant use a pwm signal as a power supply i guess

anonymous user

2/9/2011 9:55 AM EST

Why do you need the LM317 if the opamp is already controlling the output voltage? Can you give us an example of why this is useful?

dgary

2/16/2011 1:35 PM EST

The LM317 is able to put out 1.5 amps. The op amp probably 60 mils. So that is why you would use the 317.

anonymous user

2/17/2011 5:04 PM EST

I guess he want's to show everybody that he has the tater's to cough up something like this.

anonymous user

2/19/2011 4:16 AM EST

Why use a pwm signal too vary output of an LM317T?

Are you guys for real? Because it allows DIGITAL control of the 317!! AND active modulation of output voltage. So basically you get a modulated digital power converting 1.5A dc/dc converter for cheap that relies on radio shack available cheap parts. with an arduino or pic microcontroller ic you then have an agile infinitely variable (within the range and resolution limits) 1.25 to 37 VDC 1.5A microcomputer controlled PWM modulated power supply that is programmable using a couple dollars and maybe 10 components. That's why

mehcaver

8/8/2012 8:42 PM EDT

A particular limitation of arduino, and many pic microcontrollers is the absence of any DAC output. When arduino designers say there is an analog output, they are referring to the PWM channel(s). Not being an ee myself, I wonder if PWM can be simply and accurately converted to true analog signals, eg. waveforms. For the purposes of Vref generation, this circuit seems like a good idea. But as others here suggest, there are other ways. What are these? A discussion of alternatives would be most appreciated by me and perhaps other uController experimenters. BTW, introductory books that I've seen (eg. "Getting Started with Arduino") gloss over this distinction.

anonymous user

3/1/2011 2:16 AM EST

To use LM317T instead of the Darlington transistor is not a new but is not a bad idea, but an implementation and claims about achieved parameters definitely are not right by the following reasons:
1. Suggested OP Amp LM741 does not have rail to rail input and output and could not work well with input signal at least from 0 to 2.5V.
2. LM317T is not low drop voltage regulator and required at least 2.5V headroom at 1.5A. So with 12V power supply as shown on Fig.1, claimed the maximum output voltage could not be higher that 9.5V
To make this solution useful and matching to the author claims needs to replace Op Amp LM741, to increase input voltage to 15V and to connect resistor R4 instead of Vadj terminal of LM317T to the output.

anonymous user

3/1/2011 11:24 PM EST

hi
it says like LM741 i belive what he meant is op amp with null offset adjustment.its obvious you need to use rail to rail op amp.therefor i belive what he meant is rail to rail op amp with null adjustment.LM741 is used tell about null adjustment feature.

anonymous user

3/2/2011 12:48 AM EST

guys please learn to think outside the box.You should know that LM317T has input voltage upto 37v. You can use more than 12V of course.So if you want to get the range mentioned in example of this circuit,you have to apply higher input voltage.That is common sense.He doesn't have to explain everything.He gave us the idea.we need the a brain to use it.

michou

4/23/2013 8:31 PM EDT

What is the minimum voltage for this design? What happens if the PWM signal drops to zero? Having 330R means there is about 4mA flowing through R3. If PWM drops to zero, where does that current go? I think this design is missing something.

jvme

5/15/2013 3:16 PM EDT

Dear Aruna,

There is definitely something missing in this scheme. It doesn't work.
I've implemented this with real hardware.

I've a PWM signal with a frequency of 400 Hz and pulse voltage of 3 Volts.
The gain of IC1 (Op amp LM741) is 3,2 (R2=10K and R4=22K).

The Vout varies from 7,56 Volts (PWM pulse width from 0% till 75%) and starts to raise to a maximum of 10,97 Volts (PWM pulse width from 75% till 100%).

The null adjustment with a 10 K trimmer between pin 1 and pin 5 of IC1 has no effect!

What should be modified or added to this scheme to have a Vout of 3 Volts (with a PWM pulse width of 0%) to 10 Volts (with a PWM pulse width of 100%)?

Thanks for reading this and maybe given a solution.

Ing Johan Vermeire
Belgium