Adjustable linear regulator math help? Did ChatGPT answer it correctly?  - Page 1
Forum section: electronics / beginners

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: September 25, 2023, 12:48:23 am
content: Linear regulator in question: TheLR12https://ww1.microchip.com/downloads/en/Appnotes/AN-H40.pdfPer datasheet,to calculate VOUT: VOUT = 1.2V (1 + R2/R1) + 10μA * R2I want VOUT to be 10V, and R2 to be 10k (10,000) ohm.ChatGPT says the answer of R1 is "≈ 1361.11 Ω", is that correct? When using an online calculator for the LM317 (which has a 50μA bias current instead of the LR12's 10μA), it says that R1 would be "1428.57..." Ω.I'm pretty bad at math, but what's confusing me about the equation is the "10μA" part. Does this need to be converted to amps, or can I simply disregard the "μA".This isn't for school but instead self-learning.

author: RFDx
author_rank: Regular Contributor
timestamp: September 25, 2023, 01:15:02 am
content: Quote from: LooseJunkHater on September 25, 2023, 12:48:23 amNo, but close enough for an "AI".R1 = (1,2V * R2) / (Uout - 1,2V - (10uA * R2)) = 1,379 kOhmQuote from: LooseJunkHater on September 25, 2023, 12:48:23 amYes, convert uA to A and kOhm to Ohm.

author: ataradov
author_rank: Super Contributor
timestamp: September 25, 2023, 01:15:21 am
content: The units must make sense, of course. At the same time that 10uA won't make a significant difference.Also, use real tools, not chatgpt -https://www.wolframalpha.com/input?i=10+%3D+1.2+%281+%2B+10e3%2FR1%29+%2B+10e-6*10e3

author: EPAIII
author_rank: Super Contributor
timestamp: September 25, 2023, 01:46:38 am
content: You can NEVER disregard the units in a calculation. Not for this one. Not for any one.The units must agree from one end of the equation to the other. This is so true that I often deduced equations on college exams from the units involved.Velocity is measured in a unit of distance PER a unit of time. "PER" is another word for "divided by". So a velocity calculation should produce a final unit that consists of a unit of distance divided by a unit of time. If you travel 50 feet in 10 seconds you divide (50 feet) by (10 seconds) and get 5 feet/second or 5 feet per second.That is how the math works. The numbers work from one side of the equation to the other AND the units also work from one side to the other. You can't put in feet and then say the answer is in meters per second. Not unless you use a conversion constant which would also have UNITS: in this case meters/foot.Your equation has two terms on the right side: 1.2V (1 + R2/R1) and 10μA * R2. They are joined with a plus sign (+). Before you can add them together they must be in the same units. In this case that would most likely be Volts. So to calculate a value with that equation you would proceed as follows:You start with the part that is the deepest in the calculation hierarchy; R2/R1. Since both of these are resistance values they have units of Ohms. And Ohms divided by Ohms equals 1 or, as they often say, they cancel out. And you get a pure number with no units.Then that pure, unit-less number is added to 1, another unit-less number and you still have a unit-less number.Then that pure number is multiplied by 1.2 Volts which is a pure number multiplied by a number of Volts so the units for the product are Volts. And that gives you the first term of your calculation.The second term is 10μA * R2. R2 is a resistance and again, that means the units are Ohms. 10 uA is a current, but it is NOT in the basic unit of current, the Ampere. So before you can multiply it by the resistance in Ohms, you must convert it to that basic unit, Amperes. The conversion factor is given by 1 Ampere = 1,000,000 uAs. Or a uA = 1/1,000,000 A. And plugging that into the original expression (10μA * R2) we get:10(1/1,000,000 A) * R2and that equals10/1,000,000 A * R2Or1/100,000 A * R2You can ignore this if you like, but the more mathematical way of writing this with exponential notation would be: 10^-5 A * R2Since from Ohm's law E = IR, Volts (the E) equals Amperes (the I) * Ohms (the R).So, with R2 expressed in Ohms, the second term becomes:1/100,000 A * R2And since Amperes multiplied by Ohms equals Volts, the value has the unit of Volts.With that, both terms are in the SAME UNIT, Volts and they can be properly added together for the final answer.That may be a bit of a tedious explanation, but it illustrates how the units of a mathematical expression do and MUST all work out just as the numbers in that expression do.Now many people will look at the micro Amps (uA) in that expression and say that means you can multiply by Ohms and get micro Volts (uV). That is a shortcut that comes from a complete understanding of what I said above. And also a realization that if the first part of the expression gives an answer in Volts (example: 3.72 Volts) while you calculate the second part with micro Amps thereby getting an answer in micro Volts (example 14.2 uV) then, when you add the two parts together you must take that difference in units into account, like this:3.72 V + 14.2 uV = 3.7200142 VI simply converted the micro Volts (14.2) to full Volts (0.0000142) as I entered them on the right side of the equation. If you understood what I explained above, then you should also understand this shortcut.

author: RFDx
author_rank: Regular Contributor
timestamp: September 25, 2023, 02:41:46 am
content: Quote from: ataradov on September 25, 2023, 01:15:21 amYour link is missing R2(10k) at the end:https://www.wolframalpha.com/input?i=10+%3D+1.2+%281+%2B+10e3%2FR1%29+%2B+10e-6+*+10e3

author: ataradov
author_rank: Super Contributor
timestamp: September 25, 2023, 02:45:41 am
content: Yes, forum broke it, and I only fixed the visual part, not the actual link. Fixed in the original message too.

author: LooseJunkHater
author_rank: Frequent Contributor
timestamp: September 25, 2023, 08:01:03 pm
content: Awesome, thank you all for the help!