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.

Relay noise resets microcontroller

Status
Not open for further replies.

abicash

Member
Hello

I am driving an electromagnetic relay from a microcontroller pin (through a transistor switch)
When no load is across the Relay contact,the circuit works fine.
When some load (230V Incandescent lamp) is connected and the relay is turned on,my microcontroller jumps to unknown routines.
I tried to suppress the switching noise with help of a 0.1µF/630V in series with various resistors (5 ohms to 330 ohms) across the contacts ,but that doesn't work.
I tried an MOV 30V across the contacts but that seems to pass the current through.
Please suggest something .
Awaiting a valuable reply from helpful members.
Thanks and regards
 
hi,
How is the MCU powered, mains/battery etc and what decoupling do you have on the MCU power lines also does the MCU have any floating input pins.?
 
Hello thanks for reading and replying..much appreciated:)

The Neutral is not common with ground for the moment (but yes that is the plan later)

Currently I am running all the electronics from a 12V battery.
5V for the relay coil is got through 7805 and i further drop this voltage to 3.6V for the microcontrolelr.

No matter how i filter the contacts or the electronics,this problem is sustained.

I have put 0.1µf ceramic disc across the freewheel diode(1N4148),filtered(1microfarad) the Vcc of micro.And the snubbers as described earlier.
I CANNOT distance the micro from the Relay.(small form factor ckt)

Please help me out!!!

EDIT: Thanks eric for replying.
Yes some pins are floating on the MCU.Will that cause a problem?
I think some proper values for a snubber may solve the issue.Correct me if i am wrong

Thanks again
 
Last edited:
Currently I am running all the electronics from a 12V battery.
5V for the relay coil is got through 7805 and i further drop this voltage to 3.6V for the microcontrolelr.
What decoupling caps on the +5V and 3.3V power rails.?

EDIT: Thanks eric for replying.
Yes some pins are floating on the MCU.Will that cause a problem?

Are the floating INPUT pins that are being read as the program is running.?

hi,
The inrush current to a tungsten lamp can be as high as times its normal operating current.

This is one of the reasons that zero point phase switching is a better option than switching 'somewhere' on the ac mains phase
 
Hello Gayan

Thanks for the suggestion.
I will have to use a TRIAC driver(MOC3021) along with the TRIAC.The cost impact wont allow this.
A relay is a simple and cheap alternative and I have used it in many of my projects w/o this issue earlier.I dont know how this propped up now :confused:
 
Thanks eric for replying

hi,
The inrush current to a tungsten lamp can be as high as times its normal operating current.

This is one of the reasons that zero point phase switching is a better option than switching 'somewhere' on the ac mains phase

I have no room for a ZCD switching unfortunately.
The tungsten lamp is used only for testing purpose.The actual load will be a capacitive load (SMPS PSU of an electric appliance).
One of my friends suggested that the snubber for a relay contact should be around 1Kohm series 0.1µ/630V for a larger time constant..tried..no use :(

To answer your other queries,

1)1µf is on 3.3V and there is no filter now on 5V (but I had a 22µ earlier which i have removed out of frustration)
2)The floating pins aren't read and have no function.

please get back...
 
To answer your other queries,

1)1µf is on 3.3V and there is no filter now on 5V (but I had a 22µ earlier which i have removed out of frustration)
2)The floating pins aren't read and have no function.

please get back...

hi,
On the 5V and 3.3V supplies you should have at least one 100nF cap located near to the PIC supply pins as possible also at least a 47uF cap on both these supplies.
Especially the 5V which is powering the relay coil. I know that the relay [without the lamp connected] dosnt reset the PIC, but any noise on this rail could be 'added' to any noise due to switching the lamp and be sufficient to reset the PIC.

How do you have the PIC's 'MCLR' pin wired.???
 
Hello eric

I have 100nf on 5V as well as on 3.3V.
I had checked with all capacitors up to 100µf electrolytic on both supplies to no avail.

And to make one point clear,I am not using a PIC.
Its from Freescale :p ,which means there is no pin which should be pulled up other than for erasing.

I am really getting worked up and tired with this :(

When I put a particular value of RC across the contacts of relay,the code works for two to three switchings but then resumes its erroneous state after that.

Please help
 
hi,
Ive never used Freescale.

Do have any additional Freescale info that you could post that may give a clue to whats happening.?
 
Hello again :)

I am using MC9S08QG8

Its got a BKGD pin which is used to program the flash which is as close to MCLR that i can think of.Rest you can find in the link above.

Thanks and get back
 
Hello

I seem to have solved it :D

A snubber of 10 ohms + 330nf was connected across the contacts and a small 103 disc at a keyboard input on the board did it.

At least i can switch on the load any number of times for now..Lets see if it misbehaves in a while..

Thanks and regards
 
Hello

After all these days of testing I have realised that this Relay is putting lot of noise on the DC circuit.
To worsen the situation I have included a Transformerless PS of 5V.
The switching of Linear loads like tungsten lamps works fine but other loads like Fans,Fluorescent lamps reset the MCU.

So now I have to come to a solution based on Load being switched.If its a highly non-linear load,I will opt for a TRIAC circuit.
Any suggestions here?

Thanks as usual
 
People have been using micro controllers to switch relays for a very long time with little to no problems if everything is bypassed properly. Can you post a schematic of your circuit? Exactly how much current are these relays switching?
 
Hi Sceadwian

Thanks for reading and replying :)

I have bypassed almost everything now still the problem is consistent.
The Load that this relay switches is not much (75W@230Vac)
I checked it with a very small non-linear load (PSU of my Fn Generator)
It misbehaved on this meagre current too.

I think as eric suggested,i will have to use a ZCD switching.

Anyways..please find my schematic attached.

Thanks and regards
 

Attachments

  • Schem02.PNG
    75.7 KB · Views: 1,342
You don't have the reset line bypased... trusting the internal pullup on a reset line for a high noise application is just begging for trouble, use a low value resistor (1k) to tie the reset line to VCC and bypass it with another 10n cap to ground.
 
Last edited:
hrmf so much for that idea.
Have you tried using a big honking electrolytic to see if the extra hold up power helps, like maybe a few hundred or thousand U? You'd get a diode drop in the voltage but a diode to prevent the MCU's bypass capacitor from discharging to the power supply when the voltage dips might keep it from getting mixed up, however it will take your MCU a few seconds to turn off after power is actually removed depening on the size of the bypass cap you end up using.
 
Last edited:
I dont think that would be the problem.
I once saw a really small spike on its LEARN switch,which took it into a LEARN routine (which it shouldn't have)..and I guess thats doing it.

But this problem comes when a non-linear load is connected..Maybe more because of EMI/EMC of the relay switching.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top