voltage divider values

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

voltage divider values

Post by siliconchip »

hi all,
when using a pic micros analogue input to read a voltage which is 9 volts, i want to use 2 values the same so the input sees 4.5 volts for a 9 volt value,my question is would it be better to use 2 large value resistors ie 470k so the current draw is low on the supply or something like 2 4.7k resistors where the current would be higher, im unsure what analogue input current range the pic (16f1825) safely requires and would like to put less of a demand on the battery for better life, if i understand it correctly the input pins impedance would be in paralell with the dividers bottom resistor which would be a factor ??

regards bob

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: voltage divider values

Post by LeighM »

The datasheet gives a sampling current of about 250uA
which as you say will equate to a parallel resistor, of ~20K
So depends what kind of accuracy you require

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: voltage divider values

Post by QMESAR »

Hi
if i understand it correctly the input pins impedance would be in paralell with the dividers bottom resistor which would be a factor ??
This does matter and even more as you start to increase sampling rate ,the ADC max input impedance recomended by MCHP is around 2K for this reason you should use a impedance matching circuit in front of the ADC pin this is easily done by feeding the signal threw an OPAMP High input impedance and low output impedance for the OPAMP and your ADC measure accurately

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: voltage divider values

Post by siliconchip »

hi QMESAR,
thanks for the reply so if i understand right i will require a non - inverting op-amp circuit whose output impedance should be around 2K to match that of the analogue pins 2K,with the op amps input impedance 1 MOhm plus ?? and this would be dependant on feedback resistors used with the op amp, ??
and doing away with the original voltage divider
bob

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: voltage divider values

Post by siliconchip »

Hi all
Just a quick thought leighm mentioned the pic requires 250uA of sampling current therefore if i use a resistor divider of 2 68k resistors this would provide 297uA at the tap point plus if the pins impedance is 2K then wouldnt 68k in parallel with this be roughly 1.94k therefore nearly matching the pin ?

Bob

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: voltage divider values

Post by LeighM »

Hi Bob,
68k resistors would not provide a low enough source impedance.
Do you need to measure the voltage accurately, or is it just a "battery low" indicator?
Is this for a "maker" project, or a product designed for quantity production?
This will help determine the best way to go with this,
as there are various options, from a two resistor divider through to a buffered design as QMESAR suggests.

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: voltage divider values

Post by siliconchip »

Hi leigh

This is for a low battery indicator i was using 2 4.7k resistors and wondered on their size this is purely a hobby thing and not industrial, my readings are 0.04v out compared to a fluke DMM ie fluke reads 6.88v my indicator 6.84v so im happy with accuracy although it could always be better as for using 2 resistors im trying to limit the drain on the battery hence asking about values

Bob

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: voltage divider values

Post by LeighM »

In that case you might as well use high value resistors.
Two the same will limit the maximum ADC voltage to 4.5v.
The ADC input current draw when sampling will cause the ADC voltage to drop. But in this scenario you could calibrate the ADC readings for your own purposes. That is, determine the ADC value for battery low level.

siliconchip
Posts: 392
Joined: Wed Jan 05, 2011 11:24 am
Has thanked: 101 times
Been thanked: 24 times
Contact:

Re: voltage divider values

Post by siliconchip »

Hi leigh

Thanks for the reply ive calibrated it for low battery i was just curious as to value of resistors to limit current drain many thanks

Bob

Post Reply