Go Down

Topic: Which potentiometer to use with internal pull up? (Read 1 time) previous topic - next topic

nutty

Hi,

I apologize in advance if this has been covered - I did the search first...

What value pot would be best to use with arduino's 20k pullups enabled?

The linear 10k I usually use read too low and I want to save myself some soldering.

Thanks
Alex

retrolefty


Hi,

I apologize in advance if this has been covered - I did the search first...

What value pot would be best to use with arduino's 20k pullups enabled?

The linear 10k I usually use read too low and I want to save myself some soldering.

Thanks
Alex


A little puzzling. A pot is normally a component one wires to a arduino analog input pin and read with a analogRead() statement. Pull-up resistors, internal or external are normally used just on digital input pins.

A pot with it's end terminals wired to ground and +5vdc and it's wiper wired to a analog input pin requires no other pull-up resistor, internal or external. The pot itself will always present a proper electrical signal to the input pin. A pull-up will just interfere with the normal 0-5vdc range that the pot will provide. So if you are enabling internal pull-up on a analog input pin, remove it and try your program again. If you still have problems just post your sketch and a drawing of your wiring and we will figure out your problem.

Lefty

nutty

Hi Lefty,

I was under the impression that enabling the pullup on analog pins would save the need to wire the pots to +5v.
By that logic I thought that a varying resistance between the analog pin and ground would be enough to get a proper reading.

I was obviously wrong
Best
Alex

CrossRoads

Try it & see.
What you might get for a high reading is ~ 5V*yourpot/(yourpot+20k)
So if your pot was big enough,  say 500K,  you might get 4.8V.

Or, the digitalWrite to turn on the internal pullup may cause the pin to be treated as a digital pin, not 100% clear on what would happen there between the chip and what the IDE/compiler does.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

nutty

Right now, with a 10k linear pot, analogRead gives me a range of 12 to 238. (I don't have other pots to play with) I'll stick with the standard 3 pin wiring and stop trying to cut corners  ;)

Cheers!

Graynomad

Quote
I'll stick with the standard 3 pin wiring and stop trying to cut corners

Good idea, using the internal resistor won't be repeatable anyway, I doubt they have consistent values.

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

GaryP


Right now, with a 10k linear pot, analogRead gives me a range of 12 to 238. (I don't have other pots to play with) I'll stick with the standard 3 pin wiring and stop trying to cut corners  ;)

Cheers!


I think you should get 0 when your turn all the way to GND??? But it is a good idea to do with all three wires, at least this time.

Could someone tell, what are the values of the internal pull-up resistors? I like the idea of using that possibility in certain cases.

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

GaryP

Reply to myself. I can always test it with a reference resistor, it is that simple.
:smiley-sad-blue:

Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

nutty


GaryP


They are 20k as stated in my first post :)


Right! I should read more carefully, my bad!

But still, why you don't get 0 when your potentiometer is turned fully to ground? Make no sense to me. There must be something internal in the input of the ADC? But again thinking, just the internal pull-up enabled shouldn't be anyhow different than using external 20k?

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

scjurgen


But still, why you don't get 0 when your potentiometer is turned fully to ground? Make no sense to me.


It does make sense, potentiometers might have a so called End Resistance and depends on the model you got.
Juergen

GaryP

Ok, so my quick calculation gives 351 ohms to the end resistance. Can it be? I have never heard of that before, but it can be possible, probably is.

I used 20k (internal) + 10k (pot), and clean 5V for this calculation.

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

bill2009

He internal pullups are NOT all 20k. The data sheet says they are 20 to 50k and I believe they are different for different models of avr.

Go Up