PIC + Relay

Thread Starter

TCOP

Joined Apr 27, 2011
94
Hi all,
I'm stuck with an engineering mistake and now I don't know how to handle it properly. My circuit is supposed to send singal to a din rail relay (12V / 220V). To make the long story short, only 3 cables leave from the rail and go to the mcu, which is about 10meters away. 2 for dc power and one from the one end of the relay's coil. The other end of the coil is getting +12 from the rail power unit.
On my mcu circuit, i connect the relay wire to the collector of a 2n4401 transistor and the emmiter is connected to gnd. So I am actually sinking. The base is taking signal from my mcu. Everything worked perfectly until I realised I was
getting some back EMF when i switched off the relay.
The problem is that i can't connect anywere a protection diode. I mean that i have no access to the 2 ends of the coil which stand on the rail but only on the one end that is connected on my transistor. So , how am i going to protect my circuit?
Adding a 4th cable must be my last option.
 
Last edited:

takao21203

Joined Apr 28, 2012
3,702
10m wire give you enough resistance the spike will run away on it's own.

They are not so much powerful. You get a small cable capacitor as well from 10m cable.
 

Thread Starter

TCOP

Joined Apr 27, 2011
94
I haven't tried it with a full length cable yet, but on my desk with 10 cm distance, i can get a LED flash for half a second when the transistor switches off, due to back emf, when i connect it reversed, on the power supply and the transistor's collector
 

takao21203

Joined Apr 28, 2012
3,702
For a 10m cable you need ESD protection.

One lightening strike, and your PCB will be gone.

There are plugable overvoltage arrestors. But they need 500 or 600V minimum.
 

Thread Starter

TCOP

Joined Apr 27, 2011
94
the pcb receives only 12v dc. Are you sure there is a possibility of an ESD?
Shouldnt the high voltage stop on the dc supply unit that is on the rail?
 

Thread Starter

TCOP

Joined Apr 27, 2011
94
@Markd77
I just tried a 10μF capacitor as suggested. On the simulator seems ok. I have a delay both in switching on and off but I think it is acceptable.
Anyway, if you were to redesign it. What would you do?
 

ErnieM

Joined Apr 24, 2011
8,377
<slaps head> Must be on stupid pills today.

Just put a zener diode across your transistor, somewhere between the 12V and the Vce of the switch. When the relay spikes the diode will avalanche and protect the transistor.
 

thatoneguy

Joined Feb 19, 2009
6,359
10m wire give you enough resistance the spike will run away on it's own.
Never accept that as "solving the problem". As an example, in the future, when the original design constraints are forgotten, the relay is moved to the board, or the board is moved closer to the relay? No protection diode across the transistor would kill it.
 

Thread Starter

TCOP

Joined Apr 27, 2011
94
Today, I contacted a local electronic shop. They offer an octal type rail socket for the 8 pin relays I use, that has a varistor in parallel with the coil, to suppress the EMF. The extra cost of switching to this socket is 2,5 euros, so I think that this is my best solution.
Thanks everyone for your help.
By the way, do you know if there is an optocoupler that can withstand about 150ma of current? I can't find one and I think that it would be a nice solution to completly isolate my pcb's inputs by using optocouplers, instead of using transistors.
 
Last edited:

Thread Starter

TCOP

Joined Apr 27, 2011
94
solid state was not an option since i am forced to use a din rail relay, that is already installed.
in addition, the cost of switching to a din rail solid state relay is about 25-35euros per relay.
 
Top