Right. Seen this one before. The motor represents a somewhat inductive
load. The relay contacts, when they break, generate a hefty arc across
the contacts. Of course, this has little to do with your flyback diode
on the coil. The powerful EMI from the contacts couples through any
means necessary and corrupts your PIC circuit. I had one unit that
would generate upwards of 60VPP hash surges on the PIC side of the
relay. The dead giveaway is when you put the scope ground on PIC
ground, and the probe to the same ground point. (bear with me on this
one). If you see hash on your scope, then it is EMI events. The scope
chassis ground cannot keep up with the high frequency events, and you
see a false image on the scope screen.
The easiest solution is to put a 0.1uF capacitor across the contacts to
supress the arc and subsequent EMI/EMC. If you want to get
sophisticated, you can go further and try to design a snubber of some
fashion that suits your load very closely.
BOL
Chris Eddy
Peter McAlpine wrote:
{Quote hidden}> Hi All,
> I have a little problem that my Pic that is switching on a motor
> via a relay is locking up :(
> The relay has a diode across it, and if I run it with no motor
> there is no problem. Only when the motor runs (12v windscreen
> washer motor) for over 2 - 3 seconds things lock up.
>
> Putting a diode across the motor seems to solve it, but have
> I only just solved the problem? What else should I look at
> doing?
>
> Thanks
> Regards
> Peter Mcalpine