Really struggling with limiting potentiometer range - Page 1
Forum section: electronics / projects

author: Pentoad
author_rank: Regular Contributor
timestamp: January 25, 2020, 06:00:54 pm
content: I am trying to limit the range of a trimmer, R3 so that when the supply voltage is 4.2 and its wiper is closest to R4, or 0%, the output voltage is 1.225v. Additionally, when the supply voltage is 3.81v and the trimmer is set closest to R2, or 100%, the output voltage should be 1.225. I've tried several different calculations and methods but none have given anywhere near the desired results in the simulations. How would I determine what resistors to use for R2 and R4 to give me that 3.81 to 4.2 adjustment range? The 1.225v is the voltage of my reference and when the output of R3 goes even a millivolt above 1.225v, it triggers a comparator and so the current on the output would only be a few nano amps.

author: magic
author_rank: Super Contributor
timestamp: January 25, 2020, 06:25:11 pm
content: Pretty simple. You want the output/input ratio to vary between1.225/3.81 = .32152230971.225/4.2 = .29166666660.29 is the lower limit and the proportion of the whole divider that goes permanently into R2.Then 0.32-0.29=0.03 is adjustable and goes into R3.The rest is R4.Then all numbers need to be scaled proportionally, for example by 333 times to use a 10Ω potentiometer.

author: Pentoad
author_rank: Regular Contributor
timestamp: January 25, 2020, 08:22:29 pm
content: I tried your suggestion and it is not working right and I am beginning to think there may be an issue with the simulation program. As you can see, I can get the lower threshold to work well but the higher threshold is needing 56.5 volts to give 1.225.

author: mikerj
author_rank: Super Contributor
timestamp: January 25, 2020, 08:58:51 pm
content: Quote from: Pentoad on January 25, 2020, 08:22:29 pmThe resistor values are correct, so I share your thoughts about the simulator. I notice you have the pot set to 99.9% for the case that works correctly; is there a reason for not setting 100%? i.e. does the simulator have problems with 100% and if so does it also have issues with 0%?

author: Pentoad
author_rank: Regular Contributor
timestamp: January 25, 2020, 10:47:52 pm
content: The simulator doesn't allow 100%, it only allows you to get as close as possible to 100. 0% works fine so I think I will submit a bug report to them.

author: magic
author_rank: Super Contributor
timestamp: January 25, 2020, 10:58:49 pm
content: But 0 doesn't work fine, you get wrong results. The question is, what happens if you try 0.01 instead of 0

author: james_s
author_rank: Super Contributor
timestamp: January 26, 2020, 01:19:55 am
content: Try this simulator, I've had good luck with it:https://www.falstad.com/circuit/Or just wire it up on a breadboard and try it out in the real world if you aren't sure of your math. You can even use pots for all three for testing purposes, then you can tweak all the values as much as you want.

author: Pentoad
author_rank: Regular Contributor
timestamp: January 26, 2020, 11:37:03 am
content: I have done more tests and have found that the Easyeda simulator is bug ridden to the point of being useless. For example, just look at this. Will try the falstad simulator. 0.01 resulted in the circuit simulating properly and the values calculated were correct.

