Relay Questions

Thread Starter

bnfdvn

Joined Dec 8, 2008
21
I am connecting several relays to a PIC (16F817) and am having trouble getting it to work reliably. The performance of the electronic circuitry is degrading. I did a search in the forums here and found a lot of good information but I have some questions about what I have read. First, I saw a recommendation that the diode on the relay coil be a 1N4006 (PIV 800 V). I am using a 1N4002 (PIV 50 V). Am I using the wrong diode?? The relays have 24 VDC coils.

Second, someone suggested adding a little capacitance (330 pF) across the coil to give the diodes time to turn on. This is the first that I have heard of this (certainly not an expert in the field but found it interesting that I hadn't heard of this before). Will this make the circuit more reliable??

Third, I am using a 2N2222 transistor to control the relay. The (-) of the relay is connected to the collector (+ of relay to 24 VDC), emitter to ground and the base is connected to the PIC through a 2.7KOhm resistor. The relay coil has a resistance of 2880 Ohms. Does anyone see any problems with this??

Lastly, I have 47 uF, 35 V capacitors on either side of the 7805T.

I have made some changes to the design since I did the schematic and I won't be able to update the schematic for a week or so but I was hoping the description above would be sufficient. Any suggestions for improvement to the above would be appreciated.
 

Ron H

Joined Apr 14, 2005
7,063
1N4002 has PIV=100V. The reverse voltage across the diode will not exceed the supply voltage.
Relay coils have a lot of stray capacitance. I have trouble believing that the voltage across a relay coil could slew to a significant voltage before a 1N400X diode turns on. If you are worried about it, use a 1N4148.
Your circuit sounds OK. Do you have a 100nF cap connected from Vcc to GND, very close to the PIC? Do you have a beefy, short ground connection between the two supplies?
 

Externet

Joined Nov 29, 2005
2,219
Sounds good; but add a 1uF bypass capacitor as near as possible to the uController supply pins.
If still unstable, disconnect the relays and confirm if operation becomes reliable again.

The loads can be pulling down the 7805 input.
It will not harm to use the recommended diode instead of a 50 piv, one may have been damaged open.
 

Thread Starter

bnfdvn

Joined Dec 8, 2008
21
I have 0.01 uF capacitors across the 5 VDC close to the PIC. Regarding the ground connection, I have the circuit wired on a breadboard, using 24 AWG solid wires. Should I add more wires between the ground rails on the breadboard to beef it up??
 

Ron H

Joined Apr 14, 2005
7,063
I have 0.01 uF capacitors across the 5 VDC close to the PIC. Regarding the ground connection, I have the circuit wired on a breadboard, using 24 AWG solid wires. Should I add more wires between the ground rails on the breadboard to beef it up??
It's hard to give advice without seeing your setup.
 

Thread Starter

bnfdvn

Joined Dec 8, 2008
21
Thanks for the advice and answers. I am headed to the airport now and will take another look at this, keeping in mind the above, next week after I get back.
 
Top