Problem with LM317 and digital pot

Discussion in 'General Electronics Chat' started by Jan Rune, Apr 27, 2008.

Thread Status:
Not open for further replies.
  1. Jan Rune

    Thread Starter Member

    Apr 22, 2008
    17
    0
    Hi guys!
    I have a problem trying to adjust the LM317 voltage with a digital pot (MCP41050, 50K). I have placed the pot in parallel with a 3,3K(R2) resistor and this makes me adjust the resistance from 3095ohm to about 270ohm+- (measured). The R1 resistor is 220 ohm. After what i have calculated, this will give me a range from bout 20V to 2.80V.

    The problem is that im just able to adjust it from 2.80V to bout 7.00V.

    Can anyone give me some pointers on what im doing wrong here?

    Cheers
    Jan

    [​IMG]
     
  2. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Maybe it would be worth performing a circuit check.

    Disconnect the digital potentiometer from the circuit and see if the power supply output achieves the 20V output.

    hgmjr
     
  3. Jan Rune

    Thread Starter Member

    Apr 22, 2008
    17
    0
    It does give me about 20V without the mcp41050...
     
  4. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    The digital pot may not be capable of withstanding the currents that it being asked to handle when set to the lowest resistance.

    The datasheet seems to indicate that the current for the digital potentiomenter should be kept to within +1mA to -1mA.

    hgmjr
     
  5. Jan Rune

    Thread Starter Member

    Apr 22, 2008
    17
    0
    Yeah i know, but after what i understand in the LM317 datasheet. The maximum current on the ADJ pin is 0.1mA. Typical is around 0.046mA, if i got that right...
     
  6. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    The problem is that the potentiometer inputs are not supposed to go above VCC for the chip. They likely have protection diodes, which will limit the ADJ pin to 5.7V or so. If you add 1.25V to that, then you have 6.95V or about 7V.
     
  7. Jan Rune

    Thread Starter Member

    Apr 22, 2008
    17
    0
    BTW: Im open for other ways to adjust the voltage from a microcontroller :D
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Take a look at the datasheet for the digital pot.

    Look for the Voltage Range on the resistor terminals.
    You'll find that it is 0v to Vdd (the supply voltage of your digital pot, which you have labeled Vcc).

    Therefore, the highest voltage that you can get across W/A/B is your Vdd, which is limited to 2.7-5.5v.

    It also has limited current sink/output capabilities; -1mA to 1mA.

    In order to do what you're attempting, you would need to use a transistor or Darlington, with a resistor on the base to limit the current that would otherwise be demanded from the digital pot.
     
  9. Jan Rune

    Thread Starter Member

    Apr 22, 2008
    17
    0
    Youre so right. I measured the adjust pin to exactly 5.75.
     
  10. Jan Rune

    Thread Starter Member

    Apr 22, 2008
    17
    0
    Sorry for my noob question, but how can use a darlington transistor. I have a few uln2803 (and 04's) laying around here, can somebody give me some pointers/explain the procedure for me?
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Ok - well, a ULN2803 would be what you would want to use if you didn't have a discreet Darlington or a couple of NPN transistors lying around - like 2N2222's, 2N3904's, etc. and a current limiting resistor. But unless you had use for a few more of the channels, it would be kind of a waste.

    A transistor or Darlington will amplify the current that your digital pot can output.
    Connect the A divider to your Vdd (that you have marked Vcc), the B divider to ground, and the W(iper) to a resistor of at least 4.4k Ohms. (5v Vdd -0.6v base-emitter drop =4.4v; 4.4v/1mA max pot current = 4.4k Ohms) The other side of the resistor you can use to supply current to the base of an NPN transistor or Darlington. The collector current of the transistor will be the current supplied by the Wiper output times the hFE of the transistor or Darlington. A 2n2222 or 2n3904 might have an hFE of 100 to 300. A Darlington would have upwards of 1,000; as the gains of the two transistors are multiplied.

    You connect the collector of the transistor/Darlington to the LM317 ADJ pin and the emitter to ground.

    If you're going to use a ULN2803, it already has a 2.7k Ohm limiter in the base circuit. So, instead of a 4.4k resistor, you would need an additional 1.7k Ohm resistor.

    It's OK to go up a little in the resistance, for example 4.4k to 4.7k or 1.7k to 1.8k. Don't go down though, unless you like to burn out your components early.

    You're currently using a 220 Ohm resistor from the output to the adj terminal. An LM317 requires a minimum of 10mA current to guarantee regulation. This is why they usually show a 120 Ohm resistor used for that purpose. If you will never operate your supply with less than a 4.4mA additional load, you can use the 220 Ohm resistor, otherwise you should use a 120 Ohm resistor.
     
  12. Jan Rune

    Thread Starter Member

    Apr 22, 2008
    17
    0
    Thanks for the detailed description SgtWookie!

    Im now able to adjust the LM317. But the whole range from 0-22V is in bout 10 steps (out of 8bit). And 1 step is around 2-3V.

    I didnt have any transistors, so i went for the 2803A approach. This is my schematic so far:

    [​IMG]

    Am i doing anything obvious wrong here?
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I don't think so - but what you're experiencing is either too much gain in the Darlington pair, or not enough gain.

    You say you have about 10 steps worth of adjustment - What is the voltage between W and ground and W and the +5V suppy when you're in between the two?

    If you're reading nearly 5v, then the Darlington pair doesn't have enough gain.
    If it's much lower, there is too much gain.
     
  14. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The circuit does not control the very high voltage gain of the darlington driver.
    It is designed to be an on-off switch, not a linear amplifier.
    Its conduction changes when the temperature changes and every IC will be different.
     
    jslater6 likes this.
  15. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    Audioguru is right. What you need is a digital pot driving a DC amplifier with a gain of about 4. That way the pot could put out a voltage of 0 - 5V and the DC amplifier will put out a voltage of 0 - 20V. If you use an opamp circuit and limit yourself down to 7V output, you could even use the output of the LM317 to power the opamp.

    The opamp would just need to be able to run from 7-20V and preferably be rail to rail output. That should be pretty easy to find.
     
  16. Jan Rune

    Thread Starter Member

    Apr 22, 2008
    17
    0
    I do have a few op amps laying around as well. The max4169 (http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1696) can do the job maybe?

    Im sorry for my lack of knowledge in this area. Im a software developer that just happend to stumble across microcontrollers. And now im hooked ;)

    Could anyone of you guys help me out where to start?

    BTW: Thanks for all your help. I really appriciate it!
     
  17. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    Unfortunately, the MAX4169 will not work. Look at the absolute maximum ratings on page 2. The supply voltage cannot go above 7V.
     
  18. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Well then, here's another option; replace the LM317 with an LM375, which is a power op amp by National Semiconductor. You won't get the thermal overload protection the LM317 has, but you'll get more current output than the LM317 could produce. The stability of the output will largely depend upon the stability of your 5v supply. A 10pF cap has been added to the W output of your digital pot, represented by R1. The 10pF should actually be between 100pF and 500pF. There also needs to be a 1 Ohm damping resistor between the output of the opamp and C1 to prevent oscillation.
     
  19. hardev

    New Member

    Jan 24, 2009
    1
    0
    HI jan Rune

    Instead of digital pot, use all seven darlington of ULN2003 and put different value resistors on them. you can get 64 or even 128 steps of regulated voltage.

    Hardev
     
  20. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,535
Loading...
Thread Status:
Not open for further replies.