Hi,
It's all about energy. Whatever is causing the spike is coupling energy into the wires. Your CMOS input is high impendence so it doesn't take much current to pull the voltage one way or another. The LED in a opto isolator needs a fair bit of current and it's unlikely you'll get enough energy coupled into your wires to turn the LED on. An opto isolator with triac output most likely won't work though.I have some triac optoisolators laying around. Would I be able to use those to isolate the switch? I'm thinking to MacGyver something onto the back of the box and use a 5V supply to drive the opto's LED through the switch. Would these fluctuations still cause a problem though?
Where the wires enters the board, alternatively right at the input pin of the PIC. And yes, by "outside" of the cap I mean between the switch and the cap. The resistor and the cap will then form a low pass filter but again, you need to select the value taking the pullup resistor into account.For the cap/resistor. Should the 10-100nF cap be at the circuit end and by "outside of the cap" do you mean anywhere along the wire but not between the cap and the PIC?
I don't see how that should work. A diode could be used to clamp the spike so it doesn't go much above or below Vdd/Vss (to protect the input from damage due to over/under voltage) but if you clamp it so that the input does no longer see it it won't work under normal conditions either.Maybe a schotkey diode to catch the spikes?
Using shielded wires is a good idea and easy to try.
/Henrik.
Bookmarks