author: magic
author_rank: Super Contributor
timestamp: January 26, 2020, 11:51:06 am
content: Download LTspice already

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 26, 2020, 04:10:30 pm
content: You don't need a simulator for that. (But Easyeda sucks anyway. Online tools are for the birds.)Just put it in equations:4.2*R4/(R2+R3+R4) = 1.2253.81*(R3+R4)/(R2+R3+R4) = 1.225Solving this yields:R2 = 2068*R4/889R3 = 13*R4/127If you want R3 to be the fixed value from which to derive the two others (which makes sense as you'll have a lot less choice for pot. values):R4 = 127*R3/13R2 = 2068*R3/91(Then of course you'll have to select the closest values that exist in a given E series.)

author: Vovk_Z
author_rank: Super Contributor
timestamp: January 26, 2020, 04:21:02 pm
content: There is may be something wrong with voltmeter XMM2 input impedance.

author: Renate
author_rank: Super Contributor
timestamp: January 26, 2020, 04:31:25 pm
content: The problem is, your simulator is taking "1M" as one milliohm.I don't know if it's misinterpreting "500R".Try putting straight numbers on everything.

author: Zero999
author_rank: Super Contributor
timestamp: January 26, 2020, 04:58:01 pm
content: SPICE doesn't like zero Ohm resistors, which is why I imagine it causes problems. It also somewhat mirrors reality, since the potentiometer will always have a tiny wiper resistance.As mentioned above, there's no need to simulate this, just work it out. In reality, you'll probably require some out of range operation, due to component tolerances. Potentiometers typically have a very poor tolerance of 10% or worse. One way round this is to connect another, much lower value 1% tolerance resistor in parallel with the potentiometer, but it will result in extra power draw.

author: Nerull
author_rank: Frequent Contributor
timestamp: January 26, 2020, 06:18:59 pm
content: SPICE also isn't case sensitive, you'll have the same M/m problem in LTSpice. SPICE requires a 5M resistor to be written as 5MEG.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 26, 2020, 06:34:09 pm
content: Quote from: Nerull on January 26, 2020, 06:18:59 pmIndeed.

author: bson
author_rank: Unknown
timestamp: January 27, 2020, 07:34:43 pm
content: Quote from: Nerull on January 26, 2020, 06:18:59 pmThat's the because the punch cards it was designed run off of didn't have mixed case.

author: Pentoad
author_rank: Regular Contributor
timestamp: March 10, 2020, 08:05:17 pm
content: Quote from: SiliconWizard on January 26, 2020, 04:10:30 pmHello all, been away from the project for a long time due to other stuff coming up. I am still really struggling with the maths here, for example, I have no idea where 2068 is coming from. Is there a for dummies way this can be explained or a resistor calculator I could use? Sorry for being so dense.

author: ve7xen
author_rank: Super Contributor
timestamp: March 10, 2020, 08:47:28 pm
content: Wolfram Alpha can solve the system of equations for you, if you've forgotten your high school algebra. Where this is coming from is rearranging one of the equations for R3 (put all R3s on LHS) and the other for R2, and then substituting them into each other and simplifying, so they both become dependent only on R4. Once you do that you will arrive at the equations SiliconWizard gives.If you want to solve this with WolframAlpha, you enter itlike this:QuoteIt can alsosolve for the resistor valuestoo if you add that constraint:Quote

author: Zero999
author_rank: Super Contributor
timestamp: March 10, 2020, 08:52:40 pm
content: I would start by working out the voltage across the potentiometer, then the current and determine the other resistor values from that.Vupper= 3.81VVlower= 1.225VVR2= Vupper-Vlower= 3.81-1.225 = 2.585IR2= V/R = 2.585/500 = 0.00517 = 5.17*10-3A = 5.17mAIR1= IR2= IR3as they're all in series.VR1= V1- Vupper= 4.2-3.81 = 0.39VR1 = V/I = 0.39/5.17*10-3= 75.435RVR3= Vlower= 1.225VR3 = 1.225/5.17*10-3= 236.943RI would set R1 and R3 to lower values, to account for component tolerances, especially the potentiometer which probably has a tolerance of 10% or worse. I'd go for 220R for R1 and 68R for R3. Another thing you could do is connect a 100R 1% tolerance resistor in parallel with the potentiometer and recalculate all of the other values. The 1% resistor will reduce the overall tolerance of the potentiometer.

author: Pentoad
author_rank: Regular Contributor
timestamp: March 10, 2020, 10:00:06 pm
content: Quote from: ve7xen on March 10, 2020, 08:47:28 pm

author: ArthurDent
author_rank: Super Contributor
timestamp: March 10, 2020, 10:00:55 pm
content: Try using 11,362 ohms for the upper resistor.