Announcement

Collapse
No announcement yet.

How to calculate current in R2 with an LM317

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to calculate current in R2 with an LM317

    Given this circuit:



    How can I calculate IR2?

    #2
    Re: How to calculate current in R2 with an LM317

    IR2=Approximately 1.25/R2

    Comment


      #3
      Re: How to calculate current in R2 with an LM317

      Originally posted by eccerr0r View Post
      IR2=Approximately 1.25/R2
      Regardless of the current being drawn by the load?

      Comment


        #4
        Re: How to calculate current in R2 with an LM317

        Actually I screwed up, should be (1.25/R1 + a bit, usually around 60µA or so), math isn't cooperating with me nowadays. Sigh. I knew something was wrong with the previous answer when I tried dividing by zero, something was definitely wrong... But yes it should not matter what the load is, as long as the LM317 is operating within its design point - both the IC and the entire circuit.
        Last edited by eccerr0r; 05-20-2021, 04:19 PM.

        Comment


          #5
          Re: How to calculate current in R2 with an LM317

          Originally posted by eccerr0r View Post
          Actually I screwed up, should be (1.25/R1 + a bit, usually around 60µA or so), math isn't cooperating with me nowadays. Sigh. I knew something was wrong with the previous answer when I tried dividing by zero, something was definitely wrong... But yes it should not matter what the load is, as long as the LM317 is operating within its design point - both the IC and the entire circuit.
          My calculus instructor back in jr. college had a gift for connecting math concepts to things which anyone could comprehend ... for example when he explained dividing by zero ...

          He said ... picture yourself with a 5-gallon bucket and a hole in the ground that is the same size as the inside of the 5-gallon bucket.

          Next, fill the bucket to the top with water then pour the water into the hole. How many times did you have to fill the bucket in order to fill the hole?

          Next, fill the bucket halfway, and each time it is half full, pour it into the hole then tell me how many times you had to fill the bucket halfway before the hole was full.

          Repeat for ¼ bucket water etc.

          NOW, leave the bucket EMPTY and pour its contents into the hole... how long will it take you to fill the hole when the bucket is empty...

          And THAT is why dividing by zero is infinity!

          Comment


            #6
            Re: How to calculate current in R2 with an LM317

            now the question is....what is this information for?

            Comment


              #7
              Re: How to calculate current in R2 with an LM317

              I R1 is constant as the LM317 always maintains 1.25V between the OUT and ADJ terminals.
              1.25V/datasheet 240R for R1 is 5.2083mA, which must flow through R2 plus the ADJ pin current ~50uA which is so small it is usually ignored to simplify math. Exactly I R2 would be 5.2583mA
              This is from using Kirchoff's current law.

              Note the LM317 needs a minimum load which is why R1 is set to a low value.

              Comment


                #8
                Re: How to calculate current in R2 with an LM317

                Originally posted by eccerr0r View Post
                now the question is....what is this information for?
                Well ... some time ago, I wanted to make my own battery charger circuit for 18650 batteries using an Arduino, a current sensor, and at the time, I wanted to use a LM317 with R2 being an adjustable POT on a chip. That way I could read the current going into the battery, then adjust the voltage being fed to the battery by means of the digital POT. HOWEVER, those digital pots are very limited in the amount of current they can withstand ...

                So how did I get here? Well, I was placing an order on Mouser and I like to try and maximize my shipping fee by getting things I either need or might need in the future and I realized that my LM317 supply was down to 1, so I was looking at various LM317's and looking at the datasheet for one of them and that triggered my recall back to that project and then my wondering about the current in R2 because I still have digital POTs and I might attempt this circuit again only this time ... with more knowledge going into it.

                I don't know at the moment, what the current limits are on the digital POT, but if I attempt it again, I will make sure that the POT can handle what I'm going to ask it to do.

                And now that I'm thinking about it in a little more detail ... this does seem to me to be a crude way to accomplish the charging of a battery.

                But that should answer your question.

                Comment


                  #9
                  Re: How to calculate current in R2 with an LM317

                  Why not limit the current and adjust the voltage it would seem to me to be easier if you are going to use a digital POT you could also have a (switchable current ranges or use a rheostat type of POT ) if you are wanting different current ranges

                  Or use a Servo to control the rheostat type of POT ( if you are going to use a micro controller )
                  with a current sensor ( any way )

                  If I were doing this project this would be the way I would do it
                  I have giving this some thought about doing this type of project myself

                  but my new problem is

                  I now have a new job and work ( 6 days a week until Halloween and then go to 4 days a week ) at night shift 11 pm to 7 or 9 am so I have very little free time any more

                  I am going to go off topic a little bit —>

                  I have a power tool that I use at work that the running time is some what short I have some LG 18650 batteries that I have tested that are 3 amp hour rating that I am going to use instead of the LG 1.5 amp hour ( I have a use for these batteries for another project) that are in it right now these batteries are not bad but every three of four days I have to charge them which is not convenient for me unfortunately this tool only offers this type of battery and no other options

                  https://www.harborfreight.com/12v-li...ery-56566.html

                  This is the tool that I am using

                  https://www.harborfreight.com/12v-li...nly-56564.html

                  The reason I have use this type of tool is I have to limit the torque to the bolts on one of our machines that the bolts are easily stripped if you apply to much torque but if you do apply enough torque then the plates leak product

                  I also have this tool that I have to figure out how to limit it torque the speed controller does have a very small control step range to it so it not convenient for me the way it is now but I need the reach of this tool

                  https://www.harborfreight.com/12v-li...nly-57276.html

                  I will be back on topic
                  Last edited by sam_sam_sam; 05-23-2021, 07:04 AM.
                  9 PC LCD Monitor
                  6 LCD Flat Screen TV
                  30 Desk Top Switching Power Supply
                  10 Battery Charger Switching Power Supply for Power Tool
                  6 18v Lithium Battery Power Boards for Tool Battery Packs
                  1 XBox 360 Switching Power Supply and M Board
                  25 Servo Drives 220/460 3 Phase
                  6 De-soldering Station Switching Power Supply 1 Power Supply
                  1 Dell Mother Board
                  15 Computer Power Supply
                  1 HP Printer Supply & Control Board * lighting finished it *


                  These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                  1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                  2 Hem Saw Computer Stack Board

                  All of these had CAPs POOF
                  All of the mosfet that are taken out by bad caps

                  Comment


                    #10
                    Re: How to calculate current in R2 with an LM317

                    https://duckduckgo.com/?q=lm317+calculator

                    Comment


                      #11
                      Re: How to calculate current in R2 with an LM317

                      STJ
                      I found this from your post earlier

                      I have not seen this type of setup before using this LM317 regulator device


                      Circuit Operation
                      Referring to the shown circuit diagram, the configuration looks pretty straightforward, two LM317 IC s can be seen, one configured in its standard voltage regulator mode and the other in a current control mode.

                      To be precise the upper LM317 forms the current regulator stage while the lower acts like a voltage controller stage.

                      The input supply source is connected across the Vin and ground of the upper current regulator circuit, the output from this stage goes to the input of the lower LM317 variable voltage regulator stage. Basically both the stages are connected in series for implementing a complete foolproof voltage and current regulation for the connected load which is a laser diode in the present case.
                      Attached Files
                      Last edited by sam_sam_sam; 05-23-2021, 07:23 AM.
                      9 PC LCD Monitor
                      6 LCD Flat Screen TV
                      30 Desk Top Switching Power Supply
                      10 Battery Charger Switching Power Supply for Power Tool
                      6 18v Lithium Battery Power Boards for Tool Battery Packs
                      1 XBox 360 Switching Power Supply and M Board
                      25 Servo Drives 220/460 3 Phase
                      6 De-soldering Station Switching Power Supply 1 Power Supply
                      1 Dell Mother Board
                      15 Computer Power Supply
                      1 HP Printer Supply & Control Board * lighting finished it *


                      These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                      1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                      2 Hem Saw Computer Stack Board

                      All of these had CAPs POOF
                      All of the mosfet that are taken out by bad caps

                      Comment


                        #12
                        Re: How to calculate current in R2 with an LM317

                        Now this is the challenge: design a LM317 circuit that allows digital control (128 steps or better) that implements adjustable current limiting to a circuit up to 1A...

                        Comment


                          #13
                          Re: How to calculate current in R2 with an LM317

                          This is one of the topic of Nuts and Volts magazine this month
                          HIGH VOLTAGE OP-AMPS, A CURRENT SENSOR, AND A 32-BIT MICROCONTROLLER: HOW ABOUT A LAB POWER SUPPLY?
                          9 PC LCD Monitor
                          6 LCD Flat Screen TV
                          30 Desk Top Switching Power Supply
                          10 Battery Charger Switching Power Supply for Power Tool
                          6 18v Lithium Battery Power Boards for Tool Battery Packs
                          1 XBox 360 Switching Power Supply and M Board
                          25 Servo Drives 220/460 3 Phase
                          6 De-soldering Station Switching Power Supply 1 Power Supply
                          1 Dell Mother Board
                          15 Computer Power Supply
                          1 HP Printer Supply & Control Board * lighting finished it *


                          These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                          1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                          2 Hem Saw Computer Stack Board

                          All of these had CAPs POOF
                          All of the mosfet that are taken out by bad caps

                          Comment


                            #14
                            Re: How to calculate current in R2 with an LM317

                            i'm pretty sure the whole concept of LM317 current regulation is obsolete for about 30years because of the L200
                            https://duckduckgo.com/?q=l200+regulator

                            Comment


                              #15
                              Re: How to calculate current in R2 with an LM317

                              what has the world come to when one needs a 32-bit microcontroller to build a power supply...

                              and the L200 has the same problem as the LM317 when it comes to microcontroller-controlled current limiting it looks...
                              Last edited by eccerr0r; 05-23-2021, 09:58 AM.

                              Comment


                                #16
                                Re: How to calculate current in R2 with an LM317

                                This is why I bought the computer controlled battery charger which can work off line and if you want the results you just connect it to the computer for the results

                                Yes I know it only for charging batteries but it does work very well for I use it for
                                9 PC LCD Monitor
                                6 LCD Flat Screen TV
                                30 Desk Top Switching Power Supply
                                10 Battery Charger Switching Power Supply for Power Tool
                                6 18v Lithium Battery Power Boards for Tool Battery Packs
                                1 XBox 360 Switching Power Supply and M Board
                                25 Servo Drives 220/460 3 Phase
                                6 De-soldering Station Switching Power Supply 1 Power Supply
                                1 Dell Mother Board
                                15 Computer Power Supply
                                1 HP Printer Supply & Control Board * lighting finished it *


                                These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

                                1 Over Head Crane Current Sensing Board ( VFD Failure Five Years Later )
                                2 Hem Saw Computer Stack Board

                                All of these had CAPs POOF
                                All of the mosfet that are taken out by bad caps

                                Comment


                                  #17
                                  Re: How to calculate current in R2 with an LM317

                                  you can get 128bit digital pot chips with syncronous interface.

                                  Comment


                                    #18
                                    Re: How to calculate current in R2 with an LM317

                                    and neither the synchronous interface or the 128 bit (or do you really mean 128-step) attenuation are the problems encountered with implementing a microcontroller controlled constant current source with the LM317 or L200...

                                    Comment


                                      #19
                                      Re: How to calculate current in R2 with an LM317

                                      This is not what you were asking about in your original post but have you seen this, "Control an LM317T with a PWM signal": https://www.edn.com/control-an-lm317...-a-pwm-signal/
                                      Last edited by R_J; 05-23-2021, 06:45 PM.

                                      Comment


                                        #20
                                        Re: How to calculate current in R2 with an LM317

                                        Yeah voltage control is not too bad. Current control ... now that's another ball of yarn.

                                        Comment

                                        Working...
                                        X