I have faced this problem many times that I connects Relay with pic microcontroller and whenever I put Load on Relay's Contacts PIC16f877a (http://www.kynix.com/Search/PIC16f877A.html) resets. I some time solve this problem by triggering another relay from basic relay attached to PIC. But this is not a solution. Can any one describes Why pic is affected with this relay spark. And what is really happening which causes pic to reset. Following things I have kept in mind while building circuit
I have 1K Pullup resistor on pin 1 (Reset pin) of Pic 16f877a
Fuses are, Power up timer = enable, Brown out detect = enable, LVP= disable, CP=enable
Power supply is filtered, ceramic capacitor of value .1uf connect across both ends of regulator
Crystal is 4MHz, and 33pf capacitor across crystal are close to (Circuit works fine, problem of reset occurs only when relay turns on with Load connected)
Relay is used of 12v/5amp ratings
C945 NPN Transistor is used to drive the relay
Reverse biase 1N4148 diode is connected across relay coil to save reverse leakeage
I never faces such problem in Atmel 89c51 microcontroller with same relay interfacing circuit. It is PIC who goes reset every time. But if do not connect any load to relay the circuit works fine. No reset occurs. Can any-one describes what is the issue with PIC?
Added 7 years, 1 month ago.
Sounds like you might need to separate the ground between the PIC side and the load side as you might have a ground spike from the load. Can you suppress the load ?
Answered 7 years, 1 month ago.
I agree. You need to electrically isolate the load from the driving circuit and microcontroller.This includes power and ground lines.
The inrush current for inductive load multiple times of normal operating current so rating of relay contact matters alot.If the relay is underrated,arcing might happen.
Answered 7 years, 1 month ago.
you might consider a small capacitance on the reset pin the PIC (I think the data sheets have recommendations). Make sure you have 0.1uF on every PIC power pin to ground and at least one 10uF for the PIC.
0.1uF for you regulator isn't very much, but the appropriate values depend on the load and transients it sees. You can't go wrong with a 0.1uF ceramic 10uF ceramic and 100uF electrolytic (this setup is overkill however)
Answered 7 years ago.