+ Reply to Thread
Results 1 to 15 of 15

Thread: Digital Control Voltage using LM317

  1. #1
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Talking Digital Control Voltage using LM317

    I want to make a digital controlling voltage source.

    Can somebody help me to interface LM317 & a PIC micro to change the output voltage of LM317 digitally.

    Thanks.


  2. #2
    mdorian Newbie
    Join Date
    Oct 2008
    Location
    Romania
    Posts
    37

    Default

    How many steps do you need and what is the minimum and maximum output voltage?

  3. #3
    blinkstar88 Newbie
    Join Date
    Jul 2006
    Posts
    45

    Default

    Use digital potentiometer, or the cheapest way is use pwm

  4. #4
    mdorian Newbie
    Join Date
    Oct 2008
    Location
    Romania
    Posts
    37

    Default

    The digital pot have a end to end resistance tolerance of 20% , output voltage must be less than 6.25v ,5v (maximum voltage on the pot ) +1.25 (LM317 regulated voltage).
    See the tipical use of LM317 (fist page) http://www.national.com/ds/LM/LM117.pdf and look at the formula at the bottom of the page:
    The current on the ADJ pin is somewhere between 0 and 100uA , using a 10k digital pot this will giwe an error of R2*Iadj = 10000*0,0001 = 1V , so you have to use for R2 a smaller value than a digital pot can have. If you don't need a very good precision you better use a resistive net connected to the portb this will give you in the worst case an error of 0.6 V

  5. #5
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Hi mdorian I like 0.5V steps. I like the range 1.25V to 12V.What do I have to do with LM317?

  6. #6
    atferrari Good atferrari Good atferrari Good
    Join Date
    Oct 2003
    Location
    Buenos Aires - Argentina
    Posts
    571

    Default Digitally controlled.

    This comes from EDN magazine, online edition. Could not find the note accompanying this.

    I think you can implement and test it with no further help.

    PLease note that depending of the number of steps required you could need to extend the R2R network using more bits.

    Last note: keep in mind that you can play with Rf and Rin of the op amp too.

    Could you post the outcome? (Usually, nobody does)
    Attached Images
    Agustín Tomás
    In theory, there is no difference between theory and practice. In practice, however, there is.

  7. #7
    Diver300 Excellent Diver300 Excellent Diver300 Excellent Diver300 Excellent
    Join Date
    Oct 2007
    Location
    England
    Posts
    1,095

    Default

    Voltage stepper

    You can get a linear control of voltage that way. The LM317 is more difficult to interface.

  8. #8
    Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent
    Join Date
    Jul 2008
    Location
    Out there
    Posts
    1,757

    Default

    I would use the PWM output from the PIC CCP module, then filter it with a 2 stage low pass filter (requires only 2 resistors and 2 caps) then just connect that DC voltage to the Adj pin of the LM317.

    That will be fully linear and PIC output of 0v-5v will give LM317 output of 1.2v-6.2v.

  9. #9
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    Hi thanks for the replies now I got what I have to do.

    I have two options to choose.

    1)Using R2R Ladder Feeding via the opamp to LM317
    2)Using PWM frequency via Low pass filter to LM317.

    Thats great.

    First I'll look into the 2nd option.& after that I'll study the 1st option.

    I can generate any frequency with PWM module.

    Mr RB Can you tell whats the purpose of using low pass filters for this job?Why can't I direct feed the PIC output to the LM317 ADJ pin?
    Last edited by Suraj143; 31st August 2009 at 02:34 AM.

  10. #10
    Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent Mr RB Excellent
    Join Date
    Jul 2008
    Location
    Out there
    Posts
    1,757

    Default

    It depends if you want the LM317 to generate a DC voltage or a nasty pulsating DC voltage...

  11. #11
    mdorian Newbie
    Join Date
    Oct 2008
    Location
    Romania
    Posts
    37

    Default

    1 - The Rds of 2N5461 is temperature dependent so the output voltage will be temperature dependent
    2 - The PWM output is referenced to PIC supply voltage
    If this is a school project I think the idea is to use the precision and the temperature stability of LM317 to build a digital controlled voltage source , both ideas have the same lack , if you multiply (first case) or add (the second case) an imprecise value to a precise value you will have an imprecise value at the end. Sorry for the criticism , I'm still searching for an working solution.

  12. #12
    mdorian Newbie
    Join Date
    Oct 2008
    Location
    Romania
    Posts
    37

    Default

    Improved version of digital pot solution, the Iadj will go through the op amp repeater output , not through R1 R2 divider
    Digital Control Voltage using LM317-digital-pot.jpg
    You will need a calibration procedure because the digital pot have a tolerace of 20%.
    Last edited by mdorian; 31st August 2009 at 08:04 AM.

  13. #13
    Suraj143 Newbie
    Join Date
    Jan 2007
    Location
    South Mald Isld
    Posts
    921

    Default

    I need a smooth DC not pulsating DC.

    mdorian

    Thanks for your contribution.
    In your last diagram where to connect the PIC?

  14. #14
    mdorian Newbie
    Join Date
    Oct 2008
    Location
    Romania
    Posts
    37

    Default

    Sorry , replace R1 with a digital pot http://datasheets.maxim-ic.com/en/ds/MAX5402.pdf and connect the pot through SPI to PIC , i missed the weak point , this will work only for Vout less than 6.5 V otherwise the voltage on the pot will be higher than the maximum voltage admitted ( 5V)

  15. #15
    mdorian Newbie
    Join Date
    Oct 2008
    Location
    Romania
    Posts
    37

    Default

    This digital potentiometer can be used at 16V http://www.analog.com/static/importe...D5291_5292.pdf
    This one has a nominal value of 20k change R2 ~2k
    Is your problem solved?
    Last edited by mdorian; 31st August 2009 at 11:35 AM.

+ Reply to Thread

Similar Threads

  1. LM317 Adjustable Regulator Voltage?
    By bacterozoid in forum General Electronics Chat
    Replies: 2
    Latest: 17th March 2009, 10:52 AM
  2. LM317 control by PIC MCU
    By VictorPS in forum Electronic Projects Design/Ideas/Reviews
    Replies: 5
    Latest: 24th April 2008, 04:56 AM
  3. 1 LM317 to regulate both voltage and current , down to 0V
    By dso310 in forum Electronic Projects Design/Ideas/Reviews
    Replies: 7
    Latest: 2nd June 2005, 03:53 PM
  4. Fan control circuit for cooling a LM317
    By bogdanfirst in forum Electronic Projects Design/Ideas/Reviews
    Replies: 8
    Latest: 1st August 2004, 10:38 AM
  5. voltage regulator , LM317
    By gatman in forum General Electronics Chat
    Replies: 8
    Latest: 8th October 2003, 07:41 AM

Tags for this Thread