Hi, I am having a lot of trobbles with one of the inputs on a PIC18F4550. Everytime I connect an encoder from a AC motor the PIC seems to get a mind of its own and randomy turns on relays, outputs serial data, resets itself etc.. The encoder is currently connected to the PIC through an opto but shares the same power as the PIC. It has 3 wires (VDD, GND and OUTPUT) and requires 5v to operate. Because of this it is not truly isolated from the rest of the circuit.

I have tried shileding the wire with a metal conduit but did not help. I also shielded the 3 phase cable from the AC Drive Unit to the AC Motor and it also did not help. I have also placed 0.01 uF caps between every incoming wire and GND but also did not help.

It seems to only be this one sensor that is giving problems when the motor is engaged.

Any suggestions would be greatly appreciated.

Thanks.