PDA

View Full Version : PIC driving Adjustable Voltage Regulator



flotulopex
- 6th June 2007, 11:48
Hello,

I'm building a(nother) lead battery charger.

Just to make sure I'm not missing something important, I would like somebody, who made this before, to tell me if my principle is correct.

The PIC will read the Vout via ADC (GP1) and set the PWM (GP5) to adjust voltage.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1715&stc=1&d=1181126438">
Is there a better way to control a voltage regulator?

Charles Linquis
- 6th June 2007, 13:51
Your circuit will allow you to vary the output voltage, but only over a narrow range. I see that your input voltage is 24 - which implies to me that you need an output voltage that is probably above 10V.

The LM317 series of regulators is designed such that the output voltage on pin 2 is 1.2V greater than the voltage at the "adj" pin 1. For that reason, your circuit will have a voltage output of a little over 1.2V (at "0" PWM) or to a maximum of 6.2V at PWM = 255.

If you want full-range, you should add an op-amp with a gain of about 5 at the R-C junction, and the output of that op-amp would go to the LM317 adjust pin. I would also pull up the PIC output pin to Vcc through a 1K (or so) resistor to help insure that the pin swings close to 5V when it is HIGH.

Adding an op-amp to the circuit would also let your raise the impedance of the R1/R2 circuit. That would allow for a smaller capacitor and lower your PIC loading.

skimask
- 6th June 2007, 13:52
Adding an op-amp to the circuit would also let your raise the impedance of the R1/R2 circuit. That would allow for a smaller capacitor and lower your PIC loading.

Or maybe use one of those digital potentiometers, like the Xicor series types, for your voltage divider...

sougata
- 6th June 2007, 14:26
Hi,

Look at this article here http://www.elecdesign.com/Articles/Index.cfm?AD=1&ArticleID=13077 . I hope no explanations are necessary.

Acetronics2
- 6th June 2007, 15:45
Hi Flotul

I already saw a '317 as a couple of KHz PWM amplifier ( yes ON/OFF !!! ) ... OK ... precisely ON/1.25v ...

Seems it's also already used in classA amplifiers !!! ( see National Datasheet )

Just have a nice filtering for the PWM out of the Pic and it will work just as you want !!!

Alain

flotulopex
- 6th June 2007, 20:00
Alain,

I downloaded the datasheet and quickly read it.

Could you give me a little more info about what you mean by "a couple of kHz amplifier"?

Sougata,

Your link just gives everything I need :). I thought I could make something with less components; I'm very short in space.

Acetronics2
- 6th June 2007, 20:05
Hi, flotul

I just mean the ref pin is driven by a 1kHz 12v p.p. square wave !!!

The use is a variable switching supply for model Trains ...

Alain