0
Offline
Newbie
Karma: 0
Posts: 24
Arduino rocks
|
 |
« on: March 06, 2011, 11:22:11 pm » |
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
Brattain Member
Karma: 282
Posts: 15442
Measurement changes behavior
|
 |
« Reply #1 on: March 06, 2011, 11:32:52 pm » |
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
Newbie
Karma: 0
Posts: 24
Arduino rocks
|
 |
« Reply #2 on: March 06, 2011, 11:42:33 pm » |
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
Offline
Brattain Member
Karma: 269
Posts: 17032
Available for Design & Build services
|
 |
« Reply #3 on: March 07, 2011, 12:59:12 am » |
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
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 24
Arduino rocks
|
 |
« Reply #4 on: March 07, 2011, 01:50:30 am » |
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!
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6969
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #5 on: March 07, 2011, 02:57:29 am » |
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
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 582
"Oops, try again..."
|
 |
« Reply #6 on: March 07, 2011, 09:07:21 am » |
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
|
|
|
|
|
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
God Member
Karma: 6
Posts: 582
"Oops, try again..."
|
 |
« Reply #7 on: March 07, 2011, 09:08:39 am » |
Reply to myself. I can always test it with a reference resistor, it is that simple.  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
Newbie
Karma: 0
Posts: 24
Arduino rocks
|
 |
« Reply #8 on: March 12, 2011, 03:00:50 am » |
They are 20k as stated in my first post 
|
|
|
|
|
Logged
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 582
"Oops, try again..."
|
 |
« Reply #9 on: March 12, 2011, 04:55:07 am » |
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
|
|
|
|
|
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
Full Member
Karma: 3
Posts: 142
jayduino rox
|
 |
« Reply #10 on: March 12, 2011, 06:47:07 am » |
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
God Member
Karma: 6
Posts: 582
"Oops, try again..."
|
 |
« Reply #11 on: March 12, 2011, 07:43:36 am » |
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
God Member
Karma: 4
Posts: 973
Arduino rocks
|
 |
« Reply #12 on: March 12, 2011, 08:51:43 pm » |
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
|
|
|
|
|
|