Author Topic: Ideal Voltage Divider - Maths  (Read 353 times)

0 Members and 1 Guest are viewing this topic.

Offline matts-ukTopic starter

  • Contributor
  • Posts: 46
  • Country: gb
  • select * from user where clue = null
Ideal Voltage Divider - Maths
« on: June 09, 2024, 08:48:43 am »
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.pdf


Vin---R1-----R2-----Gnd
          |
          |
          |-----Vsense [MCP130 VDD]

Vin = 8.8V to 6.4V
Vsense ~5.5V to 4.6V
I ~1mA

The 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 = 4K8
Vin = 8.80, Vout = 6.034
Vout = 4.72, Vin = 6.883
Battery range = 8.8 - 6.88 = 1.9V

I'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.

 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19694
  • Country: gb
  • 0999
Re: Ideal Voltage Divider - Maths
« Reply #1 on: June 09, 2024, 09:40:38 am »
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
 
The following users thanked this post: matts-uk

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 531
  • Country: sc
Re: Ideal Voltage Divider - Maths
« Reply #2 on: June 09, 2024, 12:55:18 pm »
Your application might be much - much more 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:
2286383-0

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 VR be reference voltage and VL be battery lower threshold voltage, the equation is:

VR = VL R2 / (R1 + R2)
VR R1 + VR R2 = VL R2
VR R1 = R2 (VL - VR)
R1 = R2 (VL - VR) / VR

Now consider upward going input (i.e. charging), output low, 5k pulled down making it parallel with R2.
Let VH be battery higher threshold voltage, the equation is:

VR = VH 5000R2/(5000+R2) /(5000R2/(5000+R2) +R1)
5000VRR2/(5000+R2) + VRR1 = 5000VHR2/(5000+R2)
5000R1 + R2R1 = 5000VHR2/VR - 5000R2
R1(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 = 2105
R1 = 2105 (6.6 - 4.7) / 4.7 = 851

2286387-1

Eh, 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 equation a lot.
Or just pick suitable supervisor with integrated hysteresis in the first place...

help...
« Last Edit: June 09, 2024, 01:13:48 pm by ArdWar »
 
The following users thanked this post: matts-uk

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 374
  • Country: ie
    • LinkedIn
Re: Ideal Voltage Divider - Maths
« Reply #3 on: June 09, 2024, 07:26:02 pm »
Quote
Is there some clever maths to find ideal or better values for R1, R2 ?
https://xvrxvr.github.io/ResDiv/index.html
 
The following users thanked this post: matts-uk

Offline matts-ukTopic starter

  • Contributor
  • Posts: 46
  • Country: gb
  • select * from user where clue = null
Re: Ideal Voltage Divider - Maths
« Reply #4 on: June 10, 2024, 09:02:44 am »
Your application might be much - much more complex than first meet the eye because your choice of MCP130 instead of MCP120.
...
Moral of the story, pick MCP120 instead of MCP130. It helps simplifying the equation a lot.
Or just pick suitable supervisor with integrated hysteresis in the first place...

Stunning 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.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf