LM317t wrong contstant current  - Page 1
Forum section: electronics / beginners

author: tchinx
author_rank: Newbie
timestamp: May 09, 2022, 10:57:48 am
content: Hello together,I am scratching my head quiet a bitFor a project I needed three different current sources, 4mA, 12mA and 20mA,which I then can connect/disconnect with relays:The 12mA and 20mA sources are made from a LM317t with pots.For the 12mA source, the calculated resistor should, like written in the datasheet, be 104 Ohms.But when I set the potentiometer to 104R I get arround 22mA between MP102 und MP103 (those are just terminals)Do any of you have an idea why?Best regardsPatrick

author: david77
author_rank: Frequent Contributor
timestamp: May 09, 2022, 11:01:35 am
content: Maybe just a drawing error in your schematic, but in the 2nd picture you've got input and output mixed up.

author: strawberry
author_rank: Super Contributor
timestamp: May 09, 2022, 11:05:23 am
content: current sense resistor must drop 1.25V no mater resistor value

author: golden_labels
author_rank: Super Contributor
timestamp: May 09, 2022, 11:39:54 am
content: LM317on Wikipedia, see the pinout drawing. The current regulator section should give you a hint, but remember that is an ideal case, even if the return current is considered. Nothing is perfect and this is why you have a potentiometer there: to adjust the value as needed.

author: JoeyG
author_rank: Regular Contributor
timestamp: May 09, 2022, 12:01:12 pm
content: Compute the current and power through the resistors/pots and see that they don't over heat.Use an array of parallel/series resistors to fine tune the current as pots with significant curret might over heat the carbon tracks

author: MikeK
author_rank: Super Contributor
timestamp: May 09, 2022, 12:25:32 pm
content: A beginner mistake is to try to solve two problems at once. Get rid of the circuit in the first schematic and measure the current regulator across a fixed resistor. Get the current regulator working before adding anything else.

author: timenutgoblin
author_rank: Regular Contributor
timestamp: May 10, 2022, 01:32:17 am
content: Quote from: tchinx on May 09, 2022, 10:57:48 amAccording to the datasheet for the LM317, the absolute maximum ratings suggest a supply voltage of -0.3V < Vs < 40V. If the LM317 regulator is connected with the Vin / Vout terminals reversed then the expected voltage between these terminals would be -0.3V (i.e., internally clamped to -0.3V) producing 4.7V at the Vin terminal and 5V at the Vout terminal. If the measured current was 22mA then the circuit resistance would need to be ~214R. I see 104R for setting the current (for 12mA) in series with the 100R shunt resistance. The remaining 10R is likely the input resistance of the multimeter when measuring in the mA range when connected between MP102 and MP103 test terminals.As already mentioned by the other posters, check the datasheet for the pinout configuration of the LM317 against your circuit.

author: bdunham7
author_rank: Super Contributor
timestamp: May 10, 2022, 01:55:02 am
content: A couple of suggestions:1) make sure everything is hooked up correctly, as it has been pointed out that your drawing has a major flaw2) perhaps consider using a different LDO regulator, as you are getting close to the minimum load current for the LM317. That and 5V input doesn't give you a lot of compliance voltage for your load.3) consider simplifying your design to use 1 LDO regulator and then use the relays to switch in the correct resistor for the desired current. If you were clever, you could do it with two relays and three resistor/pot combinations.

author: MikeK
author_rank: Super Contributor
timestamp: May 10, 2022, 02:47:52 am
content: You can "get around" the minimum current needed by putting a load resistor in parallel (from LM317 output to ground). A resistor *and* an LED would make it an indicator.

author: pqass
author_rank: Super Contributor
timestamp: May 10, 2022, 04:41:50 am
content: Instead of LM317s and relays, consider using a triplet of 2PNP current sources in parallel. See attached.Each can be enabled via an NPN individually or in any combination. Click on the L or H in the simulation.The current is set via emitter resistor using the formula: R=0.65/currentBut the value you will require won't likely be a standard resistor so use series and/or parallel combinations to fine tune.Seehttps://www.qsl.net/in3otd/parallr.htmlto help pick a parallel e24 series combination.For more on current sources or sinks see:https://sound-au.com/ism.htm#p5Play with the simulation here:http://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWcMBMcUHYMGZIA4UA2ATmIxAUgoqoQFMBaMMAKABcQAWPKsDQrmAF8BVJlGgpOhQlmKVKQlCmzYQDFLDgZIxPNMJ5snbPQbkwcEABM6AMwCGAVwA2bdoOHEUXHuG9Q6hCc0BgIqihg+sScmNjEagyoBnIKkEoqapZUto6u7gBOvrz8xSDEouA8LADunuCEVJxC5aK19RVlnZAs2DogeC1SVIMC2PrggT0A5gMt45xzApxWVD1FzV4+myDYaIHZcCyzO6bb84ZTLABKHcst3FNctE8wCB7Yl6r3Y58H6iEwhE+JwwpB+NgwEgQnhwnsQRgyIjOJxGMRkDl7M43Cwip88Ls-ig8ATvgd4CwADIgYmkokIX6VKiOFwAZzo1B61NpzyoKAZvKeLPZnNxFGJgp5KzWGJ6HAQEulFFKSt4ANCcMiJMsoMg0OgsOBJPwuHwGDRGJsWPyx2VPztXD2VyKCFKYACrrGE148B6dU9rRAhBWgb9DqEtFK3TFwZKAljoYohA8AfdPgTacC4kBmvdBAqhggSUkKURCCipkgmAwPmyVryOI4GdKqdKYggyRkqQrlGrPgYhGg5b0SliKPLkMYBLruWx7g4o3ApTCtbbQQksj2BH4snwxEghCQxYQlD2B4Q3H4QMts5tHBX-h8i8z7d2oQhFVd+jAJhWR5gm7EpgXZ7ueN7WjiRTPqUi7dDSGDtA+EYgA+0Z1KhAiwW0RRIQED4ogSPoUrM+F+PhcFyihkCLNIiz4cG-wAao1HAWa8jNIR0CHmgeAYJw8iIroCDyOBDaFFRNEMVKDFEVyNIklwUkCrR-zChySBhtwfIhgmwxQO0ukhouelhsZ+BLDSIZhgqBKdAGaFBgpnQYfpLoSiI4q2ZUhiaX4Hk2UubT+hKnRaaGMYKR5hheYEmBhtFgYJg5zbxpFbYGSGPFBplVntGFWX5blQA