Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F84A and relay sparks

Status
Not open for further replies.

fuzzzy

Full Member level 3
Joined
Oct 2, 2004
Messages
156
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,298
Location
ITALY
Activity points
1,650
Hi,


I've a circuit with a RC clocked PIC16F84A driving 2 12V relais for motor control by 2 npn transistor. I use a PIC port to start stop motor and 2 other ports to drive relais for clockwise and counterclockwise rotation.

My problem is that sometimes switching pushbutton my pic fails and it stops working and LM7805 that supply it becomes very very hot. This happens after sparks in relais contact.How can i prevent this? what component should i use?

Iyou can see my circuit in attached PDF
 

shoco

Newbie level 3
Joined
Oct 6, 2005
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,319
Re: PIC and relè

a diode in parallel connection with the inductor of th relay to prevent the crosscurrent
 

Moof

Full Member level 2
Joined
Nov 21, 2003
Messages
149
Helped
7
Reputation
14
Reaction score
1
Trophy points
1,298
Location
Argentina
Activity points
1,230
Re: PIC and relè

And i will put another diode to protect the 7805 connected in the in and out. Just look in the datasheet you will find how to proctect the 7805.
 

fuzzzy

Full Member level 3
Joined
Oct 2, 2004
Messages
156
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,298
Location
ITALY
Activity points
1,650
Re: PIC and relè

I tryed with a Diode before 7805 input but I've teh same problem.I'll try with a diode to separate motor GND from Circuit GND later.

What do you think if i use a bidirectional Transient suppressor as P6KE18CA parallel with 12V motor? should it be useful?
 

Davood Amerion

Advanced Member level 2
Joined
Mar 1, 2005
Messages
584
Helped
116
Reputation
232
Reaction score
24
Trophy points
1,298
Location
Persia
Activity points
6,345
PIC and relè

I dont know supply voltage value.
I think katode of D1 (insted of pin4) must connect to VCC.
And increase value of C1 to about 470uF or 1000uF.
And i think it is better to remove C9-C13 and use 4 diods, for free wheeling purpose in bridge network.

Regards,
Davood.
 

VVV

Advanced Member level 5
Joined
Nov 26, 2004
Messages
1,582
Helped
384
Reputation
768
Reaction score
87
Trophy points
1,328
Activity points
19,971
Re: PIC and relè

I think the problem is the reset circuit.

If you look in the datasheet, page 26, you will find the recommended reset circuit.
In you case, because of the diode going to /MCLR, voltage spikes higher than 5V can actually cause a latchup of the PIC. That is because the diode turns off and the /MCLR pin sees a large impedance.
I cannot say anything about the layout; that could be a problem, too.

So just implement the recommended reset circuit, first of all.
 

fuzzzy

Full Member level 3
Joined
Oct 2, 2004
Messages
156
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,298
Location
ITALY
Activity points
1,650
Re: PIC and relè

Hi VVV

I modified reset circuit as datasheet but the problem is the same.Sometimes after sparks there is a large current request frm 7805 and so Vout of 7805 become 1,8V instead of 5V it's like a short circuit. I cant Understand whic device could absorbe that amount of current.

for Davood Amerion Power supply is 12V. how should i put diodes instead of capacitors?
 

Davood Amerion

Advanced Member level 2
Joined
Mar 1, 2005
Messages
584
Helped
116
Reputation
232
Reaction score
24
Trophy points
1,298
Location
Persia
Activity points
6,345
PIC and relè

you can use one diode bridge
+ of them to +
- of them to ground
2 pins ~ of diode bridge to 2 pins of motor.

for voltage drop you must use high value of capacitor as i said before!
 

fuzzzy

Full Member level 3
Joined
Oct 2, 2004
Messages
156
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,298
Location
ITALY
Activity points
1,650
Re: PIC and relè

I used higher value capacitor. Voltage drop isn't transitory but it is continued.it will last till 7805 melt. There should be a device making a short circuit. but i can't understand what.
 

Davood Amerion

Advanced Member level 2
Joined
Mar 1, 2005
Messages
584
Helped
116
Reputation
232
Reaction score
24
Trophy points
1,298
Location
Persia
Activity points
6,345
PIC and relè

do you proper configure pin RB0?
for protect this you can insert one 1K resistor between PIN 6 IC3, and PIN 7 of IC1
 

philba

Full Member level 2
Joined
Jan 26, 2006
Messages
132
Helped
13
Reputation
26
Reaction score
1
Trophy points
1,298
Activity points
3,102
PIC and relè

Hmmm, the 7805 getting hot could be due in part to 7V dissipation (assuming the input is 12V) - 100mA current would give you .7 watts of dissipation. This would put it at around 40 C above ambient - pretty hot but not enough to destroy it. However if you get oscillation, that could add a lot more heat and push it over the edge.

You mentioned relay sparks - the only thing I see in your circuit that could allow that is some how R11 is directly connected to 12 yielding up to 36A. Have you verified the wiring of K2's contacts? if you have one of them backwards, it could cause your problem and would very likely spark as you mentioned. It would also deliver 12V to pin 3 of the the LM311.

Phil
 

fuzzzy

Full Member level 3
Joined
Oct 2, 2004
Messages
156
Helped
7
Reputation
14
Reaction score
2
Trophy points
1,298
Location
ITALY
Activity points
1,650
Re: PIC and relè

Hi,

nothing changes!!! 7805 doesn't get hot during normal work because it delivers very few current only for PIC. The problem rises after some relays switching.it get hotter and hotter and it's output voltage goes low(1,8V)
 

philba

Full Member level 2
Joined
Jan 26, 2006
Messages
132
Helped
13
Reputation
26
Reaction score
1
Trophy points
1,298
Activity points
3,102
PIC and relè

then you need to look at what your relays are doing. I still suspect you have a set of contacts wired backwards/ However, if any of caps c9-c13 are shorted, it would produce a similar problem.

I would put an ammeter on the 12V line to see what it's drawing.

Also, I would disconnect K2's contact (both poles) and see if the problem continues.
 

AVM_NOIDA

Member level 1
Joined
Jan 31, 2006
Messages
39
Helped
7
Reputation
14
Reaction score
5
Trophy points
1,288
Location
Asia
Activity points
1,749
Re: PIC and relè

Hi

Your schematic is very straight forward. However Please make sure that the current returned by motor does not share the ground wire between PIC and 7805. In fact I would run all the 5 V and 12 V grounds separately and join them just near the source (battery).

Added after 2 minutes:

Sorry chances of misunderstanding. I mean I will run the 5V ground separated from 12V ground and join these two near the source negative.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top