Tuesday, 5 August 2014

pic - PIC16f877A resets due to external noise


I have faced this problem many times that I connects Relay with pic microcontroller and whenever I put Load on Relay's Contacts PIC16f877a 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?


Here is schematic, Crystal is attached as mentioned above enter image description here




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...