Connecting pot to uc

Thread Starter

varunme

Joined Sep 29, 2011
60
is the below connection for pot with uC ok for real world , i connected in this way in real world but the analoge value changes at the same position of pot each time i switch on the board



Added a 4700uF/25V cap to powersupply, then also same
power supply is 9V/500mA DC
 

ErnieM

Joined Apr 24, 2011
8,377
is the below connection for pot with uC ok for real world , i connected in this way in real world but the analoge value changes at the same position of pot each time i switch on the board
The picture is fine for the pot connection. I cannot read the pot value but it should be at maximum twice the PIC's expected source impedance.

How are you determining what the "analoge value" is? Do you mean the pot wiper voltage changes when read on a DVM, or the digital value the A2D conversion produces changes?


Added a 4700uF/25V cap to powersupply, then also same
power supply is 9V/500mA DC
A written description is fairly useless to see what you are doing. A full schematic showing each and every part and device is far more useful.

You need 0.1 uF or so caps dire3ctly on the Vss & Vdd pins of the PIC (which do not even appear in your schematic).

Finally, you need to get a much better image host. ImageShack is a good free one. The one you use opens windows of spam & porn.
 

bertus

Joined Apr 5, 2008
22,270
Hello,

I have uploaded the image in post #3 localy. (due to a report of unwanted behaviour of the hosting site).
I also noticed that post #1 and #4 also contain images, but I can not see them, as they are hosted at Eectro Tech Online, on wich I do not have an account.
Please up load ALL images needed to the thread itself.

Bertus
 

Tahmid

Joined Jul 2, 2008
343
You may want to use an RC filter at the PIC ADC input. 1k resistor and 0.1uF capacitor may be okay.

How large is the voltage variation? Does the reading change when the wiper is NOT connected to the ADC input? Is the input supply voltage regulated and stable?
 

absf

Joined Dec 29, 2010
1,968
1. What if you isolate the wiper from the PIC input and measure on the wiper?
Does it still change?

2. Can we take a peep at the setup of your PIC program on the PORT A?

Allen
 

ErnieM

Joined Apr 24, 2011
8,377
You may want to use an RC filter at the PIC ADC input.
As the pot lives between the power supply rails there really isn't a source of noise to squelch out here. And as the supply is also the conversion reference voltage adding a low pass may actually add noise to the reading as the ref will change but not the input.

The a2d input needs a source resistance of less than 10K.
So I would use a 10K pot.
A 20K pot is the maximum acceptable for a 10K source resistance..
 

BillO

Joined Nov 24, 2008
999
A 20K pot is the maximum acceptable for a 10K source resistance..
The output impedance of a voltage divider is given by the paralleled partial resistances.

Where
Rich (BB code):
Vi-----------
             |
             R1
             |
             |---------------Vo
             |
             R2
             |
GND------------------------GND
Such that if Vo = (R2/(R1+R2))Vi, then output impedance is R1||R2.

This implies that if you need a source impedance of 10K or less, you would use a pot of 40K or less.
 

PaulEE

Joined Dec 23, 2011
474
The input impedance of the analog input on the pic expects a device whose signal output impedance does not exceed 10k....unless your sample clock is slowed down.
 
Top