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.

PWM Signal to LM317 to adjust Voltage Output

Status
Not open for further replies.

Suraj143

Active Member
Guys can somebody help me to control voltage of the regulator from a PIC pwm frequency?

Most people say generate a PWM signal feed to a low pass filter & feed into an gained opamp & drive a transistor.is this ok?

Required range
*Low end can be 1v or 1.25V & high end will be 30V with a resolution 0.5V.

I have rail to rail opamps in my hand & LM317.

Those are my questions.

*What frequency to drive?
*Low pass filter values?
*Whats the gain?

This is a problem for me from a long time----> I still cannot understand what will be happen if I feed a PWM signal to a low pass filter??
 
Last edited:
Look at the low-pass filter like an integrator.

As for other ways, remember the usual way is used because it works.

John
 
This is a problem for me from a long time----> I still cannot understand what will be happen if I feed a PWM signal to a low pass filter??

A low pass filter removes the AC part of the signal and outputs the average, and gives you DC. From the PIC it probably will give a DC voltage of 0 to 5 volts. (if the VCC=5V)
 
If you know the frequency of your pwm from the PIC we can help you calculate the low pass filter.
 
Here is a neat calculator that you can use. Adjust R & C untill you get the ripple voltage low enough for your needs, then make sure you can live with the response time for a change. Go down the page until you see the PWM calculator.

**broken link removed**
 
Hi ronv this is the first time doing such an experiment.That's a nice calculator.

I did some calculations.from the blow values.

PWM Frequency = 1Khz
R=3.3K,C=0.1uF

Whats your ideas on this?Does it have too much ripple?

My main task is to generate voltage by PWM.
 
I think I would use something like 10K and 10 Ufd. That way only about 12 mv of ripple.
 
Hi ron your values are superb.I calculated the vout from uC from the values you given.

PWM Freq 1Khz
R=10K
C=10uF
Ripple (PP)= 12mV ripple

DC (1-100%) Vs V Out


10% = 0.5V
20% = 1V
30% = 1.5V
40% = 2V
50% = 2.5V
60& = 3V
70% = 3.5V
80% = 4V
90% = 4.5V
100%= 5V

If I give this Vout to a gained opamp let say the gain is set to 2 & the minimum value will show as 1V.& maximum val will be 10V.

I think this range is not enough.Atleast it must have 1V - 20V range.
 
Last edited:
317

You need a gain of about 5.75.

It won't be exact because the output of the 317 is 1.25 volts above the adjust pin. So.... You will have to make this adjustment in your micro program I think.
 
You need a gain of about 5.75.

It won't be exact because the output of the 317 is 1.25 volts above the adjust pin. So.... You will have to make this adjustment in your micro program I think.
R1 serves no purpose in your circuit. The voltage is determined by the op amp, low impedance output
 
Ok ronv thanks for your help.

I'm just wondering why I need a LM317 to make a digital power supply?

Why can't I do it from an op-amp?

PIC PWM --->Low Pass--->Gain Op-Amp--->Output

Why cant I do like that?So no need any LM317 stuff!!

Guys whats your idea on my way?
 
I want to build a general purpose power supply with digitally control voltage.

It must build with commonly available components without using any digital potentiometers :)
 
If you don't need much current you could just use the output of the op amp or you could use a higher power op amp. All depends on your needs. R1 provides a minimum load so the 317 will regulate even with very low or no external load.
 
Hi ron I simulated your circuit in Proteus,it worked nicely.

Giving PWM voltage from 50mV to 4.5V will give the output to 1.5V - 24V range that's great.

Of course for every gained voltage it must add 1.25V value.

Now I just modifying the PWM part.What about adding an unity gain buffer to the input to the op-amp?In other words I'm going to add low pass filter to the unity gain buffer & its output will connect to the gained op-amp!!
 
You could make the op amp into a second-order active filter for better suppression of the ripple.
 
Hi fellows from the 1st order filter 10K & 10uF I get a 12mV ripple.If I add 2nd order to this is it ok if I add another 10K with 1uF?

Looks likes its harder to calculate those stuff.

**broken link removed**
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top