Pages: [1]   Go Down
Author Topic: Which potentiometer to use with internal pull up?  (Read 1073 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17262
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 519
Posts: 26386
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-wink

Cheers!
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

 
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-wink

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
Logged


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

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Kari
Logged


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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

They are 20k as stated in my first post smiley
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

They are 20k as stated in my first post smiley

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
Logged


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

Italy
Offline Offline
Full Member
***
Karma: 3
Posts: 142
jayduino rox
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Juergen

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


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

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 990
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: