Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

My relay fails, controlled by Uc

Status
Not open for further replies.

SimonTHK

Member
Hello

So I have a relay that turn on 12 v for a motor. But my program in my Uc kept to fail, so now I sat down and looked for weird things that could happen.
Suddenly once out of many, I see my relay fail. As soon as the Uc has to deliver the signal for the transistor to turn on the relay, the relay makes a small spark inside (between the mid leg and the one that provides the 12 volt.) It doesnt even get to move the relay "middle leg", before it makes a tiny spark, and the circuit fails.

I have a "safety" diode over the relay.

What can cause this? How can I solve it?

https://www.google.dk/search?q=rela...%2F115857%2Fflyback-diodes-and-relays;600;374
Check the link above, the first (good) is the one I use witha 4001. But maybe I should use the others, and does it act like mine does? Since I thought the diode was there for after releasing the power to the coil, and it would make some kinda induction.

Thanks in advance
 
Last edited:
Using a diode across the relay coil is good, but I think what you are seeing is sparking at the relay contacts as the relay switches the supply to the motor.

The sparking, or the current surge as the motor is switched is probably what causes the problem.
Is the microcontroller powered from the same supply as the motor?
Do the power wires to the motor run near the microcontroller wiring?

Can you show some pictures of the layout?
Can you show a schematic?

JimB
 
You actually may not be using a relay suited for an inductive load. These are usually called "Definate Purpose Contactors" and not relays.
 
When you say fail, do you mean fail permanently as in a dead chip or just a software fail?
If the software crashes then it could be noise from the switching arc or voltage surge from the inductive load getting into the uC power or data lines, you can much reduce a switch spark with a x rated capacitor and resistor as a snubber.
 
Since you're dealing with 12V, why not use a MOSFET switch? It's probably more economical and provides longevity and no EMI.
**broken link removed**

Also you probably need a 0.1uf decoupling capacitor near the uC power pins to block motor start transients. If there are bad transients resetting the micro, place a 0.01u, 0.1u and 1.0uf all in parallel near the uC power pins. If the problem persists you'd want to do some power rail filtering and ripple regulation. Consider an LM317 as an option to power the uC alone.

EDIT: Ensure that the motor's power comes directly from your power source and does not share power wiring with the electronics.
 
Last edited:
When you say fail, do you mean fail permanently as in a dead chip or just a software fail?
If the software crashes then it could be noise from the switching arc or voltage surge from the inductive load getting into the uC power or data lines, you can much reduce a switch spark with a x rated capacitor and resistor as a snubber.
I have a protective diode over the relay, to prevent the crashes caused by the induction. The spark is on the output of the relay, between the switch poles. Please tell me how a "snubber" works.

Like this? https://www.google.dk/search?q=capacitor+resistor+snubber&source=lnms&tbm=isch&sa=X&ei=j0NrVczxBsOfsgGgyYKoBw&ved=0CAcQ_AUoAQ&biw=1920&bih=943#imgrc=Y_hfdbTc005aHM%3A;OV2Z43eWm2lNQM;http%3A%2F%2Fsub.allaboutcircuits.com%2Fimages%2F04015.png;http%3A%2F%2Fwww.allaboutcircuits.com%2Fvol_4%2Fchpt_4%2F2.html;253;128
and the button be the relay ofc.
 
Last edited:
Since you're dealing with 12V, why not use a MOSFET switch? It's probably more economical and provides longevity and no EMI.
**broken link removed**

Also you probably need a 0.1uf decoupling capacitor near the uC power pins to block motor start transients. If there are bad transients resetting the micro, place a 0.01u, 0.1u and 1.0uf all in parallel near the uC power pins. If the problem persists you'd want to do some power rail filtering and ripple regulation. Consider an LM317 as an option to power the uC alone.

EDIT: Ensure that the motor's power comes directly from your power source and does not share power wiring with the electronics.
When the spark happens, it actually lowers the light of the led placed on my transformer. Means I cant prevent anything with capacitors.
Right now I use an lm7805. I would like to know, if you can explain to me, why using 3 different kind of capacitors in parallel is better than using a big electrolyte? Mostly because, I never did catch the reason for this :)
 
You actually may not be using a relay suited for an inductive load. These are usually called "Definate Purpose Contactors" and not relays.
I am just using a cheap small 12v relay, in my knowledge, contactors are used to draw much bigger currents. I cannot tell if the relay is of anything special, I would guess, it is quite average normal 12v relay for 230v output 10A
 
Since you're dealing with 12V, why not use a MOSFET switch? It's probably more economical and provides longevity and no EMI.
**broken link removed**

