Go Down

Topic: Do I need a resistor for a 50k potentiometer? (Read 2 times) previous topic - next topic

eyedoc

Here's my question, may be stupid but humor me......

My entire goal for workng with Arduino is to control servos using potentiometers.  So far so good no problems but I had one question.

If I am using a 50k potentiometer, do I need to use a resistor to interface with the servo?

Thanks in advance.

mem

Servos don't need a resistor; you can connect the servo signal line directly to an Arduino pin.

50k potentiometers will work but the datasheet recommends 10k or 20k for best performance.

eyedoc

Thanks for the response.  Can you give me a quick explanation as to why 10-20k works better than the 50?

Thanks

Anachrocomputer

There's a very small, but non-zero, current drawn from the pot by the analog input pin.  This small current ca affect the accuracy of the readings, and more so for higher resistance pots (think about Ohm's Law).  But it's a very small effect, so you may not find it a problem.

You don't need a fixed resistor if you want to connect pot(s) to an Arduino's analog input(s).  Wire the track of the pot from 5V to Ground, and connect the wiper to the analog input pin.

mem

#4
May 18, 2009, 02:01 pm Last Edit: May 18, 2009, 02:02 pm by mem Reason: 1
The analog to digital converter uses a capacitor to 'sample and hold' the input voltage to ensure it is stable while it is being measured. The circuit is optimized for 10k (or less) and higher values take longer to charge the sample and hold capacitor. I would expect that your project would work fine with the 50k pots but if you have not yet purchased them, 10k would be the optimal choice.

Vajnavi

Hi everyone Im having trouble with a project. Can i connect a potentiometer (any kind?) in digital in(s)?
I dont have more analog pins available for what Im working.

I hope you can help me

Thanks!

TchnclFl

Quote
Hi everyone Im having trouble with a project. Can i connect a potentiometer (any kind?) in digital in(s)?


No.  Digital pins read only HIGH or LOW (1 or 0).  They cannot read the variation of 0-1023 that you get with analog pins.

Vajnavi

Thanks for your help!! I'll save an analog pin for the pot.

And is it possible get a pulse (0 or 1)  in an analog pin?
I mean to connect a button in an pin.

Thanks!

TchnclFl

Quote
And is it possible get a pulse (0 or 1)  in an analog pin?
I mean to connect a button in an pin.


Do you mean use an analog pin for digital reading?  I'm not sure if you can call digitalRead() on those pins, but you could analogRead() and check to see if the value is greater than 100 or so (using a pull down resistor).

Vajnavi

Is 1 Kohm ok?

Do u mean Like this but going to an analog in? Is there any risk of doing it?



Im very new at programing, Im controlling a patch I made in Max and if that's  possible  I can use more buttons and have more fun!

Thanks for your help  

Grumpy_Mike

Quote
'm not sure if you can call digitalRead() on those pins,


Yes you can. If you refer to the pins as pin 14 for analogue 0, pin 15 for analogue 1 and so on.
Then they act just like the digital pins.

Go Up