Electronics > Beginners

Voltage Divider Power Question

<< < (4/6) > >>

bryancostanich:
Ok, so does it make sense to recommend that you use the largest total resistance in a voltage divider that still allows for the necessary current the ADC needs?

In my case, I'm using an STM32F4 chip, and the data sheet says that the ADC has the following characteristics:

ADC Sampling Switch Resistance : 6Kohms
External Input Impedance : 50kohms
Internal Sample and Hold Capacitor : 4pF

So the peak current draw would be:

I = 3.3V / 6000 = 0.0006 = .6mA

Therefore,

R = V / I
R = 3.3V / 0.0006A = 5,500ohms = 5.5kohms

But then the problem I see there is that the total resistance is less than the sampling resistance. Wouldn't that blow my voltage divider math out of the water?

suicidaleggroll:
I think you're confused about what the ADC switch resistance and input impedance mean.  Skip to section 4.4-4.5 of this document:
http://www.st.com/content/ccc/resource/technical/document/application_note/9d/56/66/74/4e/97/48/93/CD00004444.pdf/files/CD00004444.pdf/jcr:content/translations/en.CD00004444.pdf

Essentially a higher source impedance means you have to run your ADC slower to give the internal sample and hold capacitor time to charge up.  Using a cap on the analog line will help with this as it can supply the current "surge" into the ADC, as long as you give it time to charge back up before the next read by slowing down your ADC sampling speed.

You still haven't told us what sampling rate you need.  If you need it to sample quickly, then you will not be able to do it with a simple voltage divider unless you want to burn a lot of power.  As has been said many times before, you'd want to add an op-amp to buffer the output of the voltage divider and drive the ADC.

bryancostanich:
I don't know what the sampling frequency is set to. It's a Netduino with an STMF4 running at 168MHz.  As I understand, the sampling frequency is set in software; but I don't know what it's been set to.

It's so strange to me that this has been such a rabbit hole. There are all these tutorials out there [here is one](https://learn.sparkfun.com/tutorials/voltage-dividers) that say, "hey if you have a sensor with a 5V output and you need 3.3V; no problem, just use a voltage divider."

But in digging in, that doesn't seem to hold the scrutiny of the folks here.  :-//

After reading and studying, I get a lot of what's been said here, but it's totally contradictory to what I'm reading in these tutorials.

rstofer:
If this was an easy problem to solve, with a universally correct answer, they would have told us in the first week of EE school and we could have taken the next 4 years off.

You need to use the formula to find the MINIMUM driving impedance necessary for the operating conditions.  If the conditions change, the result of the calculation changes.  As has been pointed out above, this type of voltage divider is FAR LESS than a good idea because the parallel combination of the bottom divider resistor and the ADC input impedance changes with the conditions.  This means that the voltage divider ratio changes with the operating conditions.  So, not knowing the operating conditions means you can't solve the equation and, therefore, you can't come up with an appropriate divider.

But that's a good thing because the divider is doing nothing for accuracy.  Furthermore, your sensor may not want to drive a relatively low impedance divider.  Or, it might not be able to achieve accuracy driving it.

What you really want to do is use a 3.3V rail-to-rail input-output op amp between your sensor and the ADC.  The sensor will see an essentially infinite load impedance (no current flow) and the ADC will see essentially a zero ohm driving impedance.  It doesn't get any better than this!

If you don't know the operating conditions of the ADC, you should be looking into it.  It all comes down to accuracy.  If you don't need accuracy, any pair of resistors will do something.  It won't be right, of course, but you will get results similar to what the folks on the Internet are getting.

Excel can do the calculations for the driving impedance (sensor) feeding into the divider with the parallel bottom resistor.  Then you can iterate over sensor voltage and see what kind of graph you get.  You could also model it in LTspice.  But sooner or later, you're going to need to know the operating conditions.

ETA:  The operating condition (frequency of conversions) could be as simple as "every time I loop through this C code, I grab one sample".  If so, the calculation could be quite simple.  Where the formula is really important is when you are taking periodic readings at a fast rate.  Maybe a timer kicks off readings and the DMA channel stuffs them into memory.  That might be a lot faster cycle.

rstofer:

--- Quote from: bryancostanich on September 26, 2017, 09:18:56 pm ---
After reading and studying, I get a lot of what's been said here, but it's totally contradictory to what I'm reading in these tutorials.


--- End quote ---

Yup! 

Most of us have seen the tutorials but some of us don't sign right up.  When ST can't give you a definitive input impedance because it varies with frequency of operation, how can you possibly expect to calculate the right divider?  That ADC input impedance is in parallel with the bottom divider resistor.  It used to be that the manufacturer gave us the worst case input impedance or, better yet, told us what the source impedance had to be less than.  ST, OTOH, has chosen to give us the real equation and left it to us to match our design.

The resistor divider equation is only accurate for ONE value of ADC input impedance and that impedance needs to be known to as high a degree of accuracy as the ADC itself.  That also implies that our divider has to be very accurate (0.1% resistors).

Yes, you can use the 'rule of thumb' to have 10x as much divider current as you expect to have ADC input current, and it might actually work, it could still not be accurate over frequency,  Or the sensor won't like it...  The capacitor at the ADC input is also workable as long as it can fully recharge between readings.  Probably 6 time constants might work out but 10 time constants would be better.  This implies that a big capacitor needs a LONG time to recharge and a small capacitor might not hold enough charge to help with driving impedance.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod