Power relay spikes reset PIC

Thread Starter

Russell

Joined Sep 20, 2006
13
Hi All

This is the first PIC project I've attempted.

It is a timer which turns on and off various devices (up to 15A) which run from a car supply. The PIC is powered from the same supply using a 78M05.

It worked fine on the breadboard and the PCB worked fine too. Unfortunately when I connected the output relays - conventional automotive relays - I encountered a problem which is that when the relay turns off the PIC resets -presumably due to the back emf as the current in the coil decays.

I have a couple of ideas:

1. put a diode on each relay - I've found a reference that suggests the back emf could be as much as 200V - but presumably the diode should stop it getting anywhere near that so that with an 80 ohm relay coil an IN4001 should be adequate?

2. Do something to the power supply to smooth out the spikes. I've been playing with capacitor values on the input of the 78M05 (up to 2.2uF)(datasheet recommends 0.33uF) but this doesn't seem to make any difference. I haven't got much space on the PCB. Could I use an electrolytic as during spikes it will be the wrong polarity?

I'd be grateful for any suggestions or ideas.

Thanks for reading.

Russell
 

hgmjr

Joined Jan 28, 2005
9,027
Greetings Russell,

It would be helpful if you would provide a schematic.

You should definitely add the flyback protection diodes across the relays. There a strong possiblity that the flyback voltage may damage the device you are using to drive the relays.

Another precaution should be the careful routing of the ground conductors. A single point ground scheme is always a good practice.

And it would not do any harm to make liberal use of capacitors to filter the power supply. In addition to several large polarized filter caps, small 0.1 uFd/25Volt caps should be used physically near each of the IC packages to provide better high frequency filtering.

hgmjr

PS. Welcome to the forum.
 

Thread Starter

Russell

Joined Sep 20, 2006
13
Thanks for those comments.

I've attached the schematic for the board. The PIC is driving 5 reed relays which then drive 5 power relays (off board not shown). There are some connection points for a couple of off board push buttons.

I used the reed relays because they were easy and kept the 12V and the logic separate as I thought (clearly mistakenly) that this would avoid problems.
 

Attachments

multi

Joined Sep 21, 2006
4
Hi Russell

I had seen your schematic diagram ,I would like to suggest you to add RC across relay coil which will be across freewheeling diode.You can use R values
say 47E,1W and C should be around 0.1uf to 0.2uf non polar.

Also better you add one more condensor say 10uf/25vdc to the output of regulator.
 

Thread Starter

Russell

Joined Sep 20, 2006
13
Oops just spotted an error that crept into the schematic while I was shrinking it. C4 should have one end connected to ground rather than 12V.

Thanks for those suggestions Multi. I hadn't thought about a cap on the regulator output as I was thinking about cleaning the input.

Why do you suggest RC across the diodes.

Russell
 

Spoggles

Joined Dec 2, 2005
67
Russel:
One other thing you may want to investigate. You may not have loaded the output of the 7805 regulator chip sufficiently to insure that it is regulating. These devices require a minimun load of 5ma. You may want to consider puting a 1k resistor on the output to insure at least a 5ma load at all times.
Also, there are lots of 8 output 20 pin 'dip' drivers out there that would take up alot less space and probably be more reliable than reed swithces.

Spoggles
 

Thread Starter

Russell

Joined Sep 20, 2006
13
Thanks to all who replied. It now seems to be working OK.

I've added the diodes to the relays, put a 50uF cap on the regulator output and added a resistor to load the regulator better (the resistor also discharges the cap if I want to turn off and on to reset).

Thanks again.

Russell
 
Thanks to all who replied. It now seems to be working OK.

I've added the diodes to the relays, put a 50uF cap on the regulator output and added a resistor to load the regulator better (the resistor also discharges the cap if I want to turn off and on to reset).

Thanks again.

Russell
I know that this might be too late but... Can you please send me some sort of schematic of how you connected them? Thanks!
 

SgtWookie

Joined Jul 17, 2007
22,230
I know that this might be too late but... Can you please send me some sort of schematic of how you connected them? Thanks!
This thread is over two years old, and the original poster has not been active here since then. It is not likely that you will receive a response from him.

But basically, you would connect a diode across each relay's coil connection. The diode is connected so that it will not conduct when the relay is energized, only when the coil is de-energized to take care of the reverse-EMF that occurs when the current through the coil of the relay is interrupted.

If the diodes are slow types (like 1N4004's, etc) you may want to use a small capacitor across the diode; say 330pF. This will give the diode more time to turn on.
 
Top