Question about potentiometers as voltage dividers  - Page 1
Forum section: electronics / beginners

author: little_carlos
author_rank: Regular Contributor
timestamp: April 15, 2016, 06:03:16 am
content: Whats the difference of using a 1k, 100k, 50k or 1M or bigger pot as a voltage divier? (apart from the resistance value)Im asking this, because i did a pwm control using a pot with a pic, and conecting the pot to the adc, i noticed that using small values like 1k pot give much more accuracy in the control than using 100k, which is pretty awfulcan someone explain me what is happening here?

author: Kilrah
author_rank: Unknown
timestamp: April 15, 2016, 06:29:03 am
content: The ADC has a tiny sampling cap that must be charged/discharged to the voltage you want to measure - the higher the impedance of your source the longer it will take.But normally if the wiper is jsut connected straight to the ADC input you shouldn't be seeing any difference in those ranges. It suggests you're doing something wrong, either in the circuit or in the PIC (having an internal pullup enabled on the pin for example).

author: ade
author_rank: Unknown
timestamp: April 15, 2016, 07:02:09 am
content: Or maybe they are different kinds of pots... e.g., 1k linear vs. 100k log or anti-log.

author: AndyC_772
author_rank: Super Contributor
timestamp: April 15, 2016, 08:05:20 am
content: We need to know what else your potential divider is connected to. Is its output just attached to the ADC, or are there any other components involved?Do you have a capacitor between the ADC pin and ground? And is it physically as close to the ADC as it can possibly be, with the shortest possible wires?Every time an ADC takes a sample, there's a small capacitor inside the PIC which must first be charged to the same voltage as you're looking to measure. This capacitor is part of a sample-and-hold circuit, which is required in order to ensure the ADC sees a constant voltage throughout the conversion process even if the external signal is changing.Charging up this capacitor takes time, and during this time, the ADC input draws a little current from whatever source it's sampling. On a scope you'll see this as a small negative spike on the signal each time a sample is taken, and the size of this spike depends on the source impedance of the signal you're measuring.With a high value pot, the spike will be larger than with a low value one.For an input which changes as slowly as a pot, normal practice is to put a much larger capacitor (somewhere around 100nF to 1uF should do) right next to the ADC input. This capacitor supplies the brief current spike required by the sample-and-hold circuit without affecting the dc accuracy of the system.Signals that change faster require a different approach, usually an active buffer right by the ADC - but you don't need one for this.

author: danadak
author_rank: Super Contributor
timestamp: April 15, 2016, 11:27:43 am
content: Some A/Ds buffer the sampling cap so that its charge cycle effects do notappear at pin. Then Hi Z pots incur offsets due to bias current of the buffer.Also Hi Z nodes are subject to stray pickup, C coupling, of other signalson board and in the environment. Take a scope with a 10X probe, hold theprobe tip, and observe the pickup that occurs from mains in the building.Regards, Dana.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 15, 2016, 11:54:30 am
content: The PIC µCs usually specify a maximum impedance of something like 2-10 K for the signal source. So if the signal source is higher impedance the errors can get larger.The pot output impedance is highest at the center, giving 1/4 of the pot value for the output impedance. So the 100 K pot is already a little on the high side for the ADC input. It gets better with an added 10-100nF capacitor to GND.In addition the high resistance circuit is more sensitive to capacitive coupled hum (e.g. 60 Hz).

author: rstofer
author_rank: Super Contributor
timestamp: April 15, 2016, 02:25:43 pm
content: 16F877 datasheet section 11.1 (page 114) says 10k maximum driving impedance. Always go to the source!http://ww1.microchip.com/downloads/en/DeviceDoc/30292D.pdfSo, the pot needs to be smaller than 40k and, without looking, I imagine 10k is the closest standard value.The concern with smaller values is wasted power, the concern with larger values is noise pickup. Adding a capacitor at the pin is always a good idea. Something like 0.1 ufd might be adequate.If there is a circuit driving the AD input that has high output impedance, it is often necessary to add an op amp voltage follower.

author: Zero999
author_rank: Super Contributor
timestamp: April 17, 2016, 09:34:05 am
content: Quote from: AndyC_772 on April 15, 2016, 08:05:20 amJust a couple of points:1) It works both ways. The capacitor in the sample and hold circuit will discharge back into the input source when the input voltage is reduced, causing it to rise slightly. Therefore if the input signal is falling, there will be tiny positive spikes when a sample is taken.2) If the input voltage is stable then the voltage on the sample and hold capacitor will reach an equilibrium over time, so this could potentially be solved with software, for a DC signal. Keep sampling the ADC until the signal changes less than a couple of counts, then you have the correct value. Of course, this will only work for an ADC, reading only one channel. If it's multiplexed, then the sample and hold capacitor will be charging/discharging as the ADC is switched from one channel to another, so it won't work.2) You mention PICs, yet the original poster hasn't specified an MCU. Presumably you've made this assumption because you're most familiar with PICs and they're quite common on the hobbyist scene but without knowing the exact MCU the original poster is using, it's difficult to say what's going on.

author: AndyC_772
author_rank: Super Contributor
timestamp: April 17, 2016, 10:11:21 am
content: Quote from: Hero999 on April 17, 2016, 09:34:05 amQuote from: little_carlos on April 15, 2016, 06:03:16 am

author: Zero999
author_rank: Super Contributor
timestamp: April 17, 2016, 11:13:27 am
content: Oh, sorry I missed that. Still, there are a wide range of different PICs so the specific part number would help.