Also you probably need a 0.1uf decoupling capacitor near the uC power pins to block motor start transients. If there are bad transients resetting the micro, place a 0.01u, 0.1u and 1.0uf all in parallel near the uC power pins. If the problem persists you'd want to do some power rail filtering and ripple regulation. Consider an LM317 as an option to power the uC alone.

EDIT: Ensure that the motor's power comes directly from your power source and does not share power wiring with the electronics.
I have yet not been working with mosfets. I very much would like to do, so maybe I should look into trying this.
 
I would like to know, if you can explain to me, why using 3 different kind of capacitors in parallel is better than using a big electrolyte? Mostly because, I never did catch the reason for this :)
Electrolytic capacitors are cheap and small for large values, but they have quite a lot of inductance, so they are not very good for high frequency signals. Ceramic capacitors are large and expensive if large values are needed, but a small, cheap ceramic capacitor will have a much lower impedance at high frequencies than an electrolytic capacitor.
 
OK: relay & Motor
Actual ratings of each and particularly the link to the datasheet for the relay and the HP rating/voltage of the motor.

The relay needs a HP rating. The motor has an HP rating. 230 V 10 A generally means resistive.

What we need to see is if the HP rating of the contactor is >= the HP rating of the relay and If the relay contacts can switch AC if the motor is AC.
 
I think we misunderstood, is your software crashing, or is the uC blowing up?

A snubber is a rc network that goes across the switch contacts, it controls the rate of voltage change and max voltage lowering or preventing a spark.
 
I think we misunderstood, is your software crashing, or is the uC blowing up?

A snubber is a rc network that goes across the switch contacts, it controls the rate of voltage change and max voltage lowering or preventing a spark.
I couldnt know for sure what wasnt working, but one thing for sure, is that the relay seems to make these sparks, that interrupts and resets the Uc.
I would love to try out a snubber, I will do that when I got time.
 
You're getting inductive kick back from the DC motor coil arcing into your power rail causing a major transient. It can happen at turn on or turn off because of perhaps 20mS of relay contact bounce!
That will wear out the relay contacts and screw with the uC.

As you're running DC (Only Do this for a DC motor!) place a rev. biased diode across the motor similar to what you did for the relay. BTW, how much current is the motor taking, you may need a heavier duty fast rectifier.
Also have a look for RC snubbers. Perhaps a 0.1uF cap and a resistor about 10x the motor resistance can also do the job.
 
I think we misunderstood, is your software crashing, or is the uC blowing up?

A snubber is a rc network that goes across the switch contacts, it controls the rate of voltage change and max voltage lowering or preventing a spark.

So I tried this snubber across the switch contacts. 10kR and 100k, 10 pf capacitor. It seems to have helped or else I was just "lucky" to not get the spark while I was watching this time. Though it still did it.
 
You're getting inductive kick back from the DC motor coil arcing into your power rail causing a major transient. It can happen at turn on or turn off because of perhaps 20mS of relay contact bounce!
That will wear out the relay contacts and screw with the uC.

As you're running DC (Only Do this for a DC motor!) place a rev. biased diode across the motor similar to what you did for the relay. BTW, how much current is the motor taking, you may need a heavier duty fast rectifier.
Also have a look for RC snubbers. Perhaps a 0.1uF cap and a resistor about 10x the motor resistance can also do the job.
I will try to make a snubber with those numbers you mention. I am controlling the motors in both ways, using two more relays as to work as an h bridge. IThe relay that fails, is the relay I use to turn on power to the h bridge, because I wouldnt just switch turn with the 2 h-bridge relays, since I figured that could cause many problems.
Could I still be able to use two diodes? Pointing either way.
 
You're getting inductive kick back from the DC motor coil arcing into your power rail causing a major transient. It can happen at turn on or turn off because of perhaps 20mS of relay contact bounce!
That will wear out the relay contacts and screw with the uC.

As you're running DC (Only Do this for a DC motor!) place a rev. biased diode across the motor similar to what you did for the relay. BTW, how much current is the motor taking, you may need a heavier duty fast rectifier.
Also have a look for RC snubbers. Perhaps a 0.1uF cap and a resistor about 10x the motor resistance can also do the job.
Sadly this setup didnt work. The motor has 2 ohm throguh it, so I used 20 ohm resistor and a 0,1uF. It didnt work. I cant believe how difficult it is to drive a relay with a Uc xD Anyway, I have to keep trying or maybe I try and use some mosfet instead.
 
Status
Not open for further replies.

Latest threads

Back
Top