Why is my lm317 regulating the wrong voltage - Page 1
Forum section: electronics / beginners

author: techninja80
author_rank: Regular Contributor
timestamp: August 24, 2021, 06:14:42 pm
content: So I attached my setup, I am just testing out some voltage regulators I picked up in one of those voltage regulator packs on amazon. None of them go below 5V except for the LM317. So I wired it up as the datasheet suggests, and attempted to confirm their formula. I am using 4708, and 327 ohms resistors I labeled them so you can see how they are being used. I am supplying 5v, and my output is 2.62V. I should be getting 1.33V according to this datasheethttps://pdf1.alldatasheet.com/datasheet-pdf/view/22749/STMICROELECTRONICS/LM317.htmlI know I am doing something wrong, can one of you Guru's gently correct my mistake, and let me know where I went wrong.

author: Ian.M
author_rank: Super Contributor
timestamp: August 24, 2021, 06:36:31 pm
content: The LM317 has a specified min. load current of 10mA, and a min. reference voltage of 1.2V, therefore in the absence of any other load, by Ohm's Law its upper feedback divider resistor must always be 120 ohms or less. Your choice of a 4708 ohm resistor at most draws fractionally over a quarter of a mA load current, over an order of magnitude out of spec even for a LM117 (5mA load current) let alone a LM317.Draw more current to exceed 10mA total, e.g. by adding a 120R load resistor, and *IF* your connections are otherwise OK, the voltage should come good to that the divider calculation gives.Edit: The big resistor was on top!

author: drvtech
author_rank: Regular Contributor
timestamp: August 24, 2021, 06:41:43 pm
content: Aren't your resistors swapped? Should have the 330 from output to ref and the 4k7 down to ground

author: james_s
author_rank: Super Contributor
timestamp: August 24, 2021, 06:41:58 pm
content: You also need capacitors across the input and output for stability. Also what is the lower resistor connected to? I see it plugging into the bottom most strip on your breadboard while the wires connect to the next strip up. Is that bottom strip tied to ground outside the frame of the photo?

author: techninja80
author_rank: Regular Contributor
timestamp: August 24, 2021, 06:52:36 pm
content: Quote from: drvtech on August 24, 2021, 06:41:43 pmWell, thank you sir. I swapped them around, and wham bam thank you man it dropped down to 1.5. I also had the issue that when I increased the voltage, the so-called regulator was also raising voltage. This effect has been greatly removed since swapping them.

author: drvtech
author_rank: Regular Contributor
timestamp: August 24, 2021, 06:56:35 pm
content: Yes the way you had the resistors was for an output of 19.25 so the output would track the input until you got to about 22V

author: techninja80
author_rank: Regular Contributor
timestamp: August 24, 2021, 07:00:50 pm
content: Quote from: Ian.M on August 24, 2021, 06:36:31 pmHaha I know it seems silly to you but to a new brain like myself, I actually thought it made sense. I was trying to draw down the voltage so I figured that the bigger resister should be on the threshold pin. I.E. make it smaller, and the lil one on the output, pin. I.E. Output more. Well you guys were here to slap me in the right direction. Now I get to learn more. Thanks again guys.

author: Ian.M
author_rank: Super Contributor
timestamp: August 24, 2021, 07:06:20 pm
content: *MANY* regulators work the way you were originally expecting. Anything with separate ground and feedback pins is likely to work that way as their internal reference is usually relative to ground. The LM317 and other adjustable 3 pin regulators are a little unusual to a novice in that their reference is relative to the output terminal so the feedback divider is 'upside-down'.

author: bobbydazzler
author_rank: Regular Contributor
timestamp: August 25, 2021, 12:56:26 am
content: The resistor between output/adjust pins needs to be under 1k to guarantee minimum load current, I'd go at least 240ohms or lower myself. Also sometimes breadboard doesn't make good contact so measure the resistance between output/adjust pins(4700ohm in your case), and adjust/ground(327ohms).

author: Ian.M
author_rank: Super Contributor
timestamp: August 25, 2021, 01:22:42 am
content: Quote from: bobbydazzler on August 25, 2021, 12:56:26 amReally? Please explain how *you* can get 10mA through a 1K resistor with at most 1.3V across it!240 ohms will always meet the spec for the LM117 minimum load current of 5mA but is only half the worst case 10mA needed for a LM317. Many will work at 5mA load current with close enough to the correct output voltage, but some will not.

