- Mon Aug 28, 2017 5:34 pm
#69528
What should be done is have a high value resistor connected to the port pin. Use a relatively low resistance as a pull up resistor on the other side of the resistor connected to the port. Do not enable the internal pull up resistor. It is also desirable to have a small capacitor from the port pin to ground. Never expose port pins to the outside world.
I often us 10K as a series resistor but have also used 1M. The value of the pull up varies depending on the situation and the type of switch. 1K might work for most situations but sometime 330 Ohms might be required if I am concerned about the switch being able to close the circuit with light loads.
Most people don't know that switches and relays (also a switch) have minimum current rating as well as maximum. If the voltage and current is too low the switch may be physically close but electrically it could be open. Most of the time this is not a problem but I always keep it in mind. Mostly if it is a higher power rated switch. Many have silver surfaces. And silver tarnishes.
If you want to read more about this I found this, Contact Material Choices.
http://www.nkkswitches.com/pdf/switchco ... terial.pdfAnd if that wasn't enough for you, then The Performance Implications of Silver as a Contact Finish in Traditionally Gold Finished Contact Applications.
http://www.te.com/documentation/whitepa ... rs2009.pdf