View previous topic :: View next topic |
Author |
Message |
hundil Guest
|
PIC reset |
Posted: Wed Feb 28, 2007 12:57 am |
|
|
Hiii everybody
I have a circuit with PIC 18F24J10.
PIC drives a BC817 transistor and 817 drives (turns on and off) a relay with 2x5A contacts. The relay contacts turn on and off a load of app. 1 A
Sometimes, the PIC resets itself unintentedly when the relay is on or off.
Watchdog and BOR is NOT used.
Is it due to noise or something else ?
Aurgent help will be appreciated.
hundil |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 28, 2007 1:20 am |
|
|
Go to this web page and scroll down about half-way.
http://www.kpsec.freeuk.com/components/diode.htm
Look at the section called: "Protection diodes for relays"
Do you have a protection diode installed in your circuit,
with the polarity as shown in the schematic ? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Wed Feb 28, 2007 1:21 am |
|
|
There are a few possible causes for this to happen.
1. Failure install a snubber diode or transorb across the relay coils
2. Insufficient filtering of the power supply. Do you have bypass capacitors installed before and after the voltage regulators? Do you have decoupling capacitors (0.1uF) across the PIC and other digital components?
3. Does the regulator deliver enough peak current to drive the circuit and the relay coil (also related to power supply filtering problem)
4. Is the MCLR floating (not a good idea)
5. Are the relay contacts voltage free (independant of the PICs power supply rails). If not (say the ground is common) then you could have an earth related problem. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
hundil Guest
|
PIC resets |
Posted: Wed Feb 28, 2007 2:46 am |
|
|
The relay has a fast reverse diode in parallel.
hundil |
|
|
hundil Guest
|
reset on PIC |
Posted: Wed Feb 28, 2007 3:43 am |
|
|
dear assmallri
thank you for your fast reply...
1- I use a fast snubber diode across the relay coil. in addition for a 12V / 0.5 A bulb load across relay contacts , nothing changes.
2- Power supply is a fully charged 12V - 2.0 Ah battery which remains very stable in terminal voltage all the time. I have 0.1 uF caps both at the input
and output of voltage regulator , also across the PIC.
3- The relay coil is not supplied from voltage regulator , it is supplied from the 2.0Ah battery via BC817 transistor . But the ground is the common.
4- It is difficult to do that.
5- Yes it is completely free.
hundil |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
|
Posted: Wed Feb 28, 2007 6:34 am |
|
|
I had a similar problem and found that I had voltage spike jumping from the relay contacts and relay coil. we had tried several remedies,
Low pass filter, resistor and cap across the relay coil/reverse diode.
relay to drive another relay that drives the load.
I didn't fix the problem, only reduced from constant reset to intermittent reset.
I found using opto isolation to switch relay's, mosphet/triac works for me, no load/reset fail.
Andrew _________________ What has been learnt if you make the same mistake? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
Re: reset on PIC |
Posted: Wed Feb 28, 2007 6:44 am |
|
|
hundil wrote: |
2- Power supply is a fully charged 12V - 2.0 Ah battery which remains very stable in terminal voltage all the time. I have 0.1 uF caps both at the input
and output of voltage regulator , also across the PIC.
|
Try putting a 10uF Tantalum capacitor on the ouotput of the voltage regulator. If you do not have a tantalum capacitor handy try a 100uF electrolytic capacitor.
storic wrote: |
I had a similar problem and found that I had voltage spike jumping from the relay contacts and relay coil. we had tried several remedies, |
I bet you didn't try a transorb :-) _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
Re: reset on PIC |
Posted: Wed Feb 28, 2007 3:18 pm |
|
|
asmallri wrote: |
storic wrote: |
I had a similar problem and found that I had voltage spike jumping from the relay contacts and relay coil. we had tried several remedies, |
I bet you didn't try a transorb :-) |
No, it will be one I will try in the future _________________ What has been learnt if you make the same mistake? |
|
|
|