Shop OBEX P1 Docs P2 Docs Learn Events
What's right way to read a potentiometer? — Parallax Forums

What's right way to read a potentiometer?

Nick McClickNick McClick Posts: 1,003
edited 2009-03-13 14:28 in General Discussion
I'm building a few hardware howtos for my new project boards. The boards support a potentiometer, and I'm wondering what the 'best' or most common way is to read potentiometers.

I'm familiar with the Prop, and reading a potentiometer with the prop is a 1 pin job (I've attached a screenshot from the tutorial). Just an RC decay circuit.

But I'm not familiar with the SX. Looking at bean's Cylon Lights, he uses 2 pins (Schematic attached). Is it the case for the SX that reading a pot is a 2 pin job, or bean's circuit atypical?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
400 x 162 - 15K
680 x 831 - 23K

Comments

  • BeanBean Posts: 8,129
    edited 2009-03-12 17:41
    Nick,
    You can do it either way.

    The 2-pin method on the SX (AnalogIn command) returns a value depending on the VOLTAGE, the 1-pin method (RCTime command) returns a value depending on the RESISTANCE.

    The 2-pin method always takes the same amount of time to get a reading. With the 1-pin method the execution time is dependant on the resistance being measured (and can take quite a long time if the resistance is high).

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...

    ·
  • Beau SchwabeBeau Schwabe Posts: 6,572
    edited 2009-03-12 18:43
    Something I'll add ... reading a VOLTAGE will provide a linear response, while reading the RESISTANCE will provide an exponential or logarithmic response which can lead to decreased sensitivity.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Nick McClickNick McClick Posts: 1,003
    edited 2009-03-13 01:25
    Right. Now it seems obvious to me that bean is using the Pot as a voltage divider and doing ADC to determine the position of the knob. Sounds like I should do a mini-howto on doing it both ways. Some designers might want the extra pin, and some might want better accuracy / faster readings.

    Is there a 'most common' resonator (like how people usually use a 5Mhz xtal with the prop)? Seems like 50Mhz is the most frequent.

    Related - is there a 'most common' Video DAC? I've seen a couple different Resistor ladders, I'm just wondering if there's a typical setup.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
  • BeanBean Posts: 8,129
    edited 2009-03-13 11:37
    Nick,
    As for "Most common" resonator. I prefer 20MHz. It is plenty fast for almost anything you throw and it, and it doesn't use alot of current like 50MHz does.
    50MHz also sometimes has startup issues depending on the resonator.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...

    ·
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2009-03-13 14:28
    For the SX28 and SX48 the resonators I use most are the 20Mhz and 4Mhz versions.

    Robert
Sign In or Register to comment.