can PWM and Resistance be exchanged?

take an LM317t an adjustable voltage regulator..

depending on the voltage divider on the reference pin determines the voltage out... how is that resistance produced digitally?

cjdelphi:
take an LM317t an adjustable voltage regulator..

depending on the voltage divider on the reference pin determines the voltage out... how is that resistance produced digitally?

MOSFETs can work as variable resistors - just change the voltage on the gate to vary their resistance.

Could a TIP31 be used instead? I got like 20 of them but only two IRF's....

Instead of what?

can PWM and Resistance be exchanged?

Yes, the same way you exchange birds and rocks.

how is that resistance produced digitally?

It is generally not produced digitally.

You can produce it digitally with a digital pot, or through feedback control by a mcu (via a dac for example).

A TIP31 is a BJT (epitaxial) NPN Bipolar Junction Transistor, not a Metal-Oxide Semiconductor Field Effect Transistor.

IRF is just a manufacturer. There are hundreds of other makers around.

You want (precisely) an N-Channel Enhancement Mode MOSFET - they are 10 a penny from any electronics supplier. (99% of all N-Channel MOSFETS are enhancement mode, but be sure to check).

majenko:
You want (precisely) an N-Channel Enhancement Mode MOSFET - they are 10 a penny from any electronics supplier.

Link, please. (:

depending on the voltage divider on the reference pin determines the voltage out... how is that resistance produced digitally?

I am assuming the question is:-
I have a reference voltage on a LM317t an adjustable voltage regulator. Currently in my circuit it is produced by a potential divider, how can I make that reference voltage variable under the control of an arduino. Will PWM help?

In which case the answer is yes, remove the potential dividor and feed the PWM into an RC filter to smooth it, this will then produce a variable voltage you can then apply as a reference to your LM317t .

If this was not your question then please post again.

Yes that was the question but i'll use a power transistor rather than put strain on the atmega

What sort of strain? Useing PWM takes no CPU time and I would be surprised if a LM317 took more than say 20mA on the referance input.

An LM317 has a Max 100uA Iref or reference current and unless the OP needs need a really fast response could be filtered with a 10K resistor and a 220nF cap. It's a voltage source essentially. Do remember to filter the output of the '317, there's a lot of gain in that small package. I've enclosed a data sheet on that part.

Bob

Bob

LM317X.pdf (996 KB)

I would first use a transistor to generate a PWM signal based on the output of the regulator, before filtering it and applying to Vref. This is so that you get the feed back from the output to get a good voltage regulation.

I would first use a transistor to generate a PWM signal based on the output of the regulator, before filtering it and applying to Vref. This is so that you get the feed back from the output to get a good voltage regulation.

I'm basically with G_M here. His ckt should give a voltage output in the range of Vref[LM317] = 1.2V
minimum to 5V+1.2V = 6.2V max.

Many ckts for reference are here,

http://www.google.com/search?num=10&hl=en&safe=off&site=imghp&tbm=isch&source=hp&biw=1153&bih=870&q=LM317+voltage+control

Several possibilities,

http://easy-electronic-circuits.blogspot.com/2012/04/lm317-dispaly-intensity-controller.html

Somewhere should be a ckt where the PWM input drives an opAmp with some gain and whose output node
is connected to the LM317 reference pin to produce a larger Vout.

The answer will depend on if you wish to change the output voltage digitally and if you require low ripple. pwm + a filter will provide a variable voltage but it also provides ripple that gets passed onto the output un-attenuated.

This is where a digital pot / dac would be very helpful to achieve low ripple output.

That assumes no negative feedback on the part of the mcu.

for the current requirements, an Arduino will supply enough current for control with passives, 2 RC low pass filters should reduce the ripple to virtually 0. One low pass on the input to an op-amp for voltage scaling and one on the output of the scaling amplifier. The Arduino however can't supply enough voltage to get more than 3.8 V from a 5 V source using an LM317. I would have to repeat Mikes suggestion about digipots And a scaling amplifier as the digipots have a Vcc restriction @ 5 V... due to the input parasitic diodes inherent in the chip. Were it Me I'd use a switcher and control the voltage output with a digipot, No linear loss to contend with and really easy to clean up with a very simple Pi section filter... I'd use a 100 uHy Choke and 2 22 uF caps. The only real consideration would be the current requirements... The output filter might not be required... If you aren't doing any analog sensing then any noise from the switcher is a "don't care" thing because the typical "Noise" from a switcher is ~100 mV which is well below the switch threshold for CMOS logic. The 317 is a nice OLD device and when it was made there were no easy to use switcher IC's available... There are devices that are smaller than an LM317T (TO-220) device and require minimal heat-sinking unless you require full current capacity with high duty cycles, then a simple copper "Tab" soldered to the switcher PCB and bolted to a small heatsink. I used a similar method to control a UHF tranceiver's transmit power output power in the early 2000's by sensing the output power and controlling the switcher for required output power, in exactly the same manner as I described above.

Bob