Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By mmrvelj
#69526 Hi all

Thanks for the suggestions. I do have a long wire (actually a shilded coaxial cable ), and as I mentioned, it worked for a few months before it stopped. I did try to disconnect everything, it still reads low. I will try to connect +3.3V and see if there are any differences.

Also I will try to play with pull up and see if there are any differences.
User avatar
By rudy
#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.

Image

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

And 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