When creating a button a 10k ohm resistor is typical. If the button is distant, say at the end of a total of 20 feet of 20ga wire, is it a good idea to go with a higher resistance, maybe 2k?
ETM3:
When creating a button a 10k ohm resistor is typical.
Typical is to use the internal pullup.
ETM3:
If the button is distant, say at the end of a total of 20 feet of 20ga wire, is it a good idea to go with a higher resistance, maybe 2k?
It won't make any difference on a low speed signal like a button.
I must differ with you. If you are using long wires to the button, it may be wise to use a -lower- pull-up resistor such as 2k to increase noise immunity. A 1nF capacitor may be wise, too. Put both at the Arduino end of things.
Twisted wires are a good idea, too.
is it a good idea to go with a higher resistance, maybe 2k?
From a 10k, a 2k is not a higher resistance, Is it?
Definitely go with a low value resistor 600 ohm and a cap, both located at the Arduino. Twisted wire or coax. You may want to add some voltage clamping on the pin to keep it from going above VCC.
20 feet should be no problem unless you are running the wires alongside an AC mains circuit or high current DC motor circuits. twisting the wires makes any noise common mode which effectively neutralises it. Or I might be wrong
polymorph:
I must differ with you. If you are using long wires to the button...
If you're getting over 2V of noise on 20 feet of 20ga wire then you're running it past a radar installation and you need shielding, not a different resistor.
Or in a welding shop with a poorly grounded TIG or MIG welder.
I once had to go troubleshoot a "trembling" TV in someone's house. It had worked perfectly when brought into the shop. But the picture would intermittently "shiver" in the home.
Turned out to be a ceiling heating system installed by the homeowner's brother in law. He'd managed to run power to it in a big loop, and managed to install the thermostat on the low side so that the entire thing was at 120V when off.
So in addition to the trembling image, a previously unreported buzz in his stereo (cheap interconnecting cables and oxidized grounds) also went away.
I like my designs more robust. I never know what environment they'll be used in, so I try to take basic precautions. No reason to hang a long, high impedance antenna wire off of a piece of rather sensitive electronic equipment.
I don't think the OP has made a post, after the first. If the OP would give us some insight, as to whether the run is in high power areas or what, we can give some more accurate suggestions.
If there is no harsh environment, then the 10K pullup (or internal pullup) should work fine. If problems start showing up, I would first put on a capacitor (about .1mf). If there are still problems, lower the resistor value by half. If still problems take two wines and call us in the morning. LOL (my attempt at humor).
Are you still with us OP?
I know what you mean. Contractors installed a video system that sent video to all 30 cpu monitors in the classroom. Compared to other installs the image in this room looked like crap. Several contractors, several suppliers, everyone pointing the finger at the other guys. I told them that it looked like a ground loop problem. Electrical contractor came out spent several nights looking at the problem and then said there's nothing wrong with the electrical power. I told them there was. blah blah blah....Well, it turns out that the electrical contractor ran the neutral down one conduit and the line and ground through a different conduit. Each took a different path through the building, about 250' run. Measure with a meter and everything's fine. Ground loops are ghosts...gremlins!!! Been there. They spent almost 2 months on that problem. I told them what to look for but they didn't want to believe me.
....and a fine attempt at humor it was!