author: bobbydazzler
author_rank: Regular Contributor
timestamp: August 25, 2021, 01:32:01 am
content: Quote from: Ian.M on August 25, 2021, 01:22:42 amOk I was just recalling what I thought I've read in datasheets, maybe I was getting lm117 mixed up with lm317. I always use 100-120ohms for the output/adjust resistor myself and that works fine. I will recommend 100ohms from now to be safe.

author: Ian.M
author_rank: Super Contributor
timestamp: August 25, 2021, 06:51:00 am
content: 120 ohms will always work, so unless you are using ancient coarse tolerance resistors where you have to spec 100 ohms to ensure it can never be over 120, don't bother with lower value resistors, stick to 120 ohms as its a close match to the reference voltage giving very close to 10mA divider current, it also makes the maths easier - depending on the regulator's precise reference voltage (and assuming a precision resistor), you know it will be Rlower/100+1.2V as the lower limit and 8.33% more as the upper limit.It is however *possible* to use higher value resistors at the top of the divider - you just have to satisfy the min. load current requirement externally, perhaps by adding a 'power' LED.

author: Vovk_Z
author_rank: Super Contributor
timestamp: August 25, 2021, 11:11:01 am
content: Quote from: Ian.M on August 25, 2021, 06:51:00 am- but in a real life, in my experience, most 317 work with >=2 mA current quite well (up to 470-560 R), when adequately bypassed. I'm not talking about military or aerospace temperatures, I'm talking about home-office use.

author: Ian.M
author_rank: Super Contributor
timestamp: August 25, 2021, 10:11:07 pm
content: I did say something similar a few posts ago: "Many will work at 5mA load current with close enough to the correct output voltage, but some will not."Certainly most behave more like the LM117, happy at 5mA or even a bit lower, and you can probably build a dozen projects with genuine LM317s and 1st world clones with 240 ohm upper resistors without running into trouble, however the O.P.'s using a voltage regulator assortment off Amazon, and if he tests with out of spec min. load current he's got no way of telling if its a bad regulator (or whole batch of them) that he should request a replacement for, or if its the fault of his circuit.

author: Zero999
author_rank: Super Contributor
timestamp: August 26, 2021, 09:09:16 pm
content: If it's a low power application, <100mA and only need it to dissipate <700mW, use the LM317L, which is cheaper and works with a minimum load of 2.5mA.https://www.ti.com/lit/ds/symlink/lm317l.pdf

author: Bassman59
author_rank: Super Contributor
timestamp: August 26, 2021, 09:55:09 pm
content: Quote from: Vovk_Z on August 25, 2021, 11:11:01 amWhy not just design to what the data sheet says WILL work instead of using your "experience" to guide you?It's just a frickin' resistor. Use the 120 ohm part and move on.

author: james_s
author_rank: Super Contributor
timestamp: August 27, 2021, 07:13:30 am
content: Sometimes you don't have the right value on hand, sometimes you might want to minimize quiescent draw, there are reasons to use something different, it's just a good idea to follow the guidelines when you have no reason not to.

author: Zero999
author_rank: Super Contributor
timestamp: August 27, 2021, 07:48:15 am
content: Quote from: Vovk_Z on August 25, 2021, 11:11:01 amCould it be that the circuits you've used the LM317 have always drawn >5mA, so it wasn't an issue?Anyway, not following the manufacture's instructions for best practise asking for trouble. I certainly wouldn't do it for anything which is going to be mass produced and even if it's a one off, it's a bad habit to get into, because it could result wasting time fault finding.

author: Ian.M
author_rank: Super Contributor
timestamp: August 27, 2021, 08:39:14 am
content: Yes, you can waste an incredible amount of time troubleshooting 'select on test' and 'typically works' designs, and if several more units are needed, whoever gets the job (including yourself) will probably hate you!A long time ago a very experienced EEE told me: "Take a copy of the datasheet and a black marker, and black out the 'typ.' column in the specs. Design to what's left!" The same also goes for bullet pointed performance claims on the first page, which are often marketing puff only achievable if there is a R in the month with absolutely perfect tongue angle!