Ideal Voltage Divider - Maths - Page 1
Forum section: electronics / beginners

author: matts-uk
author_rank: Contributor
timestamp: June 09, 2024, 08:48:43 am
content: I really should have paid more attention in algebra lessons.What I am trying to do is shut down a Raspberry Pi before a 2S battery pack is completely exhausted. I have a salvaged MCP130 voltage supervisor IC which I hoped might do the job. The problem I have run into is providing a useful range of battery voltage while constraining the sense voltage within safe limits.https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/11184d.pdfVin---R1-----R2-----Gnd|||-----Vsense [MCP130 VDD]Vin = 8.8V to 6.4VVsense ~5.5V to 4.6VI ~1mAThe VDD pin is rated at 5.5V nominal with an absolute max of 7V. I'm prepared to push VDD to ~6V, as Vin is unlikely to be at 8.8V for long. The rated lower limit of Vtrip is 4.6V. During room temperature tests Vtrip has reliably been 4.71V. The divider needs to allow the MCP130 to source about 500uA to 1ma.Starting with the current requirement and guessing, I came up with:R1 = 2K2, R2 = 4K8Vin = 8.80, Vout = 6.034Vout = 4.72, Vin = 6.883Battery range = 8.8 - 6.88 = 1.9VI'm sorta OK with those values but suspect I may run into a hysteresis issue - The battery fails to re-charge to a sufficiently high voltage for the the RPI to switch back on.So.Is there some clever maths to find ideal or better values for R1, R2 ?Is there a better way to achieve the result. The constraints are that I am building on perf board and there is not a great deal of room for additional components ?Any help is greatly appreciated.

author: Zero999
author_rank: Super Contributor
timestamp: June 09, 2024, 09:40:38 am
content: I use an online calculator tool to generate optimum values. It can be set to give standard component values, so you don't get 4k8 which no one makes.http://sim.okawa-denshi.jp/en/teikokeisan.htm

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 09, 2024, 12:55:18 pm
content: Your application might be much -muchmore complex than first meet the eye because your choice of MCP130 instead of MCP120. The integrated 5k pullup resistor put hard constrain on one leg of the equation.Let consider the following equivalent circuit:Let's ignore IQ,I ain't doing this shit again.Consider the downward going input (i.e. discharging), output high, 5k pullup floating and is out of equation.Let VRbe reference voltage and VLbe battery lower threshold voltage, the equation is:VR= VLR2/ (R1+ R2)VRR1+ VRR2= VLR2VRR1= R2(VL- VR)R1= R2(VL- VR) / VRNow consider upward going input (i.e. charging), output low, 5k pulled down making it parallel with R2.Let VHbe battery higher threshold voltage, the equation is:VR= VH5000R2/(5000+R2) /(5000R2/(5000+R2) +R1)5000VRR2/(5000+R2) + VRR1= 5000VHR2/(5000+R2)5000R1+ R2R1= 5000VHR2/VR- 5000R2R1(5000+R2) = 5000R2(VH/VR- 1)R1= 5000R2(VH/VR- 1)/(5000+R2)Eh, whatever...Now consider the scenario:VR= 4.7 V (you measure it)VL= 6.6 V (3.3V per cell, a bit conservative here since I'm not sure what battery you use that their max Vcell is 4.4V)VH= 7.4 V (3.7V per cell should be enough to start operating again)Solving the two equations:R2(6.6-4.7)/4.7 = 5000R2(7.4/4.7 - 1)/(5000 + R2)Oh shit, quadratic...Let there be magic...R2= 2105R1= 2105 (6.6 - 4.7) / 4.7 = 851Eh, close enough. Pick closest standard value or whatever. 2k2 and 820.Notice that those resistor values are way too small for a battery operated system. It'll drain the battery in no time. You can increase the values by widening the hysteresis (increasing source impedance allowing the 5k to affect input more). Even then with 6.6V and 7.8V thresholds they still have uncomfortably small value (3k and 1k2).Moral of the story, pick MCP120 instead of MCP130. It helps simplifying the equationa lot.Or just pick suitable supervisor with integrated hysteresis in the first place...help...

author: xvr
author_rank: Frequent Contributor
timestamp: June 09, 2024, 07:26:02 pm
content: Quotehttps://xvrxvr.github.io/ResDiv/index.html

author: matts-uk
author_rank: Contributor
timestamp: June 10, 2024, 09:02:44 am
content: Quote from: ArdWar on June 09, 2024, 12:55:18 pmStunning work. Can't thank you enough for the time and effort you put in. I knew there was a quadratic in there but it's 40 years since I did one of those. I had completely neglected the influence of the pull up so thanks again. The equivalent cirtcuit made it easy to see.I took a look for an MCP120 but not finding one that is affordable. I'm working on a one-off dumpster project and aiming to keep the component cost under a tenner.