On Fri, Jun 25, 2004 at 02:20:04AM -0400, Ishaan Dalal wrote: > John Waters wrote: > > >I want to use my car battery to provide a range of variable d.c. from > >0-12V, > >but a standard regulator circuit doesn't fulfill the requirement, as I want > >the output voltage to be adjustable by software through a microcontroller, > >could someone suggest how to do that? > > The key is: digital POT. Actually it isn't. The key is a controllable variable voltage. A digipot is one mechanism for accomplishing that. However it does have its issues: 1) Digipots have variable impeadance. 2) Digipots may or may not have the proper resistive range for the application 3) Digipots may or may not have the same grainularity as other methods. 8 bits only gets you 256 voltage steps. 4) Digipots may not be precisely linear over the its specified range. 5) And most importantly digipots may not be either easy or cheap to get. So back to the main point, you need a controllable voltage. Fortunately the PIC is quite helpful here, because many of them have high resolution PWM. A simple one pole low pass filter consisting of a resistor and cap connected to the PWM output can provide a stable reference voltage for the regulator. Figure 4 of Microchip's appnote AN538 gives a perfect example of the process. It also is followed bu an opamp voltage follower which solves the impeadance problem because the opamp will provide whatever current is required to maintain the given input voltage. http://ww1.microchip.com/downloads/en/AppNotes/00538c.pdf The opamp also provides another opportunity, which is amplifying the input voltage. Since on a LM317 the output follows the ADJ voltage + 1.25V the ADJ voltage needs to be able to get up to nearly 11V. The opamp with the addition of a couple of resistors can easily double or triple the output voltage. The maximize the precision of the 10 bit PWM you really want to match the amplification for that 5V maps as close to 10.75V as you can get. But even a straight double will get you a range of 1.25V up to 11.25V > Question is whether you can afford a wasteful > linear regulator, or you need a switcher. The LM317 I believe is the > standard for this sort of thing. Correct. > Of course, you might need an LDO (low > dropout) regulator...see TI, OnSemi, etc. for an adjustable LDO linear > regulator. It all depends of if the battery is in a running car or not. Alternators routinely output nearly 14V which is enough headroom for even the LM317. But out of the box, and under any sort of load, it's closer to 12V. > All of these use some sort of resistive divider to fix > voltage, and with a digital POT in there (Microchip makes some nice > ones, the MCP4xxxx series), you're all set. You're already going to have a PIC. An opamp, a cap, and a handful of resistors can give you the same effect. > > If you are looking for switchers, National makes a number of adjustable > ones. I've used the LM2576-ADJ, but that's a high current (3A) part. > They make low-current ones too. Check them out. "dropout", i.e. min > input-output differential is about 3V. Absolutely. You may need to check out SEPIC configurations which will buck or boost providing the correct output voltage whether or not the input voltage is above or below the output voltage. BAJ -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads