Wawa:
The diameter of the wire is irrelevant, and I already saw the use of internal pull up in your code.Internal (weak) pull up is ok for short wiring to a breadboard, but 36ft is like a big aerial.
It picks up lots of interference that you have to kill.
Try adding a 1k pull up resistor (you can leave the code as it is), and the capacitor I mentioned in post#1.
Leo..
I Will definitely try that and can i use interrupts instead of normal method of sensing the input? Will it be effective than the previous method i tried?