Connecting pot to uc

Discussion in 'Embedded Systems and Microcontrollers' started by varunme, Sep 1, 2012.

  1. varunme

    Thread Starter Member

    Sep 29, 2011
    59
    0
    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

    [​IMG]

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

    Senior Member

    Dec 29, 2010
    1,493
    372
    Your picture is too small to get any detail.
     
  3. varunme

    Thread Starter Member

    Sep 29, 2011
    59
    0
    [​IMG]
     
    Last edited by a moderator: Sep 2, 2012
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,389
    1,605
    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?
    [​IMG]

    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.
     
    varunme likes this.
  5. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,347
    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
     
    varunme likes this.
  6. varunme

    Thread Starter Member

    Sep 29, 2011
    59
    0
    wiper voltage changes when read on a DVM
     
  7. Tahmid

    Active Member

    Jul 2, 2008
    344
    25
    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?
     
  8. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    The a2d input needs a source resistance of less than 10K.
    So I would use a 10K pot.
     
  9. absf

    Senior Member

    Dec 29, 2010
    1,493
    372
    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
     
  10. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,389
    1,605
    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.

    A 20K pot is the maximum acceptable for a 10K source resistance..
     
  11. BillO

    Well-Known Member

    Nov 24, 2008
    985
    136
    The output impedance of a voltage divider is given by the paralleled partial resistances.

    Where
    Code ( (Unknown Language)):
    1.  
    2. Vi-----------
    3.              |
    4.              R1
    5.              |
    6.              |---------------Vo
    7.              |
    8.              R2
    9.              |
    10. GND------------------------GND
    11.  
    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.
     
  12. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,389
    1,605
    Correction noted. With a 40K pot R1 = R2 = 20K, and R1 || R2 = 10K.
     
  13. PaulEE

    Member

    Dec 23, 2011
    423
    32
    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.
     
Loading...