SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
User avatar
By roach
#18455
ohararp wrote:Put a 10K or 100k resistor in series (current limiting) and you should be fine.
On the face of it, this sounds perfect, but closer examination of the datasheet for my uC (LPC2148) shows that the Analog input voltage shouldn't exceed the VREF+ ~10%. Since LiPoly batteris can put out as much as 4V when fully charged, this definitely falls outside of the reference voltage (which is coming off the 3.3V regulator). I guess I'll need a divider after all :(
User avatar
By ohararp
#18457
FYI. I am using some regulator that have a low voltage detect option and they recommend using ~500K and ~100K resistors for the voltage dividing resistors.
By rod_vdb
#18481
You must check your data sheet too. The ADC will have a maximum recomended input impedance. If your input imdepance is too high then the capacitor in the ADC will charge more slowly and you will have to try and slow the ADC down.

With most 18F PIC's this value is 2.5K Ohm so a 100k resistor sounds appealing but it might mess up your measurements...

Rod
User avatar
By roach
#18492
rod_vdb wrote:You must check your data sheet too. The ADC will have a maximum recomended input impedance. If your input imdepance is too high then the capacitor in the ADC will charge more slowly and you will have to try and slow the ADC down.

With most 18F PIC's this value is 2.5K Ohm so a 100k resistor sounds appealing but it might mess up your measurements...

Rod
This sounds important, but I have no idea what it means. In my (non-technical) glossary, "impedance" is the same as "resistance". I know there's a difference, just don't know what that is. Assuming I can find out the input impedance for the ADC, how would I factor this into my calculations for the resistances on the voltage divider?
By SOI_Sentinel
#18500
For this, impedance is the same as resistance. Impedance is actually the equivalent resistance of a circuit at a frequency, so it factors in frequency, capacitance, and inductance. You'll find more basic information on it in an electronics textbook (I have a few, best for the basics is Art of Electronics).

What's actually happening in your ADC is that a capacitor is being charged, then switched over to the ADC input (this is the "hold" part of sample and hold). To charge the capacitor fast enough, you need a certain current flow which is set by the circuit impedance. Problem with your high ohm resistor set is that it won't charge, so your readings will be unpredicatbly low. The normal answer to this issue is to feed the voltage divider into an op-amp (with shutdown pin hopefully) to buffer and provide the correct impedance. A shutdown pin will allow you to turn off the ADC when not needed. You also MIGHT (check with someone who knows analog more than me) be able to use the op-amp to scale the input, too, so you wouldn't need a voltage divider. This may not work since the inputs would swing outside the amp's rail to rail voltage, and may damage it. I don't know them that well.